Skip to contentSkip to conversation

finish qemu-nbd --partition deprecation

PATCH In review Eric Blake 3 participants 8 messages Jan 23, 2020 – Feb 19, 2020

lore
Share & tools
lore

Eric Blake

author
#0 lore raw

v2 cover finish qemu-nbd --partition deprecation

Based-on: <[email protected]> (0/3 convert qemu-nbd, qemu-block-drivers to rST)

In v2:
- rebased on top of rST doc changes
- patch 1 added

Eric Blake (2):
docs: Fix typo in qemu-nbd -P replacement
qemu-nbd: Removed deprecated --partition option

 docs/interop/qemu-nbd.rst |  15 ++---
 qemu-deprecated.texi      |  49 ++++++--------
 qemu-nbd.c                | 133 +-------------------------------------
 3 files changed, 24 insertions(+), 173 deletions(-)
Signature · 1 line
2.24.1
author
#1 lore raw

PATCH v2 1/2 docs: Fix typo in qemu-nbd -P replacement

The suggested replacement for the deprecated 'qemu-nbd -P' referw to 'file.backing.opt' instead of 'file.file.opt'; using the example verbatim results in:

qemu-nbd: Failed to blk_new_open 'driver=raw,offset=1m,size=100m,file.driver=qcow2,file.backing.driver=file,file.backing.filename=file4': A block device must be specified for "file"

Correct this text, prior to actually finishing the deprecation process.

Fixes 0ae2d54645eb
---
 qemu-deprecated.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qemu-deprecated.texi +1 -1
index 0968d37c745a..358eb6deebdc 100644
@@ -335,7 +335,7 @@ top of any other existing blockdev. For example, if partition 1 is
 
 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}
+@code{qemu-nbd -t --image-opts driver=raw,offset=1M,size=100M,file.driver=qcow2,file.file.driver=file,file.file.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
Signature · 1 line
2.24.1
Reviewed-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] docs: Fix typo in qemu-nbd -P replacement

Quoted 1 line · Eric Blake

The suggested replacement for the deprecated 'qemu-nbd -P' referw to

s/referw/refer/

Quoted 5 lines

'file.backing.opt' instead of 'file.file.opt'; using the example verbatim results in:

qemu-nbd: Failed to blk_new_open 'driver=raw,offset=1m,size=100m,file.driver=qcow2,file.backing.driver=file,file.backing.filename=file4': A block device must be specified for "file"

Quoted 9 lines

Correct this text, prior to actually finishing the deprecation process.

Fixes 0ae2d54645eb

---
qemu-deprecated.texi | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)

Jano

author
#3 lore raw

PATCH v2 2/2 qemu-nbd: Removed deprecated --partition option

In reply to Eric Blake

The option was deprecated in 4.0.0 (commit 0ae2d546); it's now been long enough with no complaints to follow through with that process.

---
 docs/interop/qemu-nbd.rst |  15 ++---
 qemu-deprecated.texi      |  49 ++++++--------
 qemu-nbd.c                | 133 +-------------------------------------
 3 files changed, 24 insertions(+), 173 deletions(-)
docs/interop/qemu-nbd.rst +4 -11
index 873bb9e17d56..2e20f84cf025 100644
@@ -72,13 +72,6 @@ driver options if ``--image-opts`` is specified.
 
   Export the disk as read-only.
 
-.. option:: -P, --partition=NUM
-
-  Deprecated: Only expose MBR partition *NUM*.  Understands physical
-  partitions 1-4 and logical partition 5. New code should instead use
-  :option:`--image-opts` with the raw driver wrapping a subset of the
-  original image.
-
 .. option:: -B, --bitmap=NAME
 
   If *filename* has a qcow2 persistent bitmap *NAME*, expose
@@ -224,14 +217,14 @@ a 1 megabyte subset of a raw file, using the export name 'subset':
     -t -x subset -p 10810 \
     --image-opts driver=raw,offset=1M,size=1M,file.driver=file,file.filename=file.raw
 
-Serve a read-only copy of just the first MBR partition of a guest
-image over a Unix socket with as many as 5 simultaneous readers, with
-a persistent process forked as a daemon:
+Serve a read-only copy of a guest image over a Unix socket with as
+many as 5 simultaneous readers, with a persistent process forked as a
+daemon:
 
 ::
 
   qemu-nbd --fork --persistent --shared=5 --socket=/path/to/sock \
-    --partition=1 --read-only --format=qcow2 file.qcow2
+    --read-only --format=qcow2 file.qcow2
 
 Expose the guest-visible contents of a qcow2 file via a block device
 /dev/nbd0 (and possibly creating /dev/nbd0p1 and friends for
qemu-deprecated.texi +18 -31

58 lines not on this page · raw message

qemu-nbd.c +2 -131

181 lines not on this page · raw message

Signature · 1 line
2.24.1
Reviewed-by on v2 2/2
#4 lore raw

Re: [PATCH v2 2/2] qemu-nbd: Removed deprecated --partition option

Quoted 10 lines · Eric Blake

The option was deprecated in 4.0.0 (commit 0ae2d546); it's now been long enough with no complaints to follow through with that process.

---

docs/interop/qemu-nbd.rst |  15 ++---
qemu-deprecated.texi      |  49 ++++++--------
qemu-nbd.c                | 133 +-------------------------------------
3 files changed, 24 insertions(+), 173 deletions(-)

Jano

author
#5 lore raw
In reply to Eric Blake

ping

Quoted 16 lines · Eric Blake

Based-on: <[email protected]> (0/3 convert qemu-nbd, qemu-block-drivers to rST)

In v2:
- rebased on top of rST doc changes
- patch 1 added

Eric Blake (2):
docs: Fix typo in qemu-nbd -P replacement
qemu-nbd: Removed deprecated --partition option

  docs/interop/qemu-nbd.rst |  15 ++---
  qemu-deprecated.texi      |  49 ++++++--------
  qemu-nbd.c                | 133 +-------------------------------------
  3 files changed, 24 insertions(+), 173 deletions(-)
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
#6 lore raw
Quoted 1 line · Eric Blake

ping

Do you want further review or is Ján’s sufficient for you?

Also, I wonder whether it would make a good GSoC/Outreachy/... project to add partition reading support to the raw block driver, or whether that’s a bad idea. O:-)

Max

author
#7 lore raw
Quoted 4 lines · Max Reitz
Quoted 1 line · Eric Blake

ping

Do you want further review or is Ján’s sufficient for you?

Commit 0bc16997 has already landed, so no further review will show in git history. But you're always welcome to raise issues that might result in follow-up patches.

Quoted 4 lines

Also, I wonder whether it would make a good GSoC/Outreachy/... project to add partition reading support to the raw block driver, or whether that’s a bad idea. O:-)

Personally, I think that since nbdkit already provides a good partition filter [1], any other implementation of a partition filter is duplicated effort. The only reason to teach qemu how to access an arbitrary partition is if it makes serving that arbitrary partition to a guest more efficient than what is currently possible by pointing qemu at an NBD server run by nbdkit with its partition filter. But in general, you are more likely to want qemu to serve an entire disk image file to the guest (and let the guest interpret partitions embedded within that file) than to have qemu serve a single partition to a guest (and have the guest treat that partition as a bare disk), so I don't see it as something that would be frequently used or needed in qemu.

[1] http://libguestfs.org/nbdkit-partition-filter.1.html

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org