From: Michal Privoznik Date: Tue, 28 Mar 2017 13:47:42 +0000 (+0200) Subject: qemuDomainGetStats: Copy domain ID too X-Git-Tag: v3.2.0-rc2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca8c36a9e315613639ae14a5016da370c5a17477;p=thirdparty%2Flibvirt.git qemuDomainGetStats: Copy domain ID too 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 --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d5fc00eba2..40c2eabad1 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;