[libvirt] [PATCH 23/23] qemu: block: Add code to detect node names when necessary

Eric Blake eblake at redhat.com
Fri Mar 24 14:03:28 UTC 2017


On 03/15/2017 11:37 AM, Peter Krempa wrote:
> Detect the node names when setting block threshold and when reconnecting
> or when they are cleared when a block job finishes. This operation will
> become a no-op once we fully support node names.
> ---
>  src/qemu/qemu_block.c    | 98 ++++++++++++++++++++++++++++++++++++++++++++++++
>  src/qemu/qemu_block.h    |  4 ++
>  src/qemu/qemu_blockjob.c |  2 +
>  src/qemu/qemu_driver.c   |  5 +++
>  src/qemu/qemu_process.c  |  4 ++
>  5 files changed, 113 insertions(+)
> 

> +
> +static int
> +qemuBlockDiskDetectNodes(virDomainDiskDefPtr disk,
> +                         const char *parentnode,
> +                         virHashTablePtr table)
> +{
> +    qemuBlockNodeNameBackingChainDataPtr entry = NULL;
> +    virStorageSourcePtr src = disk->src;
> +
> +    /* don't attempt the detection if the top level already has node names */
> +    if (!parentnode || src->nodeformat || src->nodebacking)

Should that be
if (!parentnode && (src->nodeformat || src->nodebacking))

to match the comment?  As written, it looks like it short-circuits every
node that already has a node name, not just the parent node.

Otherwise looks good.  Now for me to apply the patches and see if I can
trigger the event to happen...

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170324/6627f5a5/attachment-0001.sig>


More information about the libvir-list mailing list