From 3a53ab7913a68363bc8fc0c2354f9dfbaf25dee7 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Mon, 16 Feb 2009 22:51:31 +0000 Subject: [PATCH] Unbreak virsh *-edit commands: Don't pass unexpected flags to DumpXML --- ChangeLog | 5 +++++ src/Makefile.am | 2 ++ src/virsh.c | 5 +++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a86f7530ef..13a854d4dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Feb 16 17:59:04 EST 2009 Cole Robinson + + * src/virsh.c, src/Makefile.am: Don't pass flags to DumpXML + in *-edit virsh commands + Mon Feb 16 17:55:50 EST 2009 Cole Robinson * src/storage_backend_logical.c: Remove erroneous lvm volume diff --git a/src/Makefile.am b/src/Makefile.am index 9d934b43c1..3a798d22e1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -510,6 +510,7 @@ virsh-net-edit.c: virsh.c Makefile.am -e 's/Domain/Network/g' \ -e 's/cmdEdit/cmdNetworkEdit/g' \ -e 's/dom/network/g' \ + -e 's/int flags.*/int flags = 0;/g' \ >> $@-tmp chmod a-w $@-tmp rm -f $@ @@ -528,6 +529,7 @@ virsh-pool-edit.c: virsh.c Makefile.am -e 's/cmdEdit/cmdPoolEdit/g' \ -e 's/\(virStoragePoolDefineXML.*\));/\1, 0);/' \ -e 's/dom/pool/g' \ + -e 's/int flags.*/int flags = 0;/g' \ >> $@-tmp chmod a-w $@-tmp rm -f $@ diff --git a/src/virsh.c b/src/virsh.c index 57bd3969eb..298dde0c74 100644 --- a/src/virsh.c +++ b/src/virsh.c @@ -5397,6 +5397,7 @@ cmdEdit (vshControl *ctl, const vshCmd *cmd) char *doc = NULL; char *doc_edited = NULL; char *doc_reread = NULL; + int flags = VIR_DOMAIN_XML_SECURE | VIR_DOMAIN_XML_INACTIVE; if (!vshConnectionUsability(ctl, ctl->conn, TRUE)) goto cleanup; @@ -5406,7 +5407,7 @@ cmdEdit (vshControl *ctl, const vshCmd *cmd) goto cleanup; /* Get the XML configuration of the domain. */ - doc = virDomainGetXMLDesc (dom, VIR_DOMAIN_XML_SECURE | VIR_DOMAIN_XML_INACTIVE); + doc = virDomainGetXMLDesc (dom, flags); if (!doc) goto cleanup; @@ -5436,7 +5437,7 @@ cmdEdit (vshControl *ctl, const vshCmd *cmd) * it was being edited? This also catches problems such as us * losing a connection or the domain going away. */ - doc_reread = virDomainGetXMLDesc (dom, VIR_DOMAIN_XML_SECURE | VIR_DOMAIN_XML_INACTIVE); + doc_reread = virDomainGetXMLDesc (dom, flags); if (!doc_reread) goto cleanup; -- GitLab