On Fri, Apr 11, 2008 at 05:16:03AM +0000, David Lutterkort wrote:
The way virResetError was used was incorrect: it can only be called
if
virConnCopyLastError returned a positive result. For some reason, in
your example virDomainShutdown fails, but the error status on the
connection seems to still be VIR_ERR_OK.
You have to be careful because some libvirt calls return error
indications without first setting up any virterror. These cases are
bugs in libvirt of course, but wearisome to find. (Well, I suggested
a method using static analysis to find them, but don't have the time
to implement it right now).
In any case you have to be prepared for this situation. The OCaml
bindings turn these cases into a "fake" VIR_ERR_INTERNAL_ERROR /
VIR_FROM_NONE / VIR_ERR_ERROR.
http://hg.et.redhat.com/applications/virt/applications/virt-top--devel?f=...
(line 68)
Rich.
--
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.
http://et.redhat.com/~rjones/virt-top