qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4 00/21] nbd: add qemu-nbd --list


From: Richard W.M. Jones
Subject: Re: [Qemu-devel] [PATCH v4 00/21] nbd: add qemu-nbd --list
Date: Sun, 20 Jan 2019 17:42:20 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, Jan 19, 2019 at 11:39:41AM +0000, Richard W.M. Jones wrote:
> 
> Attached is a NON-working patch to nbdkit-partitioning-plugin which
> adds logical partition support.  I don't think I've fully understood
> how the EBR fields are supposed to be initialized (or else they don't
> work how is described in online documentation).  This actually causes
> parted to print an internal error, while fdisk gives a warning and the
> size of the logical partition is wrong.
> 
> Anyway I've run out of time to work on it this weekend, but I may be
> able to have another look next week.

Sheesh.  Apparently the type byte in the link field must
be the extended partition type byte (eg. 0x5 or 0xf), NOT
the type of the next partition.

This fixes it:

$ git diff
diff --git a/plugins/partitioning/partition-mbr.c 
b/plugins/partitioning/partition-mbr.c
index 6f76432..6b256d1 100644
--- a/plugins/partitioning/partition-mbr.c
+++ b/plugins/partitioning/partition-mbr.c
@@ -129,7 +129,7 @@ create_mbr_layout (void)
          */
         region.start = enext->start - eptr0->start;
         region.len = rnext->end - enext->start + 1;
-        create_mbr_partition_table_entry (&region, false, files[i+1].mbr_id,
+        create_mbr_partition_table_entry (&region, false, 0xf,
                                           &ebr[i-3][0x1ce]);
       }
     }


I'll try to come up with a better patch with tests etc.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org



reply via email to

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