mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
virsh: domain: Use inactive XML when unplugging interface with --config
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
This commit is contained in:
parent
5bd3c73bdf
commit
87388228f4
@ -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))) {
|
||||
|
Loading…
Reference in New Issue
Block a user