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