Unbreak virsh *-edit commands: Don't pass unexpected flags to DumpXML

This commit is contained in:
Cole Robinson 2009-02-16 22:51:31 +00:00
parent c482439232
commit 3a53ab7913
3 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Mon Feb 16 17:59:04 EST 2009 Cole Robinson <crobinso@redhat.com>
* 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 <crobinso@redhat.com>
* src/storage_backend_logical.c: Remove erroneous lvm volume

View File

@ -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 $@

View File

@ -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;