]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: pick return value of qemu-img
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 23 May 2011 07:08:01 +0000 (09:08 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 23 May 2011 11:47:06 +0000 (13:47 +0200)
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

index f90425a22194507d1b7072db7b4630b4678ca644..c8e19c8a8c2fa2c41582115c48e663f751d918da 100644 (file)
@@ -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 ");