提交 87388228 编写于 作者: P Peter Krempa

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
上级 5bd3c73b
...@@ -10131,7 +10131,12 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd) ...@@ -10131,7 +10131,12 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd)
virDomainIsActive(dom) == 1) virDomainIsActive(dom) == 1)
flags |= VIR_DOMAIN_AFFECT_LIVE; 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; goto cleanup;
if (!(xml = virXMLParseStringCtxt(doc, _("(domain_definition)"), &ctxt))) { if (!(xml = virXMLParseStringCtxt(doc, _("(domain_definition)"), &ctxt))) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册