Check if the domain is active in virDomainObjGetPersistentDef

Calling virDomainObjSetDefTransient with live=false is a no-op
on an inactive domain.

Only call it on an active domain, since this is the only place using
the live bool.
This commit is contained in:
Ján Tomko 2016-05-27 13:33:04 +02:00
parent 9b111048ad
commit 1dcb1dc0f9

View File

@ -2936,7 +2936,8 @@ virDomainObjGetPersistentDef(virCapsPtr caps,
virDomainXMLOptionPtr xmlopt,
virDomainObjPtr domain)
{
if (virDomainObjSetDefTransient(caps, xmlopt, domain, false) < 0)
if (virDomainObjIsActive(domain) &&
virDomainObjSetDefTransient(caps, xmlopt, domain, false) < 0)
return NULL;
if (domain->newDef)