]> xenbits.xensource.com Git - libvirt.git/commitdiff
Check if the domain is active in virDomainObjGetPersistentDef
authorJán Tomko <jtomko@redhat.com>
Fri, 27 May 2016 11:33:04 +0000 (13:33 +0200)
committerJán Tomko <jtomko@redhat.com>
Mon, 6 Jun 2016 06:34:22 +0000 (08:34 +0200)
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.

src/conf/domain_conf.c

index 9f9fdf24190ef43772da86f8c04484842d6737da..ee25e01f9ef21bc2e2237a30639de83c0fddd6f6 100644 (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)