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

[libvirt] [PATCH] storage: pick return value of qemu-img



qemu-img returns non-zero status on -h. Therefore we need to
provide virCommandRun() a non-NULL exit status pointer.
---
 src/storage/storage_backend.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index f90425a..c8e19c8 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -621,13 +621,14 @@ static int virStorageBackendQEMUImgBackingFormat(const char *qemuimg)
     char *end;
     char *tmp;
     int ret = -1;
+    int exitstatus;
     virCommandPtr cmd = virCommandNewArgList(qemuimg, "-h", NULL);
 
     virCommandAddEnvString(cmd, "LC_ALL=C");
     virCommandSetOutputBuffer(cmd, &help);
     virCommandClearCaps(cmd);
 
-    if (virCommandRun(cmd, NULL) < 0)
+    if (virCommandRun(cmd, &exitstatus) < 0)
         goto cleanup;
 
     start = strstr(help, " create ");
-- 
1.7.5.rc3


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