qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 0ae2d5: qemu-nbd: Deprecate qemu-nbd --partit


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 0ae2d5: qemu-nbd: Deprecate qemu-nbd --partition
Date: Tue, 05 Feb 2019 06:00:58 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 0ae2d54645eb2888af6dc7f701bc02ca18e4e656
      
https://github.com/qemu/qemu/commit/0ae2d54645eb2888af6dc7f701bc02ca18e4e656
  Author: Eric Blake <address@hidden>
  Date:   2019-02-04 (Mon, 04 Feb 2019)

  Changed paths:
    M qemu-deprecated.texi
    M qemu-nbd.c
    M qemu-nbd.texi

  Log Message:
  -----------
  qemu-nbd: Deprecate qemu-nbd --partition

The existing qemu-nbd --partition code claims to handle logical
partitions up to 8, since its introduction in 2008 (commit 7a5ca86).
However, the implementation is bogus (actual MBR logical partitions
form a sort of linked list, with one partition per extended table
entry, rather than four logical partitions in a single extended
table), making the code unlikely to work for anything beyond -P5 on
actual guest images. What's more, the code does not support GPT
partitions, which are becoming more popular, and maintaining device
subsetting in both NBD and the raw device is unnecessary duplication
of effort (even if it is not too difficult).

Note that obtaining the offsets of a partition (MBR or GPT) can be
learned by using 'qemu-nbd -c /dev/nbd0 file.qcow2 && sfdisk --dump
/dev/nbd0', but by the time you've done that, you might as well
just mount /dev/nbd0p1 that the kernel creates for you instead of
bothering with qemu exporting a subset.  Or, keeping to just
user-space code, use nbdkit's partition filter, which has already
known both GPT and primary MBR partitions for a while, and was
just recently enhanced to support arbitrary logical MBR parititions.

Start the clock on the deprecation cycle, with examples of how
to accomplish device subsetting without using -P.

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Richard W.M. Jones <address@hidden>
Reviewed-by: Stefano Garzarella <address@hidden>


  Commit: e6798f06a67a25def45a6636259de38cc38f1414
      
https://github.com/qemu/qemu/commit/e6798f06a67a25def45a6636259de38cc38f1414
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2019-02-04 (Mon, 04 Feb 2019)

  Changed paths:
    M block/nbd-client.c
    M include/block/nbd.h
    M nbd/client.c
    M nbd/common.c
    M nbd/server.c

  Log Message:
  -----------
  nbd: generalize usage of nbd_read

We generally do very similar things around nbd_read: error_prepend
specifying what we have tried to read, and be_to_cpu conversion of
integers.

So, it seems reasonable to move common things to helper functions,
which:
1. simplify code a bit
2. generalize nbd_read error descriptions, all starting with
   "Failed to read"
3. make it more difficult to forget to convert things from BE

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
[eblake: rename macro to DEF_NBD_READ_N and formatting tweaks;
checkpatch has false positive complaint]
Signed-off-by: Eric Blake <address@hidden>


  Commit: 7f86068dc1aceec8f6151a3a713e57e680f73b45
      
https://github.com/qemu/qemu/commit/7f86068dc1aceec8f6151a3a713e57e680f73b45
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2019-02-04 (Mon, 04 Feb 2019)

  Changed paths:
    M block/nbd-client.c

  Log Message:
  -----------
  block/nbd-client: split channel errors from export errors

To implement nbd reconnect in further patches, we need to distinguish
error codes, returned by nbd server, from channel errors, to reconnect
only in the latter case.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: d42f78e9400c51f1ae30dadd52995e4d6b052d89
      
https://github.com/qemu/qemu/commit/d42f78e9400c51f1ae30dadd52995e4d6b052d89
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2019-02-04 (Mon, 04 Feb 2019)

  Changed paths:
    M block/nbd-client.c
    M block/nbd-client.h
    M block/nbd.c

  Log Message:
  -----------
  block/nbd: move connection code from block/nbd to block/nbd-client

