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.
This commit is contained in:
Michal Privoznik 2011-05-23 09:08:01 +02:00
parent 7ed95b2c4f
commit d7b2679253
1 changed files with 2 additions and 1 deletions

View 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 ");