[PATCH 08/10] qemuDomainDiskLookupByNodename: Look also for 'mirror' node names

Eric Blake eblake at redhat.com
Mon Jul 20 21:04:03 UTC 2020


On 7/15/20 8:10 AM, Peter Krempa wrote:
> When doing a block copy, there is another chain of images attached to a
> disk. Consider them as well when looking up a disk using nodename.
> 
> Signed-off-by: Peter Krempa <pkrempa at redhat.com>
> ---
>   src/qemu/qemu_domain.c | 8 ++++++++
>   1 file changed, 8 insertions(+)

Reviewed-by: Eric Blake <eblake at redhat.com>

> 
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index ed7ec77ed4..18fd445e30 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -11492,6 +11492,14 @@ qemuDomainDiskLookupByNodename(virDomainDefPtr def,
> 
>               return def->disks[i];
>           }
> +
> +        if (def->disks[i]->mirror &&
> +            (tmp = virStorageSourceFindByNodeName(def->disks[i]->mirror, nodename))) {
> +            if (src)
> +                *src = tmp;
> +
> +            return def->disks[i];
> +        }
>       }
> 
>       return NULL;
> 

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




More information about the libvir-list mailing list