]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Report binary path if error parsing -help
authorCole Robinson <crobinso@redhat.com>
Wed, 24 Feb 2010 16:44:36 +0000 (11:44 -0500)
committerCole Robinson <crobinso@redhat.com>
Thu, 25 Feb 2010 16:43:57 +0000 (11:43 -0500)
src/qemu/qemu_conf.c
src/qemu/qemu_conf.h
tests/qemuhelptest.c

index e3da08a56185e8bb21537512ac3b9ab618fa7039..1f8a9c341c8218900d5f31c3334c647f4faa32b9 100644 (file)
@@ -1237,7 +1237,8 @@ static unsigned long long qemudComputeCmdFlags(const char *help,
 
 #define SKIP_BLANKS(p) do { while ((*(p) == ' ') || (*(p) == '\t')) (p)++; } while (0)
 
-int qemudParseHelpStr(const char *help,
+int qemudParseHelpStr(const char *qemu,
+                      const char *help,
                       unsigned long long *flags,
                       unsigned int *version,
                       unsigned int *is_kvm,
@@ -1308,8 +1309,8 @@ fail:
         p = strndup(help, p - help);
 
     qemuReportError(VIR_ERR_INTERNAL_ERROR,
-                    _("cannot parse QEMU version number in '%s'"),
-                    p ? p : help);
+                    _("cannot parse %s version number in '%s'"),
+                    qemu, p ? p : help);
 
     VIR_FREE(p);
 
@@ -1340,12 +1341,13 @@ int qemudExtractVersionInfo(const char *qemu,
     enum { MAX_HELP_OUTPUT_SIZE = 1024*64 };
     int len = virFileReadLimFD(newstdout, MAX_HELP_OUTPUT_SIZE, &help);
     if (len < 0) {
-        virReportSystemError(errno, "%s",
-                             _("Unable to read QEMU help output"));
+        virReportSystemError(errno,
+                             _("Unable to read %s help output"), qemu);
         goto cleanup2;
     }
 
-    if (qemudParseHelpStr(help, &flags, &version, &is_kvm, &kvm_version) == -1)
+    if (qemudParseHelpStr(qemu, help, &flags,
+                          &version, &is_kvm, &kvm_version) == -1)
         goto cleanup2;
 
     if (retversion)
index ae187dc6e52f90797a743399a1391a5b78c520c1..c8757c53a1ef468fd74769673146e6dc56ee3294 100644 (file)
@@ -175,7 +175,8 @@ int         qemudExtractVersionInfo     (const char *qemu,
                                          unsigned int *version,
                                          unsigned long long *qemuCmdFlags);
 
-int         qemudParseHelpStr           (const char *str,
+int         qemudParseHelpStr           (const char *qemu,
+                                         const char *str,
                                          unsigned long long *qemuCmdFlags,
                                          unsigned int *version,
                                          unsigned int *is_kvm,
index 0f2b509b48edc8d90b3ccd663c778efc006ade16..ad355d7eb965a22eca6b4a14e4f4cee4c27c35d6 100644 (file)
@@ -49,7 +49,8 @@ static int testHelpStrParsing(const void *data)
     if (virtTestLoadFile(path, &help, MAX_HELP_OUTPUT_SIZE) < 0)
         return -1;
 
-    if (qemudParseHelpStr(help, &flags, &version, &is_kvm, &kvm_version) == -1)
+    if (qemudParseHelpStr("QEMU", help, &flags,
+                          &version, &is_kvm, &kvm_version) == -1)
         return -1;
 
     if (flags != info->flags) {