[libvirt] [PATCH] 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 --- tools/virsh-domain.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index b1ab911..3efaced 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -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))) { -- 1.9.3

On 07/04/2014 03:08 PM, Peter Krempa wrote:
Similary to cmdDetachDisk fetch the inactive definition when --config
*Similarly
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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
ACK Jan

On 07/07/14 12:24, Ján Tomko wrote:
On 07/04/2014 03:08 PM, Peter Krempa wrote:
Similary to cmdDetachDisk fetch the inactive definition when --config
*Similarly
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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
ACK
Oops I've pushed it without fixing the commit message. Now everybody will now that I'm terrible at spelling :( Thanks. Peter
participants (2)
-
Ján Tomko
-
Peter Krempa