diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2019-02-05 12:46:18 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2019-02-05 12:46:18 +0000 |
commit | 1c3d45df5e94042d5fb2bb31416072563ab30e49 (patch) | |
tree | b93bbcb015f1a7e2b2cc14d26930536b0559faa1 /qemu-deprecated.texi | |
parent | 9ae805637a9cfab2edc15f56fbc3219815c8118e (diff) | |
parent | bc5a03350c220698229e7d6929dd242d5d358345 (diff) |
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 <eblake@redhat.com>" [full]
# gpg: aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [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 <peter.maydell@linaro.org>
Diffstat (limited to 'qemu-deprecated.texi')
-rw-r--r-- | qemu-deprecated.texi | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 9cc20b365c..8a6174df0c 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -160,3 +160,36 @@ Example of legacy encoding: The above, converted to the current supported format: @code{json:@{"file.driver":"rbd", "file.pool":"rbd", "file.image":"name"@}} + +@section Related binaries + +@subsection qemu-nbd --partition (since 4.0.0) + +The ``qemu-nbd --partition $digit'' code (also spelled @option{-P}) +can only handle MBR partitions, and has never correctly handled +logical partitions beyond partition 5. If you know the offset and +length of the partition (perhaps by using @code{sfdisk} within the +guest), you can achieve the effect of exporting just that subset of +the disk by use of the @option{--image-opts} option with a raw +blockdev using the @code{offset} and @code{size} parameters layered on +top of any other existing blockdev. For example, if partition 1 is +100MiB long starting at 1MiB, the old command: + +@code{qemu-nbd -t -P 1 -f qcow2 file.qcow2} + +can be rewritten as: + +@code{qemu-nbd -t --image-opts driver=raw,offset=1M,size=100M,file.driver=qcow2,file.backing.driver=file,file.backing.filename=file.qcow2} + +Alternatively, the @code{nbdkit} project provides a more powerful +partition filter on top of its nbd plugin, which can be used to select +an arbitrary MBR or GPT partition on top of any other full-image NBD +export. Using this to rewrite the above example results in: + +@code{qemu-nbd -t -k /tmp/sock -f qcow2 file.qcow2 &} +@code{nbdkit -f --filter=partition nbd socket=/tmp/sock partition=1} + +Note that if you are exposing the export via /dev/nbd0, it is easier +to just export the entire image and then mount only /dev/nbd0p1 than +it is to reinvoke @command{qemu-nbd -c /dev/nbd0} limited to just a +subset of the image. |