Re: [PATCH] virsh: say save-image-edit failed only when it does

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2012年08月10日 21:20, Ján Tomko wrote:
The common code for editing files in virsh-edit.c expects EDIT_DEFINE to
return 0 on failure. virDomainSaveImageDefineXML returns 0 on success.
---
  tools/virsh-domain.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 33b1727..69e0133 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -2973,7 +2973,7 @@ cmdSaveImageEdit(vshControl *ctl, const vshCmd *cmd)
                      "not changed.\n"), file);           \
      ret = true; goto edit_cleanup;
  #define EDIT_DEFINE \
-    virDomainSaveImageDefineXML(ctl->conn, file, doc_edited, define_flags)
+    (virDomainSaveImageDefineXML(ctl->conn, file, doc_edited, define_flags) == 0)
  #define EDIT_FREE /* */
  #include "virsh-edit.c"


I think the more reliable way is to let the codes in virsh-edit.c
known what the expected return value is and check if the edit
succeeds or not by it.

But seems virDomainSaveImageDefineXML is the only *Define API
which returns 0 on success. so ACK and pushed.

Regards,
Osier

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]