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 <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2017-03-28 15:47:42 +02:00
parent 2fe93123bf
commit ca8c36a9e3

View 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;