[PATCH 2/3] Check if the domain is active in virDomainObjGetPersistentDef

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 568c699..baa51fd 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -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)
-- 
2.7.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]