Daniel Veillard wrote:
On Tue, Jun 19, 2007 at 02:16:23PM +0100, Richard W.M. Jones wrote:
> (3) Split VIR_ERR_NO_SUPPORT into two categories. Currently this
> category mixes up cases where we fail to open a connection, and cases
> where there is no driver support for a particular operation (even with
> an open connection). In the first case, go through all the places which
> return this error and add proper diagnostic information to the error
> messages.
>
> -- Again, I am prepared to do this if people think it's a good idea.
It would be logical to separate the two, I think we already at the low level
do the difference but it doesn't show up at the error level.
The attached patch:
(1) Makes VIR_ERR_NO_SUPPORT mean that a function is not supported by
the hypervisor. It changes the message to be more specific and
coincidentally corrects a bug which was causing the optional info field
to be dropped.
(2) Makes VIR_ERR_NO_CONNECT mean that we could not connect to the
hypervisor.
(3) Deprecates VIR_ERR_CALL_FAILED, because the meaning and use of this
overlapped with VIR_ERR_NO_SUPPORT, and some calls failed with one and
other calls failed with the other. Accordingly it changes all
VIR_ERR_CALL_FAILED errors into VIR_ERR_NO_SUPPORT errors.
(4) Removes all error messages which occur before VIR_DRV_OPEN_DECLINED.
If a driver is declines a URI, then that is normal behaviour and no
reason to print an error. A later driver in the chain may accept the
URI, and if none of the drivers can accept it then libvirt.c:do_open
contains code to generate an error.
(5) If xen_unified.c was passed a naked string like "foo" as a URI then
it would try to use it as a relative file reference. This was wrong and
obscures a whole class of error message, so I've changed it so that
xen_unified.c will only try to accept an absolute pathname (eg.
///var/lib/xen/xend-socket).
Rich.
--
Emerging Technologies, Red Hat -
http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in
England and Wales under Company Registration No. 03798903