[Libvir] [PATCH] add error message for the case of the vcpupin command fails.

Richard W.M. Jones rjones at redhat.com
Tue Mar 4 11:03:25 UTC 2008

OK, I'm going to qualify that a bit.  Is it always safe to access
arg->data?  I think probably it is, but I'm not sure so I modified the
patch slightly just to print an error message like this:

$ src/virsh -c test:///default vcpupin test AAA 0,1
error: vcpupin: Invalid or missing vCPU number.


PS. Please try to attach your patches instead of pasting them inline.

Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
-------------- next part --------------
Index: src/virsh.c
RCS file: /data/cvs/libvirt/src/virsh.c,v
retrieving revision 1.134
diff -u -r1.134 virsh.c
--- src/virsh.c	27 Feb 2008 16:14:44 -0000	1.134
+++ src/virsh.c	4 Mar 2008 11:05:56 -0000
@@ -1723,6 +1723,7 @@
     vcpu = vshCommandOptInt(cmd, "vcpu", &vcpufound);
     if (!vcpufound) {
+        vshError(ctl, FALSE, _("vcpupin: Invalid or missing vCPU number."));
         return FALSE;

More information about the libvir-list mailing list