]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
virsh: domain: Use inactive XML when unplugging interface with --config
authorPeter Krempa <pkrempa@redhat.com>
Fri, 4 Jul 2014 13:03:07 +0000 (15:03 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 7 Jul 2014 11:05:32 +0000 (13:05 +0200)
Similary to cmdDetachDisk fetch the inactive definition when --config
is specified as the active may not contain the network interface
if it was plugged with --config.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1056902

tools/virsh-domain.c

index b1ab9117fdd23f324ab7565e7af01ed0976caa58..3efacede8cc7cf8dcb78dac9cfc6cebc8015ecf7 100644 (file)
@@ -10131,7 +10131,12 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd)
         virDomainIsActive(dom) == 1)
         flags |= VIR_DOMAIN_AFFECT_LIVE;
 
-    if (!(doc = virDomainGetXMLDesc(dom, 0)))
+    if (flags & VIR_DOMAIN_AFFECT_CONFIG)
+        doc = virDomainGetXMLDesc(dom, VIR_DOMAIN_XML_INACTIVE);
+    else
+        doc = virDomainGetXMLDesc(dom, 0);
+
+    if (!doc)
         goto cleanup;
 
     if (!(xml = virXMLParseStringCtxt(doc, _("(domain_definition)"), &ctxt))) {