]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuDomainGetStats: Copy domain ID too
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 28 Mar 2017 13:47:42 +0000 (15:47 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 29 Mar 2017 07:29:45 +0000 (09:29 +0200)
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@redhat.com>
src/qemu/qemu_driver.c

index d5fc00eba23137e569726b2b9ddf83c50a32a1bb..40c2eabad1847666aa32ba99117cde38614df44d 100644 (file)
@@ -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;