mirror of https://gitee.com/openkylin/libvirt.git
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:
parent
7ed95b2c4f
commit
d7b2679253
|
@ -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 ");
|
||||
|
|
Loading…
Reference in New Issue