libvirt/src/xen
Eric Blake baa7244951 maint: improve VIR_ERR_NO_SUPPORT usage
We weren't very consistent in our use of VIR_ERR_NO_SUPPORT; many
users just passed __FUNCTION__ on, while others passed "%s" to
silence over-eager compilers that warn about __FUNCTION__ not
containing any %.  It's nicer to route all these uses through
a single macro, so that if we ever need to change the reporting,
we can do it in one place.

I verified that 'virsh -c test:///default qemu-monitor-command test foo'
gives the same error message before and after this patch:
error: this function is not supported by the connection driver: virDomainQemuMonitorCommand

Note that in libvirt.c, we were inconsistent on whether virDomain*
API used virLibConnError() (with VIR_FROM_NONE) or virLibDomainError()
(with VIR_FROM_DOMAIN); this patch unifies these errors to all use
VIR_FROM_NONE, on the grounds that it is unlikely that a caller
learning that a call is unimplemented can do anything in particular
with extra knowledge of which error domain it belongs to.

One particular change to note is virDomainOpenGraphics which was
trying to fail with VIR_ERR_NO_SUPPORT after a failed
VIR_DRV_SUPPORTS_FEATURE check; all other places that fail a
feature check report VIR_ERR_ARGUMENT_UNSUPPORTED.

* src/util/virerror.h (virReportUnsupportedError): New macro.
* src/libvirt-qemu.c: Use new macro.
* src/libvirt-lxc.c: Likewise.
* src/lxc/lxc_driver.c: Likewise.
* src/security/security_manager.c: Likewise.
* src/util/virinitctl.c: Likewise.
* src/libvirt.c: Likewise.
(virDomainOpenGraphics): Use correct error for unsupported feature.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-01-04 12:15:08 -07:00
..
block_stats.c Convert 'int i' to 'size_t i' in src/{xen,xenapi,xenxs} files 2013-07-10 17:40:13 +01:00
block_stats.h Convert Xen domain stats/peek driver methods to use virDomainDefPtr 2013-05-21 16:11:39 +01:00
xen_driver.c maint: improve VIR_ERR_NO_SUPPORT usage 2014-01-04 12:15:08 -07:00
xen_driver.h Use virObjectEventPtr instead of virDomainEventPtr 2013-12-10 12:45:21 +00:00
xen_hypervisor.c Don't call regfree() if regcomp() fails 2013-09-05 10:53:24 -06:00
xen_hypervisor.h Convert Xen domain stats/peek driver methods to use virDomainDefPtr 2013-05-21 16:11:39 +01:00
xen_inotify.c Use virObjectEventPtr instead of virDomainEventPtr 2013-12-10 12:45:21 +00:00
xen_inotify.h Simplify opening of Xen drivers 2013-05-09 13:16:19 +01:00
xend_internal.c maint: Kill usage of atoi() 2013-12-04 18:56:06 +01:00
xend_internal.h Convert Xen domain core dump driver methods to use virDomainDefPtr 2013-05-21 16:11:39 +01:00
xm_internal.c maint: avoid 'const fooPtr' in all remaining places 2013-10-14 14:34:38 -06:00
xm_internal.h Convert Xen domain stats/peek driver methods to use virDomainDefPtr 2013-05-21 16:11:39 +01:00
xs_internal.c Use virObjectEventPtr instead of virDomainEventPtr 2013-12-10 12:45:21 +00:00
xs_internal.h Simplify the Xen domain get info/state driver methods 2013-05-09 13:16:20 +01:00