Keep all connection code in one file, to be able to implement reconnect
in further patches.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
[eblake: format tweak]
Signed-off-by: Eric Blake <address@hidden>


  Commit: b0e4b5a58fde6c0ed9edb9b683cfbbd8ab45c35d
      
https://github.com/qemu/qemu/commit/b0e4b5a58fde6c0ed9edb9b683cfbbd8ab45c35d
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2019-02-04 (Mon, 04 Feb 2019)

  Changed paths:
    M block/nbd-client.c

  Log Message:
  -----------
  block/nbd-client: split connection from initialization

Split connection code to reuse it for reconnect.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: 65e01d47653eb127fa917bd9d2f1824a00ab2de6
      
https://github.com/qemu/qemu/commit/65e01d47653eb127fa917bd9d2f1824a00ab2de6
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2019-02-04 (Mon, 04 Feb 2019)

  Changed paths:
    M block/nbd-client.c

  Log Message:
  -----------
  block/nbd-client: fix nbd_reply_chunk_iter_receive

Use exported report, not the variable to be reused (should not really
matter).

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: 88ed4e1bf0c7017c04fac2166ec9a7687aa21f97
      
https://github.com/qemu/qemu/commit/88ed4e1bf0c7017c04fac2166ec9a7687aa21f97
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2019-02-04 (Mon, 04 Feb 2019)

  Changed paths:
    M block/nbd-client.c

  Log Message:
  -----------
  block/nbd-client: don't check ioc

We have several paranoid checks for ioc != NULL. But ioc may become
NULL only on close, which should not happen during requests handling.
Also, we check ioc only sometimes, not after each yield, which is
inconsistent. Let's drop these checks. However, for safety, let's leave
asserts instead.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: bc5a03350c220698229e7d6929dd242d5d358345
      
https://github.com/qemu/qemu/commit/bc5a03350c220698229e7d6929dd242d5d358345
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2019-02-04 (Mon, 04 Feb 2019)

  Changed paths:
    M block/nbd-client.c
    M block/nbd-client.h

  Log Message:
  -----------
  block/nbd-client: rename read_reply_co to connection_co

This coroutine will serve nbd reconnects, so, rename it to be something
more generic.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: 1c3d45df5e94042d5fb2bb31416072563ab30e49
      
https://github.com/qemu/qemu/commit/1c3d45df5e94042d5fb2bb31416072563ab30e49
  Author: Peter Maydell <address@hidden>
  Date:   2019-02-05 (Tue, 05 Feb 2019)

  Changed paths:
    M block/nbd-client.c
    M block/nbd-client.h
    M block/nbd.c
    M include/block/nbd.h
    M nbd/client.c
    M nbd/common.c
    M nbd/server.c
    M qemu-deprecated.texi
    M qemu-nbd.c
    M qemu-nbd.texi

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2019-02-04' into 
staging

nbd patches for 2019-02-04

- deprecate 'qemu-nbd --partition'
- preparation for NBD reconnect, including better logging of read errors

# gpg: Signature made Tue 05 Feb 2019 03:50:56 GMT
# gpg:                using RSA key A7A16B4A2527436A
# gpg: Good signature from "Eric Blake <address@hidden>" [full]
# gpg:                 aka "Eric Blake (Free Software Programmer) 
<address@hidden>" [full]
# gpg:                 aka "[jpeg image of size 6874]" [full]
# Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A

* remotes/ericb/tags/pull-nbd-2019-02-04:
  block/nbd-client: rename read_reply_co to connection_co
  block/nbd-client: don't check ioc
  block/nbd-client: fix nbd_reply_chunk_iter_receive
  block/nbd-client: split connection from initialization
  block/nbd: move connection code from block/nbd to block/nbd-client
  block/nbd-client: split channel errors from export errors
  nbd: generalize usage of nbd_read
  qemu-nbd: Deprecate qemu-nbd --partition

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/9ae805637a9c...1c3d45df5e94



reply via email to

[Prev in Thread] Current Thread [Next in Thread]