And from all related macros and functions. --- I posted v1 a year ago :) https://www.redhat.com/archives/libvir-list/2010-April/msg00164.html src/conf/cpu_conf.c | 2 +- src/conf/domain_conf.c | 2 +- src/conf/domain_event.c | 2 +- src/conf/interface_conf.c | 2 +- src/conf/network_conf.c | 2 +- src/conf/node_device_conf.h | 2 +- src/conf/nwfilter_conf.h | 6 ++-- src/conf/secret_conf.h | 2 +- src/conf/storage_conf.h | 2 +- src/cpu/cpu.h | 2 +- src/datatypes.c | 2 +- src/esx/esx_private.h | 2 +- src/esx/esx_vi.h | 2 +- src/fdstream.c | 2 +- src/interface/netcf_driver.c | 2 +- src/internal.h | 3 +- src/libvirt-qemu.c | 4 +- src/libvirt.c | 26 +++++++++--------- src/libxl/libxl_conf.h | 2 +- src/lxc/lxc_conf.h | 2 +- src/lxc/veth.c | 2 +- src/network/bridge_driver.c | 2 +- src/nodeinfo.c | 2 +- src/openvz/openvz_conf.h | 2 +- src/phyp/phyp_driver.c | 2 +- src/qemu/qemu_conf.h | 2 +- src/remote/remote_driver.c | 11 +++----- src/security/security_manager.h | 2 +- src/test/test_driver.c | 2 +- src/uml/uml_conf.h | 2 +- src/util/command.c | 2 +- src/util/conf.c | 4 +- src/util/event_poll.c | 2 +- src/util/hooks.c | 2 +- src/util/hostusb.c | 2 +- src/util/interface.c | 2 +- src/util/iptables.c | 2 +- src/util/json.c | 2 +- src/util/macvtap.c | 2 +- src/util/network.c | 2 +- src/util/pci.c | 2 +- src/util/sexpr.c | 4 +- src/util/stats_linux.c | 2 +- src/util/sysinfo.c | 2 +- src/util/util.c | 2 +- src/util/virterror.c | 14 +++------ src/util/virterror_internal.h | 13 ++++----- src/util/xml.c | 2 +- src/vbox/vbox_driver.c | 2 +- src/vbox/vbox_tmpl.c | 2 +- src/vmware/vmware_conf.h | 2 +- src/vmx/vmx.c | 2 +- src/xen/block_stats.c | 57 +++++++++++++++++++-------------------- src/xen/block_stats.h | 2 +- src/xen/xen_driver.c | 2 +- src/xen/xen_hypervisor.c | 6 ++-- src/xen/xen_inotify.c | 2 +- src/xen/xend_internal.c | 2 +- src/xen/xm_internal.c | 2 +- src/xen/xs_internal.c | 2 +- src/xenapi/xenapi_driver.c | 2 +- src/xenapi/xenapi_utils.c | 4 +- src/xenxs/xenxs_private.h | 2 +- 63 files changed, 122 insertions(+), 132 deletions(-) diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index 7f03eaa..ad49916 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -32,7 +32,7 @@ #define VIR_FROM_THIS VIR_FROM_CPU #define virCPUReportError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_CPU, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_CPU, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) VIR_ENUM_IMPL(virCPUMatch, VIR_CPU_MATCH_LAST, diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c827ef5..6b733d4 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -415,7 +415,7 @@ VIR_ENUM_IMPL(virDomainTimerMode, VIR_DOMAIN_TIMER_MODE_LAST, "smpsafe"); #define virDomainReportError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_DOMAIN, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_DOMAIN, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) #define VIR_DOMAIN_XML_WRITE_FLAGS VIR_DOMAIN_XML_SECURE diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c index 5f086bd..f0380d3 100644 --- a/src/conf/domain_event.c +++ b/src/conf/domain_event.c @@ -32,7 +32,7 @@ #define VIR_FROM_THIS VIR_FROM_NONE #define eventReportError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_THIS, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) struct _virDomainMeta { diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c index b24526f..2fa2fa0 100644 --- a/src/conf/interface_conf.c +++ b/src/conf/interface_conf.c @@ -46,7 +46,7 @@ virInterfaceDefDevFormat(virBufferPtr buf, const virInterfaceDefPtr def, int level); #define virInterfaceReportError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_INTERFACE, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_INTERFACE, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) static diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index dcab9de..5738757 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -53,7 +53,7 @@ VIR_ENUM_IMPL(virNetworkForward, "none", "nat", "route" ) #define virNetworkReportError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_NETWORK, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_NETWORK, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) virNetworkObjPtr virNetworkFindByUUID(const virNetworkObjListPtr nets, diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h index fe0f2bf..975abb3 100644 --- a/src/conf/node_device_conf.h +++ b/src/conf/node_device_conf.h @@ -219,7 +219,7 @@ struct _virDeviceMonitorState { }; # define virNodeDeviceReportError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_NODEDEV, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_NODEDEV, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) int virNodeDeviceHasCap(const virNodeDeviceObjPtr dev, const char *cap); diff --git a/src/conf/nwfilter_conf.h b/src/conf/nwfilter_conf.h index 9281f56..12e2a5c 100644 --- a/src/conf/nwfilter_conf.h +++ b/src/conf/nwfilter_conf.h @@ -647,9 +647,9 @@ void virNWFilterUnlockFilterUpdates(void); int virNWFilterConfLayerInit(virHashIterator domUpdateCB); void virNWFilterConfLayerShutdown(void); -# define virNWFilterReportError(code, fmt...) \ - virReportErrorHelper(NULL, VIR_FROM_NWFILTER, code, __FILE__, \ - __FUNCTION__, __LINE__, fmt) +# define virNWFilterReportError(code, fmt...) \ + virReportErrorHelper(VIR_FROM_NWFILTER, code, __FILE__, \ + __FUNCTION__, __LINE__, fmt) typedef int (*virNWFilterRebuild)(virConnectPtr conn, diff --git a/src/conf/secret_conf.h b/src/conf/secret_conf.h index 66294ce..4b47c52 100644 --- a/src/conf/secret_conf.h +++ b/src/conf/secret_conf.h @@ -27,7 +27,7 @@ # include "util.h" # define virSecretReportError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_SECRET, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_SECRET, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) VIR_ENUM_DECL(virSecretUsageType) diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h index 9e1f534..271441a 100644 --- a/src/conf/storage_conf.h +++ b/src/conf/storage_conf.h @@ -324,7 +324,7 @@ static inline int virStoragePoolObjIsActive(virStoragePoolObjPtr pool) { } # define virStorageReportError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_STORAGE, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_STORAGE, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) int virStoragePoolLoadAllConfigs(virStoragePoolObjListPtr pools, diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index 76d0e8e..9f01f17 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -31,7 +31,7 @@ # define virCPUReportError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_CPU, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_CPU, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) diff --git a/src/datatypes.c b/src/datatypes.c index 3edd1ff..4c4cbd0 100644 --- a/src/datatypes.c +++ b/src/datatypes.c @@ -32,7 +32,7 @@ #define VIR_FROM_THIS VIR_FROM_NONE #define virLibConnError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_THIS, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) /************************************************************************ diff --git a/src/esx/esx_private.h b/src/esx/esx_private.h index 1da2552..7ce237e 100644 --- a/src/esx/esx_private.h +++ b/src/esx/esx_private.h @@ -29,7 +29,7 @@ # include "esx_vi.h" # define ESX_ERROR(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \ + virReportErrorHelper(VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \ __LINE__, __VA_ARGS__) typedef struct _esxPrivate { diff --git a/src/esx/esx_vi.h b/src/esx/esx_vi.h index 560b2a6..75469ab 100644 --- a/src/esx/esx_vi.h +++ b/src/esx/esx_vi.h @@ -36,7 +36,7 @@ # define ESX_VI_ERROR(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \ + virReportErrorHelper(VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \ __LINE__, __VA_ARGS__) diff --git a/src/fdstream.c b/src/fdstream.c index 3475bfd..d2325ae 100644 --- a/src/fdstream.c +++ b/src/fdstream.c @@ -45,7 +45,7 @@ #define VIR_FROM_THIS VIR_FROM_STREAMS #define streamsReportError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_THIS, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) /* Tunnelled migration stream support */ diff --git a/src/interface/netcf_driver.c b/src/interface/netcf_driver.c index 0217b90..0190bf4 100644 --- a/src/interface/netcf_driver.c +++ b/src/interface/netcf_driver.c @@ -34,7 +34,7 @@ #define VIR_FROM_THIS VIR_FROM_INTERFACE #define interfaceReportError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_THIS, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) /* Main driver state */ diff --git a/src/internal.h b/src/internal.h index 4641fc1..0fa097c 100644 --- a/src/internal.h +++ b/src/internal.h @@ -232,8 +232,7 @@ do { \ unsigned long __unsuppflags = flags & ~(supported); \ if (__unsuppflags) { \ - virReportErrorHelper(NULL, \ - VIR_FROM_THIS, \ + virReportErrorHelper(VIR_FROM_THIS, \ VIR_ERR_INVALID_ARG, \ __FILE__, \ __FUNCTION__, \ diff --git a/src/libvirt-qemu.c b/src/libvirt-qemu.c index d914ac8..46727c8 100644 --- a/src/libvirt-qemu.c +++ b/src/libvirt-qemu.c @@ -29,11 +29,11 @@ #include "libvirt/libvirt-qemu.h" #define virLibConnError(conn, error, info) \ - virReportErrorHelper(conn, VIR_FROM_NONE, error, NULL, __FUNCTION__, \ + virReportErrorHelper(VIR_FROM_NONE, error, NULL, __FUNCTION__, \ __LINE__, info) #define virLibDomainError(domain, error, info) \ - virReportErrorHelper(NULL, VIR_FROM_DOM, error, NULL, __FUNCTION__, \ + virReportErrorHelper(VIR_FROM_DOM, error, NULL, __FUNCTION__, \ __LINE__, info) int diff --git a/src/libvirt.c b/src/libvirt.c index 0da9885..9e6784b 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -469,37 +469,37 @@ DllMain (HINSTANCE instance ATTRIBUTE_UNUSED, #endif #define virLibConnError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_NONE, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_NONE, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) #define virLibDomainError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_DOM, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_DOM, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) #define virLibNetworkError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_NETWORK, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_NETWORK, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) #define virLibStoragePoolError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_STORAGE, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_STORAGE, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) #define virLibStorageVolError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_STORAGE, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_STORAGE, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) #define virLibInterfaceError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_INTERFACE, code, __FILE__,\ + virReportErrorHelper(VIR_FROM_INTERFACE, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) #define virLibNodeDeviceError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_NODEDEV, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_NODEDEV, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) #define virLibSecretError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_SECRET, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_SECRET, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) #define virLibStreamError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_STREAMS, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_STREAMS, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) #define virLibNWFilterError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_NWFILTER, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_NWFILTER, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) -#define virLibDomainSnapshotError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_DOMAIN_SNAPSHOT, code, __FILE__, \ +#define virLibDomainSnapshotError(code, ...) \ + virReportErrorHelper(VIR_FROM_DOMAIN_SNAPSHOT, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) @@ -1056,7 +1056,7 @@ do_open (const char *name, STRCASEEQ(ret->uri->scheme, "xenapi") || #endif false)) { - virReportErrorHelper(NULL, VIR_FROM_NONE, VIR_ERR_INVALID_ARG, + virReportErrorHelper(VIR_FROM_NONE, VIR_ERR_INVALID_ARG, __FILE__, __FUNCTION__, __LINE__, _("libvirt was built without the '%s' driver"), ret->uri->scheme); diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h index f2f0d8a..8c87786 100644 --- a/src/libxl/libxl_conf.h +++ b/src/libxl/libxl_conf.h @@ -87,7 +87,7 @@ struct _libxlDomainObjPrivate { # define libxlError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_LIBXL, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_LIBXL, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) virCapsPtr diff --git a/src/lxc/lxc_conf.h b/src/lxc/lxc_conf.h index f820d6d..4f1ead3 100644 --- a/src/lxc/lxc_conf.h +++ b/src/lxc/lxc_conf.h @@ -66,7 +66,7 @@ int lxcLoadDriverConfig(lxc_driver_t *driver); virCapsPtr lxcCapsInit(void); # define lxcError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_LXC, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_LXC, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) #endif /* LXC_CONF_H */ diff --git a/src/lxc/veth.c b/src/lxc/veth.c index 26bf4ff..a00aa23 100644 --- a/src/lxc/veth.c +++ b/src/lxc/veth.c @@ -27,7 +27,7 @@ #define VIR_FROM_THIS VIR_FROM_LXC #define vethError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_LXC, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_LXC, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) /* Functions */ diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index f3952d4..8b5c1b6 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -70,7 +70,7 @@ #define VIR_FROM_THIS VIR_FROM_NETWORK #define networkReportError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_NETWORK, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_NETWORK, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) /* Main driver state */ diff --git a/src/nodeinfo.c b/src/nodeinfo.c index e1c9ad3..facac15 100644 --- a/src/nodeinfo.c +++ b/src/nodeinfo.c @@ -51,7 +51,7 @@ #define VIR_FROM_THIS VIR_FROM_NONE #define nodeReportError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_NONE, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_NONE, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) #ifdef __linux__ diff --git a/src/openvz/openvz_conf.h b/src/openvz/openvz_conf.h index 4673fa6..9a57551 100644 --- a/src/openvz/openvz_conf.h +++ b/src/openvz/openvz_conf.h @@ -34,7 +34,7 @@ # include "threads.h" # define openvzError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_OPENVZ, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_OPENVZ, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index ae2ed70..8f8c3ba 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -65,7 +65,7 @@ #define VIR_FROM_THIS VIR_FROM_PHYP #define PHYP_ERROR(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_PHYP, code, __FILE__, __FUNCTION__, \ + virReportErrorHelper(VIR_FROM_PHYP, code, __FILE__, __FUNCTION__, \ __LINE__, __VA_ARGS__) /* diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index 94918f6..f2bfa1e 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -146,7 +146,7 @@ struct _qemuDomainCmdlineDef { # define QEMUD_MIGRATION_NUM_PORTS 64 # define qemuReportError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_QEMU, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_QEMU, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index b979f71..e30780c 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -242,7 +242,7 @@ static int remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int #endif /* HAVE_POLKIT */ #define remoteError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_REMOTE, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_REMOTE, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) static virDomainPtr get_nonnull_domain (virConnectPtr conn, remote_nonnull_domain domain); @@ -8644,8 +8644,7 @@ remoteStreamHasError(virStreamPtr st) { } VIR_DEBUG0("Raising async error"); - virRaiseErrorFull(st->conn, - __FILE__, __FUNCTION__, __LINE__, + virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, privst->err.domain, privst->err.code, privst->err.level, @@ -10908,8 +10907,7 @@ cleanup: * convert missing remote entry points into the unsupported * feature error */ - virRaiseErrorFull(flags & REMOTE_CALL_IN_OPEN ? NULL : conn, - __FILE__, __FUNCTION__, __LINE__, + virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, thiscall->err.domain, VIR_ERR_NO_SUPPORT, thiscall->err.level, @@ -10921,8 +10919,7 @@ cleanup: "%s", *thiscall->err.message); rv = -1; } else { - virRaiseErrorFull(flags & REMOTE_CALL_IN_OPEN ? NULL : conn, - __FILE__, __FUNCTION__, __LINE__, + virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, thiscall->err.domain, thiscall->err.code, thiscall->err.level, diff --git a/src/security/security_manager.h b/src/security/security_manager.h index 3f88801..8d7c220 100644 --- a/src/security/security_manager.h +++ b/src/security/security_manager.h @@ -24,7 +24,7 @@ # define VIR_SECURITY_MANAGER_H__ # define virSecurityReportError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_SECURITY, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_SECURITY, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 17f5ad9..0978214 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -117,7 +117,7 @@ static const virNodeInfo defaultNodeInfo = { #define testError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_TEST, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_TEST, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) static int testClose(virConnectPtr conn); diff --git a/src/uml/uml_conf.h b/src/uml/uml_conf.h index 64df5f7..1105f84 100644 --- a/src/uml/uml_conf.h +++ b/src/uml/uml_conf.h @@ -64,7 +64,7 @@ struct uml_driver { # define umlReportError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_UML, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_UML, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) virCapsPtr umlCapsInit (void); diff --git a/src/util/command.c b/src/util/command.c index 2e475a0..862a913 100644 --- a/src/util/command.c +++ b/src/util/command.c @@ -38,7 +38,7 @@ #define VIR_FROM_THIS VIR_FROM_NONE #define virCommandError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_NONE, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_NONE, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) enum { diff --git a/src/util/conf.c b/src/util/conf.c index 71a344f..4b8afb8 100644 --- a/src/util/conf.c +++ b/src/util/conf.c @@ -100,13 +100,13 @@ virConfError(virConfParserCtxtPtr ctxt, /* Construct the string 'filename:line: info' if we have that. */ if (ctxt && ctxt->filename) { - virRaiseError(NULL, NULL, NULL, VIR_FROM_CONF, error, VIR_ERR_ERROR, + virRaiseError(NULL, NULL, VIR_FROM_CONF, error, VIR_ERR_ERROR, info, ctxt->filename, NULL, ctxt->line, 0, "%s:%d: %s", ctxt->filename, ctxt->line, info); } else { format = virErrorMsg(error, info); - virRaiseError(NULL, NULL, NULL, VIR_FROM_CONF, error, VIR_ERR_ERROR, + virRaiseError(NULL, NULL, VIR_FROM_CONF, error, VIR_ERR_ERROR, info, NULL, NULL, ctxt ? ctxt->line : 0, 0, format, info); diff --git a/src/util/event_poll.c b/src/util/event_poll.c index cd1ff4a..c5eedd3 100644 --- a/src/util/event_poll.c +++ b/src/util/event_poll.c @@ -44,7 +44,7 @@ #define VIR_FROM_THIS VIR_FROM_EVENT #define virEventError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_EVENT, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_EVENT, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) static int virEventPollInterruptLocked(void); diff --git a/src/util/hooks.c b/src/util/hooks.c index 819c95c..a409d77 100644 --- a/src/util/hooks.c +++ b/src/util/hooks.c @@ -42,7 +42,7 @@ #define VIR_FROM_THIS VIR_FROM_HOOK #define virHookReportError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_HOOK, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_HOOK, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) #define LIBVIRT_HOOK_DIR SYSCONFDIR "/libvirt/hooks" diff --git a/src/util/hostusb.c b/src/util/hostusb.c index 2d6e414..d5b478b 100644 --- a/src/util/hostusb.c +++ b/src/util/hostusb.c @@ -55,7 +55,7 @@ struct _usbDevice { #define VIR_FROM_THIS VIR_FROM_NONE #define usbReportError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_NONE, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_NONE, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) static int usbSysReadFile(const char *f_name, const char *d_name, diff --git a/src/util/interface.c b/src/util/interface.c index fe58823..5e1987a 100644 --- a/src/util/interface.c +++ b/src/util/interface.c @@ -42,7 +42,7 @@ #include "files.h" #define ifaceError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_NET, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_NET, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) #if __linux__ diff --git a/src/util/iptables.c b/src/util/iptables.c index 59f5cc7..76d412c 100644 --- a/src/util/iptables.c +++ b/src/util/iptables.c @@ -46,7 +46,7 @@ #define VIR_FROM_THIS VIR_FROM_NONE #define iptablesError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_THIS, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) enum { diff --git a/src/util/json.c b/src/util/json.c index be47f64..0daeae9 100644 --- a/src/util/json.c +++ b/src/util/json.c @@ -37,7 +37,7 @@ /* XXX fixme */ #define VIR_FROM_THIS VIR_FROM_NONE #define virJSONError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_NONE, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_NONE, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) diff --git a/src/util/macvtap.c b/src/util/macvtap.c index 346eaf6..a7af0cb 100644 --- a/src/util/macvtap.c +++ b/src/util/macvtap.c @@ -63,7 +63,7 @@ # define VIR_FROM_THIS VIR_FROM_NET # define macvtapError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_NET, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_NET, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) # define MACVTAP_NAME_PREFIX "macvtap" diff --git a/src/util/network.c b/src/util/network.c index 33028aa..eb16e0c 100644 --- a/src/util/network.c +++ b/src/util/network.c @@ -18,7 +18,7 @@ #define VIR_FROM_THIS VIR_FROM_NONE #define virSocketError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_THIS, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) /* diff --git a/src/util/pci.c b/src/util/pci.c index ff950d1..945f32a 100644 --- a/src/util/pci.c +++ b/src/util/pci.c @@ -82,7 +82,7 @@ struct _pciDeviceList { #define VIR_FROM_THIS VIR_FROM_NONE #define pciReportError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_NONE, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_NONE, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) /* Specifications referenced in comments: diff --git a/src/util/sexpr.c b/src/util/sexpr.c index da3d4b3..d6668f8 100644 --- a/src/util/sexpr.c +++ b/src/util/sexpr.c @@ -25,8 +25,8 @@ #define VIR_FROM_THIS VIR_FROM_SEXPR #define virSexprError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_SEXPR, code, __FILE__, \ - __FUNCTION__, __LINE__, __VA_ARGS__) + virReportErrorHelper(VIR_FROM_SEXPR, code, __FILE__, \ + __FUNCTION__, __LINE__, __VA_ARGS__) /** * sexpr_new: diff --git a/src/util/stats_linux.c b/src/util/stats_linux.c index 5397320..173cdc5 100644 --- a/src/util/stats_linux.c +++ b/src/util/stats_linux.c @@ -30,7 +30,7 @@ # define VIR_FROM_THIS VIR_FROM_STATS_LINUX # define virStatsError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_THIS, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) diff --git a/src/util/sysinfo.c b/src/util/sysinfo.c index 2b764ae..a865d25 100644 --- a/src/util/sysinfo.c +++ b/src/util/sysinfo.c @@ -41,7 +41,7 @@ #define VIR_FROM_THIS VIR_FROM_SYSINFO #define virSmbiosReportError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_SYSINFO, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_SYSINFO, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) #define SYSINFO_SMBIOS_DECODER "dmidecode" diff --git a/src/util/util.c b/src/util/util.c index 526f51c..d4d2610 100644 --- a/src/util/util.c +++ b/src/util/util.c @@ -89,7 +89,7 @@ verify(sizeof(gid_t) <= sizeof (unsigned int) && #define VIR_FROM_THIS VIR_FROM_NONE #define virUtilError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_NONE, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_NONE, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) /* Like read(), but restarts after EINTR */ diff --git a/src/util/virterror.c b/src/util/virterror.c index b7d8924..fbb4a45 100644 --- a/src/util/virterror.c +++ b/src/util/virterror.c @@ -663,7 +663,6 @@ virDispatchError(virConnectPtr conn) /** * virRaiseErrorFull: - * @conn: the connection to the hypervisor if available * @filename: filename where error was raised * @funcname: function name where error was raised * @linenr: line number where error was raised @@ -682,8 +681,7 @@ virDispatchError(virConnectPtr conn) * immediately if a callback is found and store it for later handling. */ void -virRaiseErrorFull(virConnectPtr conn ATTRIBUTE_UNUSED, - const char *filename ATTRIBUTE_UNUSED, +virRaiseErrorFull(const char *filename ATTRIBUTE_UNUSED, const char *funcname, size_t linenr, int domain, @@ -1214,7 +1212,6 @@ virErrorMsg(virErrorNumber error, const char *info) /** * virReportErrorHelper: * - * @conn: the connection to the hypervisor if available * @domcode: the virErrorDomain indicating where it's coming from * @errcode: the virErrorNumber code for the error * @filename: Source file error is dispatched from @@ -1226,8 +1223,7 @@ virErrorMsg(virErrorNumber error, const char *info) * Helper function to do most of the grunt work for individual driver * ReportError */ -void virReportErrorHelper(virConnectPtr conn, - int domcode, +void virReportErrorHelper(int domcode, int errcode, const char *filename, const char *funcname, @@ -1248,7 +1244,7 @@ void virReportErrorHelper(virConnectPtr conn, } virerr = virErrorMsg(errcode, (errorMessage[0] ? errorMessage : NULL)); - virRaiseErrorFull(conn, filename, funcname, linenr, + virRaiseErrorFull(filename, funcname, linenr, domcode, errcode, VIR_ERR_ERROR, virerr, errorMessage, NULL, -1, -1, virerr, errorMessage); @@ -1324,7 +1320,7 @@ void virReportSystemErrorFull(int domcode, if (!msgDetail) msgDetail = errnoDetail; - virRaiseErrorFull(NULL, filename, funcname, linenr, + virRaiseErrorFull(filename, funcname, linenr, domcode, VIR_ERR_SYSTEM_ERROR, VIR_ERR_ERROR, msg, msgDetail, NULL, -1, -1, msg, msgDetail); errno = save_errno; @@ -1348,7 +1344,7 @@ void virReportOOMErrorFull(int domcode, const char *virerr; virerr = virErrorMsg(VIR_ERR_NO_MEMORY, NULL); - virRaiseErrorFull(NULL, filename, funcname, linenr, + virRaiseErrorFull(filename, funcname, linenr, domcode, VIR_ERR_NO_MEMORY, VIR_ERR_ERROR, virerr, NULL, NULL, -1, -1, virerr, NULL); } diff --git a/src/util/virterror_internal.h b/src/util/virterror_internal.h index 8f32f41..df4b1d2 100644 --- a/src/util/virterror_internal.h +++ b/src/util/virterror_internal.h @@ -33,8 +33,7 @@ extern void *virUserData; * * ************************************************************************/ int virErrorInitialize(void); -void virRaiseErrorFull(virConnectPtr conn, - const char *filename, +void virRaiseErrorFull(const char *filename, const char *funcname, size_t linenr, int domain, @@ -46,22 +45,22 @@ void virRaiseErrorFull(virConnectPtr conn, int int1, int int2, const char *fmt, ...) - ATTRIBUTE_FMT_PRINTF(13, 14); + ATTRIBUTE_FMT_PRINTF(12, 13); /* Includes 'dom' and 'net' for compatbility, but they're ignored */ -# define virRaiseError(conn, dom, net, domain, code, level, \ +# define virRaiseError(dom, net, domain, code, level, \ str1, str2, str3, int1, int2, msg, ...) \ - virRaiseErrorFull(conn, __FILE__, __FUNCTION__, __LINE__, \ + virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ domain, code, level, str1, str2, str3, int1, int2, \ msg, __VA_ARGS__) const char *virErrorMsg(virErrorNumber error, const char *info); -void virReportErrorHelper(virConnectPtr conn, int domcode, int errcode, +void virReportErrorHelper(int domcode, int errcode, const char *filename ATTRIBUTE_UNUSED, const char *funcname ATTRIBUTE_UNUSED, size_t linenr ATTRIBUTE_UNUSED, const char *fmt, ...) - ATTRIBUTE_FMT_PRINTF(7, 8); + ATTRIBUTE_FMT_PRINTF(6, 7); void virReportSystemErrorFull(int domcode, int theerrno, diff --git a/src/util/xml.c b/src/util/xml.c index 2c50e14..d2989e2 100644 --- a/src/util/xml.c +++ b/src/util/xml.c @@ -26,7 +26,7 @@ #define VIR_FROM_THIS VIR_FROM_XML #define virGenericReportError(from, code, ...) \ - virReportErrorHelper(NULL, from, code, __FILE__, \ + virReportErrorHelper(from, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) #define virXMLError(code, ...) \ diff --git a/src/vbox/vbox_driver.c b/src/vbox/vbox_driver.c index 9526ee4..fc43b8c 100644 --- a/src/vbox/vbox_driver.c +++ b/src/vbox/vbox_driver.c @@ -66,7 +66,7 @@ static virDriver vboxDriverDummy; #define VIR_FROM_THIS VIR_FROM_VBOX #define vboxError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_VBOX, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_VBOX, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) int vboxRegister(void) { diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index 3ca34dd..8241d34 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -133,7 +133,7 @@ typedef IMediumAttachment IHardDiskAttachment; #endif /* VBOX_API_VERSION >= 3001 */ #define vboxError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_VBOX, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_VBOX, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) #define DEBUGPRUnichar(msg, strUtf16) \ diff --git a/src/vmware/vmware_conf.h b/src/vmware/vmware_conf.h index e47ce62..b6d9d60 100644 --- a/src/vmware/vmware_conf.h +++ b/src/vmware/vmware_conf.h @@ -31,7 +31,7 @@ # define PROGRAM_SENTINAL ((char *)0x1) # define vmwareError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_VMWARE, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_VMWARE, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) # define TYPE_PLAYER 0 diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index b0d3218..daeedc3 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -471,7 +471,7 @@ def->parallels[0]... #define VIR_FROM_THIS VIR_FROM_NONE #define VMX_ERROR(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_NONE, code, __FILE__, __FUNCTION__, \ + virReportErrorHelper(VIR_FROM_NONE, code, __FILE__, __FUNCTION__, \ __LINE__, __VA_ARGS__) #define VMX_BUILD_NAME_EXTRA(_suffix, _extra) \ diff --git a/src/xen/block_stats.c b/src/xen/block_stats.c index 1918257..a28212c 100644 --- a/src/xen/block_stats.c +++ b/src/xen/block_stats.c @@ -42,8 +42,7 @@ * Handle a stats error. */ static void -statsErrorFunc (virConnectPtr conn, - virErrorNumber error, const char *func, const char *info, +statsErrorFunc (virErrorNumber error, const char *func, const char *info, int value) { char fullinfo[1000]; @@ -55,7 +54,7 @@ statsErrorFunc (virConnectPtr conn, fullinfo[sizeof (fullinfo) - 1] = 0; info = fullinfo; } - virRaiseError(conn, NULL, NULL, VIR_FROM_STATS_LINUX, error, + virRaiseError(NULL, NULL, VIR_FROM_STATS_LINUX, error, VIR_ERR_ERROR, errmsg, info, NULL, value, 0, errmsg, info, value); @@ -180,8 +179,8 @@ check_bd_connected (xenUnifiedPrivatePtr priv, int device, int domid) } static int -read_bd_stats (virConnectPtr conn, xenUnifiedPrivatePtr priv, - int device, int domid, struct _virDomainBlockStats *stats) +read_bd_stats(xenUnifiedPrivatePtr priv, + int device, int domid, struct _virDomainBlockStats *stats) { stats->rd_req = read_bd_stat (device, domid, "rd_req"); stats->rd_bytes = read_bd_stat (device, domid, "rd_sect"); @@ -195,8 +194,8 @@ read_bd_stats (virConnectPtr conn, xenUnifiedPrivatePtr priv, if (stats->rd_req == -1 && stats->rd_bytes == -1 && stats->wr_req == -1 && stats->wr_bytes == -1 && stats->errs == -1) { - statsErrorFunc (conn, VIR_ERR_INTERNAL_ERROR, __FUNCTION__, - "Failed to read any block statistics", domid); + statsErrorFunc(VIR_ERR_INTERNAL_ERROR, __FUNCTION__, + "Failed to read any block statistics", domid); return -1; } @@ -208,8 +207,8 @@ read_bd_stats (virConnectPtr conn, xenUnifiedPrivatePtr priv, stats->wr_req == 0 && stats->wr_bytes == 0 && stats->errs == 0 && !check_bd_connected (priv, device, domid)) { - statsErrorFunc (conn, VIR_ERR_INTERNAL_ERROR, __FUNCTION__, - "Frontend block device not connected", domid); + statsErrorFunc(VIR_ERR_INTERNAL_ERROR, __FUNCTION__, + "Frontend block device not connected", domid); return -1; } @@ -218,18 +217,18 @@ read_bd_stats (virConnectPtr conn, xenUnifiedPrivatePtr priv, */ if (stats->rd_bytes > 0) { if (stats->rd_bytes >= ((unsigned long long)1)<<(63-9)) { - statsErrorFunc (conn, VIR_ERR_INTERNAL_ERROR, __FUNCTION__, - "stats->rd_bytes would overflow 64 bit counter", - domid); + statsErrorFunc(VIR_ERR_INTERNAL_ERROR, __FUNCTION__, + "stats->rd_bytes would overflow 64 bit counter", + domid); return -1; } stats->rd_bytes *= 512; } if (stats->wr_bytes > 0) { if (stats->wr_bytes >= ((unsigned long long)1)<<(63-9)) { - statsErrorFunc (conn, VIR_ERR_INTERNAL_ERROR, __FUNCTION__, - "stats->wr_bytes would overflow 64 bit counter", - domid); + statsErrorFunc(VIR_ERR_INTERNAL_ERROR, __FUNCTION__, + "stats->wr_bytes would overflow 64 bit counter", + domid); return -1; } stats->wr_bytes *= 512; @@ -270,7 +269,7 @@ disk_re_match(const char *regex, const char *path, int *part) } int -xenLinuxDomainDeviceID(virConnectPtr conn, int domid, const char *path) +xenLinuxDomainDeviceID(int domid, const char *path) { int major, minor; int part; @@ -347,20 +346,20 @@ xenLinuxDomainDeviceID(virConnectPtr conn, int domid, const char *path) * beginning of the strings for better error messages */ else if (strlen(mod_path) >= 7 && STRPREFIX(mod_path, "/dev/sd")) - statsErrorFunc (conn, VIR_ERR_INVALID_ARG, __FUNCTION__, - "invalid path, device names must be in the range sda[1-15] - sdiv[1-15]", - domid); + statsErrorFunc(VIR_ERR_INVALID_ARG, __FUNCTION__, + "invalid path, device names must be in the range sda[1-15] - sdiv[1-15]", + domid); else if (strlen(mod_path) >= 7 && STRPREFIX(mod_path, "/dev/hd")) - statsErrorFunc (conn, VIR_ERR_INVALID_ARG, __FUNCTION__, - "invalid path, device names must be in the range hda[1-63] - hdt[1-63]", - domid); + statsErrorFunc(VIR_ERR_INVALID_ARG, __FUNCTION__, + "invalid path, device names must be in the range hda[1-63] - hdt[1-63]", + domid); else if (strlen(mod_path) >= 8 && STRPREFIX(mod_path, "/dev/xvd")) - statsErrorFunc (conn, VIR_ERR_INVALID_ARG, __FUNCTION__, - "invalid path, device names must be in the range xvda[1-15] - xvdiz[1-15]", - domid); + statsErrorFunc(VIR_ERR_INVALID_ARG, __FUNCTION__, + "invalid path, device names must be in the range xvda[1-15] - xvdiz[1-15]", + domid); else - statsErrorFunc (conn, VIR_ERR_INVALID_ARG, __FUNCTION__, - "unsupported path, use xvdN, hdN, or sdN", domid); + statsErrorFunc(VIR_ERR_INVALID_ARG, __FUNCTION__, + "unsupported path, use xvdN, hdN, or sdN", domid); VIR_FREE(mod_path); @@ -373,12 +372,12 @@ xenLinuxDomainBlockStats (xenUnifiedPrivatePtr priv, const char *path, struct _virDomainBlockStats *stats) { - int device = xenLinuxDomainDeviceID(dom->conn, dom->id, path); + int device = xenLinuxDomainDeviceID(dom->id, path); if (device < 0) return -1; - return read_bd_stats (dom->conn, priv, device, dom->id, stats); + return read_bd_stats(priv, device, dom->id, stats); } #endif /* __linux__ */ diff --git a/src/xen/block_stats.h b/src/xen/block_stats.h index ba113d7..c94f645 100644 --- a/src/xen/block_stats.h +++ b/src/xen/block_stats.h @@ -19,7 +19,7 @@ extern int xenLinuxDomainBlockStats (xenUnifiedPrivatePtr priv, virDomainPtr dom, const char *path, struct _virDomainBlockStats *stats); -extern int xenLinuxDomainDeviceID(virConnectPtr conn, int domid, const char *dev); +extern int xenLinuxDomainDeviceID(int domid, const char *dev); # endif /* __linux__ */ diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index 9f47722..2a07b7b 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -79,7 +79,7 @@ static int inside_daemon; #endif #define xenUnifiedError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_XEN, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_XEN, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) /** diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c index 8a9dae5..9a5b41d 100644 --- a/src/xen/xen_hypervisor.c +++ b/src/xen/xen_hypervisor.c @@ -843,7 +843,7 @@ struct xenUnifiedDriver xenHypervisorDriver = { #define virXenError(code, ...) \ if (in_init == 0) \ - virReportErrorHelper(NULL, VIR_FROM_XEN, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_XEN, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) /** @@ -870,11 +870,11 @@ virXenErrorFunc(virErrorNumber error, const char *func, const char *info, if (func != NULL) { snprintf(fullinfo, 999, "%s: %s", func, info); fullinfo[999] = 0; - virRaiseError(NULL, NULL, NULL, VIR_FROM_XEN, error, VIR_ERR_ERROR, + virRaiseError(NULL, NULL, VIR_FROM_XEN, error, VIR_ERR_ERROR, errmsg, fullinfo, NULL, value, 0, errmsg, fullinfo, value); } else { - virRaiseError(NULL, NULL, NULL, VIR_FROM_XEN, error, VIR_ERR_ERROR, + virRaiseError(NULL, NULL, VIR_FROM_XEN, error, VIR_ERR_ERROR, errmsg, info, NULL, value, 0, errmsg, info, value); } diff --git a/src/xen/xen_inotify.c b/src/xen/xen_inotify.c index 5a997e6..d809c45 100644 --- a/src/xen/xen_inotify.c +++ b/src/xen/xen_inotify.c @@ -46,7 +46,7 @@ #define VIR_FROM_THIS VIR_FROM_XEN_INOTIFY #define virXenInotifyError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_XEN_INOTIFY, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_XEN_INOTIFY, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) struct xenUnifiedDriver xenInotifyDriver = { diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c index 57422d3..b608a43 100644 --- a/src/xen/xend_internal.c +++ b/src/xen/xend_internal.c @@ -68,7 +68,7 @@ virDomainXMLDevID(virDomainPtr domain, int ref_len); #define virXendError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_XEND, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_XEND, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) #define virXendErrorInt(code, ival) \ diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c index 9225808..db47a02 100644 --- a/src/xen/xm_internal.c +++ b/src/xen/xm_internal.c @@ -121,7 +121,7 @@ struct xenUnifiedDriver xenXMDriver = { }; #define xenXMError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_XENXM, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_XENXM, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) #ifndef WITH_XEN_INOTIFY diff --git a/src/xen/xs_internal.c b/src/xen/xs_internal.c index d9aad1f..c318f6c 100644 --- a/src/xen/xs_internal.c +++ b/src/xen/xs_internal.c @@ -83,7 +83,7 @@ struct xenUnifiedDriver xenStoreDriver = { }; #define virXenStoreError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_XENSTORE, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_XENSTORE, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) /************************************************************************ diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c index 60b23c7..3fbdcc6 100644 --- a/src/xenapi/xenapi_driver.c +++ b/src/xenapi/xenapi_driver.c @@ -44,7 +44,7 @@ #define VIR_FROM_THIS VIR_FROM_XENAPI #define xenapiError(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_THIS, code, __FILE__, \ + virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) /* diff --git a/src/xenapi/xenapi_utils.c b/src/xenapi/xenapi_utils.c index f50610a..ae20bf7 100644 --- a/src/xenapi/xenapi_utils.c +++ b/src/xenapi/xenapi_utils.c @@ -386,11 +386,11 @@ xenapiSessionErrorHandle(virConnectPtr conn, virErrorNumber errNum, if (buf == NULL && priv != NULL && priv->session != NULL) { char *ret = returnErrorFromSession(priv->session); - virReportErrorHelper(conn, VIR_FROM_XENAPI, errNum, filename, func, lineno, _("%s"), ret); + virReportErrorHelper(VIR_FROM_XENAPI, errNum, filename, func, lineno, _("%s"), ret); xen_session_clear_error(priv->session); VIR_FREE(ret); } else { - virReportErrorHelper(conn, VIR_FROM_XENAPI, errNum, filename, func, lineno, _("%s"), buf); + virReportErrorHelper(VIR_FROM_XENAPI, errNum, filename, func, lineno, _("%s"), buf); } } diff --git a/src/xenxs/xenxs_private.h b/src/xenxs/xenxs_private.h index 9bf1223..60d27d2 100644 --- a/src/xenxs/xenxs_private.h +++ b/src/xenxs/xenxs_private.h @@ -57,7 +57,7 @@ # define VIR_FROM_THIS VIR_FROM_NONE # define XENXS_ERROR(code, ...) \ - virReportErrorHelper(NULL, VIR_FROM_NONE, code, __FILE__, __FUNCTION__, \ + virReportErrorHelper(VIR_FROM_NONE, code, __FILE__, __FUNCTION__, \ __LINE__, __VA_ARGS__) #endif /* __VIR_XENXS_PRIVATE_H__ */ -- 1.7.0.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list