[libvirt] PATCH: don't print uninitialized integer in diagnostic

Jim Meyering jim at meyering.net
Thu Oct 30 16:26:21 UTC 2008


In adding a test of the vcpu cpuset parsing code (another patch coming
separately), I noticed a bogus diagnostic:

  virsh --connect test:///default dumpxml 1 > xml
  sed "s/vcpu>/vcpu cpuset='aaa'>/" xml > xml-invalid
  ./virsh --connect test:///default define xml-invalid 2>&1 |head -1
  libvir: Domain Config error : failed Xen syscall topology cpuset syntax error -2027441560

With the patch below, I get this output instead:
(i.e., same, but without the trailing negative number)

  $ ./virsh --connect test:///default define xml-invalid 2>&1 |head -1
  libvir: Domain Config error : failed Xen syscall topology cpuset syntax error


diff --git a/src/virterror.c b/src/virterror.c
index 21c7339..be809a0 100644
--- a/src/virterror.c
+++ b/src/virterror.c
@@ -1,7 +1,7 @@
 /*
  * virterror.c: implements error handling and reporting code for libvirt
  *
- * Copy:  Copyright (C) 2006 Red Hat, Inc.
+ * Copy:  Copyright (C) 2006, 2008 Red Hat, Inc.
  *
  * See COPYING.LIB for the License of this software
  *
@@ -516,7 +516,7 @@ __virErrorMsg(virErrorNumber error, const char *info)
                 errmsg = _("could not connect to Xen Store %s");
             break;
         case VIR_ERR_XEN_CALL:
-            errmsg = _("failed Xen syscall %s %d");
+            errmsg = _("failed Xen syscall %s");
             break;
         case VIR_ERR_OS_TYPE:
             if (info == NULL)




More information about the libvir-list mailing list