Re: [PATCH 1/2] qemuDomainGetStats: Copy domain ID too

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

 



On Tue, Mar 28, 2017 at 05:15:07PM +0200, Michal Privoznik wrote:
> One of the problems with our virGetDomain function is that it
> copies just domain name and domain UUID. Therefore it's very
> easy to forget aboud domain ID. This can cause some bugs, like
> virConnectGetAllDomainStats not reporting proper domain IDs.
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  src/qemu/qemu_driver.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index d5fc00e..40c2eab 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -19556,6 +19556,9 @@ qemuDomainGetStats(virConnectPtr conn,
>      if (!(tmp->dom = virGetDomain(conn, dom->def->name, dom->def->uuid)))
>          goto cleanup;
>  
> +    /* We have to copy the domain ID by hand */
> +    tmp->dom->id = dom->def->id;
> +
>      *record = tmp;
>      tmp = NULL;
>      ret = 0;

ACK.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux