From d7b2679253504d6defa9fc7159b572cfd6a25a95 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Mon, 23 May 2011 09:08:01 +0200 Subject: [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 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index f90425a221..c8e19c8a8c 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 "); -- 2.47.2