[Libguestfs] [PATCH nbdkit 5/8] partition: Implement mapping of extents.

Eric Blake eblake at redhat.com
Sat Mar 23 17:01:10 UTC 2019


On 3/20/19 5:11 PM, Richard W.M. Jones wrote:
> ---
>  filters/partition/partition.c | 36 +++++++++++++++++++++++++++++++++++
>  1 file changed, 36 insertions(+)

Looks the same as offset. Style question:


> +  if (next_ops->extents (nxdata, count, offs + h->offset,
> +                         flags, extents2, err) == -1)
> +    goto error;
> +
> +  for (i = 0; i < nbdkit_extents_size (extents2); ++i) {
> +    e = nbdkit_get_extent (extents2, i);
> +    e.offset -= h->offset;
> +    if (nbdkit_add_extent (extents, e.offset, e.length, e.type) == -1)

Would it be any simpler to avoid the -= above, and just call

add_extent(extents, e.offset - h->offset, e.length, e.type)

(If you do it in one patch, do it in both)

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20190323/2980d11d/attachment.sig>


More information about the Libguestfs mailing list