On Wed, Jan 23, 2019 at 15:19:53 -0600, Eric Blake wrote:
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 maintenance
burden. And nbdkit has just added code to properly handle an
arbitrary number of MBR partitions, along with its existing code
for handling GPT partitions.
Note that obtaining the offsets of a partition 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.
Start the clock on the deprecation cycle, with an example of how
to write device subsetting without using -P.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
qemu-deprecated.texi | 27 +++++++++++++++++++++++++++
qemu-nbd.texi | 6 ++++--
qemu-nbd.c | 2 ++
3 files changed, 33 insertions(+), 2 deletions(-)
Libvirt does not use qemu-nbd in any way so it's okay from our POV.