From: "Daniel P. Berrange" <berrange(a)redhat.com>
Update the legacy Xen drivers to use virReportError instead of
the statsError, virXenInotifyError, virXenStoreError,
virXendError, xenUnifiedError, xenXMError custom macros
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
cfg.mk | 7 -
src/xen/block_stats.c | 54 +++---
src/xen/xen_driver.c | 114 ++++++------
src/xen/xen_hypervisor.c | 158 ++++++++--------
src/xen/xen_inotify.c | 48 +++--
src/xen/xend_internal.c | 462 +++++++++++++++++++++++-----------------------
src/xen/xm_internal.c | 134 +++++++-------
src/xen/xs_internal.c | 40 ++--
8 files changed, 489 insertions(+), 528 deletions(-)
diff --git a/cfg.mk b/cfg.mk
index 13e11d0..39d19b4 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -509,7 +509,6 @@ msg_gen_function =
msg_gen_function += VIR_ERROR
msg_gen_function += lxcError
msg_gen_function += regerror
-msg_gen_function += statsError
msg_gen_function += vah_error
msg_gen_function += vah_warning
msg_gen_function += virGenericReportError
@@ -527,13 +526,7 @@ msg_gen_function += virRaiseError
msg_gen_function += virReportError
msg_gen_function += virReportErrorHelper
msg_gen_function += virReportSystemError
-msg_gen_function += virXenError
-msg_gen_function += virXenInotifyError
-msg_gen_function += virXenStoreError
-msg_gen_function += virXendError
msg_gen_function += xenapiSessionErrorHandler
-msg_gen_function += xenUnifiedError
-msg_gen_function += xenXMError
# Uncomment the following and run "make syntax-check" to see diagnostics
# that are not yet marked for translation, but that need to be rewritten
diff --git a/src/xen/block_stats.c b/src/xen/block_stats.c
index 50ace86..3d77720 100644
--- a/src/xen/block_stats.c
+++ b/src/xen/block_stats.c
@@ -32,12 +32,6 @@
# define VIR_FROM_THIS VIR_FROM_STATS_LINUX
-
-# define statsError(code, ...) \
- virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, __FUNCTION__, \
- __LINE__, __VA_ARGS__)
-
-
/*-------------------- Xen: block stats --------------------*/
# include <linux/major.h>
@@ -172,9 +166,9 @@ read_bd_stats(xenUnifiedPrivatePtr priv,
if (stats->rd_req == -1 && stats->rd_bytes == -1 &&
stats->wr_req == -1 && stats->wr_bytes == -1 &&
stats->errs == -1) {
- statsError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to read any block statistics for domain %d"),
- domid);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to read any block statistics for domain %d"),
+ domid);
return -1;
}
@@ -186,9 +180,9 @@ read_bd_stats(xenUnifiedPrivatePtr priv,
stats->wr_req == 0 && stats->wr_bytes == 0 &&
stats->errs == 0 &&
!check_bd_connected (priv, device, domid)) {
- statsError(VIR_ERR_INTERNAL_ERROR,
- _("Frontend block device not connected for domain %d"),
- domid);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Frontend block device not connected for domain %d"),
+ domid);
return -1;
}
@@ -197,18 +191,18 @@ read_bd_stats(xenUnifiedPrivatePtr priv,
*/
if (stats->rd_bytes > 0) {
if (stats->rd_bytes >= ((unsigned long long)1)<<(63-9)) {
- statsError(VIR_ERR_INTERNAL_ERROR,
- _("stats->rd_bytes would overflow 64 bit counter for
domain %d"),
- domid);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("stats->rd_bytes would overflow 64 bit counter for
domain %d"),
+ domid);
return -1;
}
stats->rd_bytes *= 512;
}
if (stats->wr_bytes > 0) {
if (stats->wr_bytes >= ((unsigned long long)1)<<(63-9)) {
- statsError(VIR_ERR_INTERNAL_ERROR,
- _("stats->wr_bytes would overflow 64 bit counter for
domain %d"),
- domid);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("stats->wr_bytes would overflow 64 bit counter for
domain %d"),
+ domid);
return -1;
}
stats->wr_bytes *= 512;
@@ -326,21 +320,21 @@ xenLinuxDomainDeviceID(int domid, const char *path)
* beginning of the strings for better error messages
*/
else if (strlen(mod_path) >= 7 && STRPREFIX(mod_path,
"/dev/sd"))
- statsError(VIR_ERR_INVALID_ARG,
- _("invalid path, device names must be in the range "
- "sda[1-15] - sdiv[1-15] for domain %d"), domid);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("invalid path, device names must be in the range "
+ "sda[1-15] - sdiv[1-15] for domain %d"), domid);
else if (strlen(mod_path) >= 7 && STRPREFIX(mod_path,
"/dev/hd"))
- statsError(VIR_ERR_INVALID_ARG,
- _("invalid path, device names must be in the range "
- "hda[1-63] - hdt[1-63] for domain %d"), domid);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("invalid path, device names must be in the range "
+ "hda[1-63] - hdt[1-63] for domain %d"), domid);
else if (strlen(mod_path) >= 8 && STRPREFIX(mod_path,
"/dev/xvd"))
- statsError(VIR_ERR_INVALID_ARG,
- _("invalid path, device names must be in the range "
- "xvda[1-15] - xvdiz[1-15] for domain %d"), domid);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("invalid path, device names must be in the range "
+ "xvda[1-15] - xvdiz[1-15] for domain %d"), domid);
else
- statsError(VIR_ERR_INVALID_ARG,
- _("unsupported path, use xvdN, hdN, or sdN for domain %d"),
- domid);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("unsupported path, use xvdN, hdN, or sdN for domain
%d"),
+ domid);
VIR_FREE(mod_path);
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 5e7d87c..f01ce16 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -80,10 +80,6 @@ static struct xenUnifiedDriver const * const
drivers[XEN_UNIFIED_NR_DRIVERS] = {
static int inside_daemon;
#endif
-#define xenUnifiedError(code, ...) \
- virReportErrorHelper(VIR_FROM_XEN, code, __FILE__, \
- __FUNCTION__, __LINE__, __VA_ARGS__)
-
/**
* xenNumaInit:
* @conn: pointer to the hypervisor connection
@@ -284,9 +280,9 @@ xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, unsigned
int flags)
if (conn->uri->path &&
STRNEQ(conn->uri->path, "") &&
STRNEQ(conn->uri->path, "/")) {
- xenUnifiedError(VIR_ERR_INTERNAL_ERROR,
- _("unexpected Xen URI path '%s', try
xen:///"),
- conn->uri->path);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unexpected Xen URI path '%s', try
xen:///"),
+ conn->uri->path);
return VIR_DRV_OPEN_ERROR;
}
@@ -316,8 +312,8 @@ xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, unsigned
int flags)
return VIR_DRV_OPEN_ERROR;
}
if (virMutexInit(&priv->lock) < 0) {
- xenUnifiedError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("cannot initialize mutex"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("cannot initialize mutex"));
VIR_FREE(priv);
return VIR_DRV_OPEN_ERROR;
}
@@ -517,14 +513,14 @@ xenUnifiedGetMaxVcpus (virConnectPtr conn, const char *type)
GET_PRIVATE(conn);
if (type && STRCASENEQ (type, "Xen")) {
- xenUnifiedError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET])
return xenHypervisorGetMaxVcpus (conn, type);
else {
- xenUnifiedError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
return -1;
}
}
@@ -648,7 +644,7 @@ xenUnifiedDomainLookupByID (virConnectPtr conn, int id)
}
/* Not found. */
- xenUnifiedError(VIR_ERR_NO_DOMAIN, __FUNCTION__);
+ virReportError(VIR_ERR_NO_DOMAIN, __FUNCTION__);
return NULL;
}
@@ -686,7 +682,7 @@ xenUnifiedDomainLookupByUUID (virConnectPtr conn,
}
/* Not found. */
- xenUnifiedError(VIR_ERR_NO_DOMAIN, __FUNCTION__);
+ virReportError(VIR_ERR_NO_DOMAIN, __FUNCTION__);
return NULL;
}
@@ -724,7 +720,7 @@ xenUnifiedDomainLookupByName (virConnectPtr conn,
}
/* Not found. */
- xenUnifiedError(VIR_ERR_NO_DOMAIN, __FUNCTION__);
+ virReportError(VIR_ERR_NO_DOMAIN, __FUNCTION__);
return NULL;
}
@@ -1053,8 +1049,8 @@ xenUnifiedDomainSaveFlags(virDomainPtr dom, const char *to, const
char *dxml,
virCheckFlags(0, -1);
if (dxml) {
- xenUnifiedError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
- _("xml modification unsupported"));
+ virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
+ _("xml modification unsupported"));
return -1;
}
@@ -1077,8 +1073,8 @@ xenUnifiedDomainRestoreFlags(virConnectPtr conn, const char *from,
virCheckFlags(0, -1);
if (dxml) {
- xenUnifiedError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
- _("xml modification unsupported"));
+ virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
+ _("xml modification unsupported"));
return -1;
}
@@ -1119,13 +1115,13 @@ xenUnifiedDomainSetVcpusFlags (virDomainPtr dom, unsigned int
nvcpus,
if ((flags & (VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_CONFIG)) == 0 ||
(flags & (VIR_DOMAIN_VCPU_MAXIMUM | VIR_DOMAIN_VCPU_LIVE)) ==
(VIR_DOMAIN_VCPU_MAXIMUM | VIR_DOMAIN_VCPU_LIVE)) {
- xenUnifiedError(VIR_ERR_INVALID_ARG,
- _("invalid flag combination: (0x%x)"), flags);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("invalid flag combination: (0x%x)"), flags);
return -1;
}
if (!nvcpus || (unsigned short) nvcpus != nvcpus) {
- xenUnifiedError(VIR_ERR_INVALID_ARG,
- _("argument out of range: %d"), nvcpus);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("argument out of range: %d"), nvcpus);
return -1;
}
@@ -1145,7 +1141,7 @@ xenUnifiedDomainSetVcpusFlags (virDomainPtr dom, unsigned int
nvcpus,
if (flags == VIR_DOMAIN_VCPU_LIVE)
return xenHypervisorSetVcpus(dom, nvcpus);
- xenUnifiedError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
return -1;
}
@@ -1222,7 +1218,7 @@ xenUnifiedDomainGetVcpusFlags (virDomainPtr dom, unsigned int
flags)
if (flags == (VIR_DOMAIN_VCPU_CONFIG | VIR_DOMAIN_VCPU_MAXIMUM))
return xenHypervisorGetVcpuMax(dom);
- xenUnifiedError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
return -1;
}
@@ -1253,7 +1249,7 @@ xenUnifiedDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
}
}
- xenUnifiedError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
return NULL;
}
@@ -1276,8 +1272,8 @@ xenUnifiedDomainXMLFromNative(virConnectPtr conn,
if (STRNEQ(format, XEN_CONFIG_FORMAT_XM) &&
STRNEQ(format, XEN_CONFIG_FORMAT_SEXPR)) {
- xenUnifiedError(VIR_ERR_INVALID_ARG,
- _("unsupported config type %s"), format);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("unsupported config type %s"), format);
return NULL;
}
@@ -1325,8 +1321,8 @@ xenUnifiedDomainXMLToNative(virConnectPtr conn,
if (STRNEQ(format, XEN_CONFIG_FORMAT_XM) &&
STRNEQ(format, XEN_CONFIG_FORMAT_SEXPR)) {
- xenUnifiedError(VIR_ERR_INVALID_ARG,
- _("unsupported config type %s"), format);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("unsupported config type %s"), format);
goto cleanup;
}
@@ -1380,7 +1376,7 @@ xenUnifiedDomainMigratePrepare (virConnectPtr dconn,
uri_in, uri_out,
flags, dname, resource);
- xenUnifiedError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
return -1;
}
@@ -1401,7 +1397,7 @@ xenUnifiedDomainMigratePerform (virDomainPtr dom,
return xenDaemonDomainMigratePerform (dom, cookie, cookielen, uri,
flags, dname, resource);
- xenUnifiedError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
return -1;
}
@@ -1427,15 +1423,15 @@ xenUnifiedDomainMigrateFinish (virConnectPtr dconn,
if (flags & VIR_MIGRATE_PERSIST_DEST) {
domain_xml = xenDaemonDomainGetXMLDesc(dom, 0, NULL);
if (! domain_xml) {
- xenUnifiedError(VIR_ERR_MIGRATE_PERSIST_FAILED,
- "%s", _("failed to get XML representation of
migrated domain"));
+ virReportError(VIR_ERR_MIGRATE_PERSIST_FAILED,
+ "%s", _("failed to get XML representation of
migrated domain"));
goto failure;
}
dom_new = xenDaemonDomainDefineXML (dconn, domain_xml);
if (! dom_new) {
- xenUnifiedError(VIR_ERR_MIGRATE_PERSIST_FAILED,
- "%s", _("failed to define domain on
destination host"));
+ virReportError(VIR_ERR_MIGRATE_PERSIST_FAILED,
+ "%s", _("failed to define domain on destination
host"));
goto failure;
}
@@ -1649,7 +1645,7 @@ xenUnifiedDomainGetAutostart (virDomainPtr dom, int *autostart)
return xenDaemonDomainGetAutostart(dom, autostart);
}
- xenUnifiedError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
return -1;
}
@@ -1666,7 +1662,7 @@ xenUnifiedDomainSetAutostart (virDomainPtr dom, int autostart)
return xenDaemonDomainSetAutostart(dom, autostart);
}
- xenUnifiedError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
return -1;
}
@@ -1758,7 +1754,7 @@ xenUnifiedDomainBlockStats (virDomainPtr dom, const char *path,
if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET])
return xenHypervisorDomainBlockStats (dom, path, stats);
- xenUnifiedError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
return -1;
}
@@ -1771,7 +1767,7 @@ xenUnifiedDomainInterfaceStats (virDomainPtr dom, const char *path,
if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET])
return xenHypervisorDomainInterfaceStats (dom, path, stats);
- xenUnifiedError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
return -1;
}
@@ -1796,7 +1792,7 @@ xenUnifiedDomainBlockPeek (virDomainPtr dom, const char *path,
return 0;
}
- xenUnifiedError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
return -1;
}
@@ -1810,7 +1806,7 @@ xenUnifiedNodeGetCellsFreeMemory (virConnectPtr conn, unsigned long
long *freeMe
return xenHypervisorNodeGetCellsFreeMemory (conn, freeMems,
startCell, maxCells);
- xenUnifiedError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
return -1;
}
@@ -1829,7 +1825,7 @@ xenUnifiedNodeGetFreeMemory (virConnectPtr conn)
return freeMem;
}
- xenUnifiedError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
return 0;
}
@@ -1846,7 +1842,7 @@ xenUnifiedDomainEventRegister(virConnectPtr conn,
xenUnifiedLock(priv);
if (priv->xsWatch == -1) {
- xenUnifiedError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
xenUnifiedUnlock(priv);
return -1;
}
@@ -1868,7 +1864,7 @@ xenUnifiedDomainEventDeregister(virConnectPtr conn,
xenUnifiedLock(priv);
if (priv->xsWatch == -1) {
- xenUnifiedError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
xenUnifiedUnlock(priv);
return -1;
}
@@ -1896,7 +1892,7 @@ xenUnifiedDomainEventRegisterAny(virConnectPtr conn,
xenUnifiedLock(priv);
if (priv->xsWatch == -1) {
- xenUnifiedError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
xenUnifiedUnlock(priv);
return -1;
}
@@ -1919,7 +1915,7 @@ xenUnifiedDomainEventDeregisterAny(virConnectPtr conn,
xenUnifiedLock(priv);
if (priv->xsWatch == -1) {
- xenUnifiedError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
xenUnifiedUnlock(priv);
return -1;
}
@@ -1967,8 +1963,8 @@ xenUnifiedNodeDeviceGetPciInfo (virNodeDevicePtr dev,
}
if (!cap) {
- xenUnifiedError(VIR_ERR_INVALID_ARG,
- _("device %s is not a PCI device"), dev->name);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("device %s is not a PCI device"), dev->name);
goto out;
}
@@ -2077,9 +2073,9 @@ xenUnifiedNodeDeviceReAttach (virNodeDevicePtr dev)
/* Check if device is assigned to an active guest */
if ((domid = xenUnifiedNodeDeviceAssignedDomainId(dev)) >= 0) {
- xenUnifiedError(VIR_ERR_INTERNAL_ERROR,
- _("Device %s has been assigned to guest %d"),
- dev->name, domid);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Device %s has been assigned to guest %d"),
+ dev->name, domid);
goto out;
}
@@ -2129,15 +2125,15 @@ xenUnifiedDomainOpenConsole(virDomainPtr dom,
virCheckFlags(0, -1);
if (dom->id == -1) {
- xenUnifiedError(VIR_ERR_OPERATION_INVALID,
- "%s", _("domain is not running"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("domain is not running"));
goto cleanup;
}
if (dev_name) {
/* XXX support device aliases in future */
- xenUnifiedError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Named device aliases are not supported"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Named device aliases are not supported"));
goto cleanup;
}
@@ -2151,14 +2147,14 @@ xenUnifiedDomainOpenConsole(virDomainPtr dom,
chr = def->serials[0];
if (!chr) {
- xenUnifiedError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot find default console device"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot find default console device"));
goto cleanup;
}
if (chr->source.type != VIR_DOMAIN_CHR_TYPE_PTY) {
- xenUnifiedError(VIR_ERR_INTERNAL_ERROR,
- _("character device %s is not using a PTY"),
dev_name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("character device %s is not using a PTY"), dev_name);
goto cleanup;
}
diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index e737564..986621a 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -885,10 +885,6 @@ struct xenUnifiedDriver xenHypervisorDriver = {
.xenDomainSetSchedulerParameters = xenHypervisorSetSchedulerParameters,
};
-#define virXenError(code, ...) \
- virReportErrorHelper(VIR_FROM_XEN, code, __FILE__, \
- __FUNCTION__, __LINE__, __VA_ARGS__)
-
/**
* xenHypervisorDoV0Op:
* @handle: the handle to the Xen hypervisor
@@ -1157,20 +1153,20 @@ xenHypervisorGetSchedulerType(virDomainPtr domain, int *nparams)
xenUnifiedPrivatePtr priv;
if (domain->conn == NULL) {
- virXenError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("domain or conn is NULL"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("domain or conn is NULL"));
return NULL;
}
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (priv->handle < 0) {
- virXenError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("priv->handle invalid"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("priv->handle invalid"));
return NULL;
}
if (domain->id < 0) {
- virXenError(VIR_ERR_OPERATION_INVALID,
- "%s", _("domain is not running"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("domain is not running"));
return NULL;
}
@@ -1180,8 +1176,8 @@ xenHypervisorGetSchedulerType(virDomainPtr domain, int *nparams)
* TODO: check on Xen 3.0.3
*/
if (hv_versions.dom_interface < 5) {
- virXenError(VIR_ERR_NO_XEN, "%s",
- _("unsupported in dom interface < 5"));
+ virReportError(VIR_ERR_NO_XEN, "%s",
+ _("unsupported in dom interface < 5"));
return NULL;
}
@@ -1238,20 +1234,20 @@ xenHypervisorGetSchedulerParameters(virDomainPtr domain,
xenUnifiedPrivatePtr priv;
if (domain->conn == NULL) {
- virXenError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("domain or conn is NULL"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("domain or conn is NULL"));
return -1;
}
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (priv->handle < 0) {
- virXenError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("priv->handle invalid"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("priv->handle invalid"));
return -1;
}
if (domain->id < 0) {
- virXenError(VIR_ERR_OPERATION_INVALID,
- "%s", _("domain is not running"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("domain is not running"));
return -1;
}
@@ -1261,8 +1257,8 @@ xenHypervisorGetSchedulerParameters(virDomainPtr domain,
* TODO: check on Xen 3.0.3
*/
if (hv_versions.dom_interface < 5) {
- virXenError(VIR_ERR_NO_XEN, "%s",
- _("unsupported in dom interface < 5"));
+ virReportError(VIR_ERR_NO_XEN, "%s",
+ _("unsupported in dom interface < 5"));
return -1;
}
@@ -1280,8 +1276,8 @@ xenHypervisorGetSchedulerParameters(virDomainPtr domain,
switch (op_sys.u.getschedulerid.sched_id){
case XEN_SCHEDULER_SEDF:
if (*nparams < XEN_SCHED_SEDF_NPARAM) {
- virXenError(VIR_ERR_INVALID_ARG,
- "%s", _("Invalid parameter count"));
+ virReportError(VIR_ERR_INVALID_ARG,
+ "%s", _("Invalid parameter
count"));
return -1;
}
@@ -1315,9 +1311,9 @@ xenHypervisorGetSchedulerParameters(virDomainPtr domain,
*nparams = XEN_SCHED_CRED_NPARAM;
break;
default:
- virXenError(VIR_ERR_INVALID_ARG,
- _("Unknown scheduler %d"),
- op_sys.u.getschedulerid.sched_id);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("Unknown scheduler %d"),
+ op_sys.u.getschedulerid.sched_id);
return -1;
}
}
@@ -1344,8 +1340,8 @@ xenHypervisorSetSchedulerParameters(virDomainPtr domain,
char buf[256];
if (domain->conn == NULL) {
- virXenError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("domain or conn is NULL"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("domain or conn is NULL"));
return -1;
}
@@ -1364,13 +1360,13 @@ xenHypervisorSetSchedulerParameters(virDomainPtr domain,
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (priv->handle < 0) {
- virXenError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("priv->handle invalid"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("priv->handle invalid"));
return -1;
}
if (domain->id < 0) {
- virXenError(VIR_ERR_OPERATION_INVALID,
- "%s", _("domain is not running"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("domain is not running"));
return -1;
}
@@ -1380,8 +1376,8 @@ xenHypervisorSetSchedulerParameters(virDomainPtr domain,
* TODO: check on Xen 3.0.3
*/
if (hv_versions.dom_interface < 5) {
- virXenError(VIR_ERR_NO_XEN, "%s",
- _("unsupported in dom interface < 5"));
+ virReportError(VIR_ERR_NO_XEN, "%s",
+ _("unsupported in dom interface < 5"));
return -1;
}
@@ -1419,18 +1415,18 @@ xenHypervisorSetSchedulerParameters(virDomainPtr domain,
if (STREQ(params[i].field, VIR_DOMAIN_SCHEDULER_WEIGHT)) {
val = params[i].value.ui;
if ((val < 1) || (val > USHRT_MAX)) {
- virXenError(VIR_ERR_INVALID_ARG,
- _("Credit scheduler weight parameter (%d)
"
- "is out of range (1-65535)"), val);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("Credit scheduler weight parameter (%d)
"
+ "is out of range (1-65535)"), val);
return -1;
}
op_dom.u.getschedinfo.u.credit.weight = val;
} else if (STREQ(params[i].field, VIR_DOMAIN_SCHEDULER_CAP)) {
val = params[i].value.ui;
if (val >= USHRT_MAX) {
- virXenError(VIR_ERR_INVALID_ARG,
- _("Credit scheduler cap parameter (%d) is
"
- "out of range (0-65534)"), val);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("Credit scheduler cap parameter (%d) is
"
+ "out of range (0-65534)"), val);
return -1;
}
op_dom.u.getschedinfo.u.credit.cap = val;
@@ -1443,9 +1439,9 @@ xenHypervisorSetSchedulerParameters(virDomainPtr domain,
break;
}
default:
- virXenError(VIR_ERR_INVALID_ARG,
- _("Unknown scheduler %d"),
- op_sys.u.getschedulerid.sched_id);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("Unknown scheduler %d"),
+ op_sys.u.getschedulerid.sched_id);
return -1;
}
}
@@ -1470,8 +1466,8 @@ xenHypervisorDomainBlockStats (virDomainPtr dom,
xenUnifiedUnlock(priv);
return ret;
#else
- virXenError(VIR_ERR_OPERATION_INVALID, "%s",
- _("block statistics not supported on this platform"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("block statistics not supported on this platform"));
return -1;
#endif
}
@@ -1495,20 +1491,20 @@ xenHypervisorDomainInterfaceStats (virDomainPtr dom,
* domain.
*/
if (sscanf(path, "vif%d.%d", &rqdomid, &device) != 2) {
- virXenError(VIR_ERR_INVALID_ARG, "%s",
- _("invalid path, should be vif<domid>.<n>."));
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("invalid path, should be
vif<domid>.<n>."));
return -1;
}
if (rqdomid != dom->id) {
- virXenError(VIR_ERR_INVALID_ARG, "%s",
- _("invalid path, vif<domid> should match this domain
ID"));
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("invalid path, vif<domid> should match this domain
ID"));
return -1;
}
return linuxDomainInterfaceStats(path, stats);
#else
- virXenError(VIR_ERR_OPERATION_INVALID, "%s",
- _("/proc/net/dev: Interface not found"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("/proc/net/dev: Interface not found"));
return -1;
#endif
}
@@ -1980,7 +1976,7 @@ xenHypervisorInit(struct xenHypervisorVersions *override_versions)
char error[100];
regerror (errcode, &flags_hvm_rec, error, sizeof(error));
regfree (&flags_hvm_rec);
- virXenError(VIR_ERR_INTERNAL_ERROR, "%s", error);
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", error);
return -1;
}
errcode = regcomp (&flags_pae_rec, flags_pae_re, REG_EXTENDED);
@@ -1989,7 +1985,7 @@ xenHypervisorInit(struct xenHypervisorVersions *override_versions)
regerror (errcode, &flags_pae_rec, error, sizeof(error));
regfree (&flags_pae_rec);
regfree (&flags_hvm_rec);
- virXenError(VIR_ERR_INTERNAL_ERROR, "%s", error);
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", error);
return -1;
}
errcode = regcomp (&xen_cap_rec, xen_cap_re, REG_EXTENDED);
@@ -1999,7 +1995,7 @@ xenHypervisorInit(struct xenHypervisorVersions *override_versions)
regfree (&xen_cap_rec);
regfree (&flags_pae_rec);
regfree (&flags_hvm_rec);
- virXenError(VIR_ERR_INTERNAL_ERROR, "%s", error);
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", error);
return -1;
}
@@ -2209,7 +2205,7 @@ xenHypervisorOpen(virConnectPtr conn,
ret = open(XEN_HYPERVISOR_SOCKET, O_RDWR);
if (ret < 0) {
- virXenError(VIR_ERR_NO_XEN, "%s", XEN_HYPERVISOR_SOCKET);
+ virReportError(VIR_ERR_NO_XEN, "%s", XEN_HYPERVISOR_SOCKET);
return -1;
}
@@ -2908,30 +2904,30 @@ xenHypervisorDomainGetOSType (virDomainPtr dom)
priv = (xenUnifiedPrivatePtr) dom->conn->privateData;
if (priv->handle < 0) {
- virXenError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("domain shut off or invalid"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("domain shut off or invalid"));
return NULL;
}
/* HV's earlier than 3.1.0 don't include the HVM flags in guests status*/
if (hv_versions.hypervisor < 2 ||
hv_versions.dom_interface < 4) {
- virXenError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("unsupported in dom interface < 4"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("unsupported in dom interface < 4"));
return NULL;
}
XEN_GETDOMAININFO_CLEAR(dominfo);
if (virXen_getdomaininfo(priv->handle, dom->id, &dominfo) < 0) {
- virXenError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot get domain details"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot get domain details"));
return NULL;
}
if (XEN_GETDOMAININFO_DOMAIN(dominfo) != dom->id) {
- virXenError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot get domain details"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot get domain details"));
return NULL;
}
@@ -3330,21 +3326,21 @@ xenHypervisorNodeGetCellsFreeMemory(virConnectPtr conn, unsigned
long long *free
xenUnifiedPrivatePtr priv;
if (conn == NULL) {
- virXenError(VIR_ERR_INVALID_ARG, "%s", _("invalid
argument"));
+ virReportError(VIR_ERR_INVALID_ARG, "%s", _("invalid
argument"));
return -1;
}
priv = conn->privateData;
if (priv->nbNodeCells < 0) {
- virXenError(VIR_ERR_XEN_CALL, "%s",
- _("cannot determine actual number of cells"));
+ virReportError(VIR_ERR_XEN_CALL, "%s",
+ _("cannot determine actual number of cells"));
return -1;
}
if ((maxCells < 1) || (startCell >= priv->nbNodeCells)) {
- virXenError(VIR_ERR_INVALID_ARG, "%s",
- _("invalid argument"));
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("invalid argument"));
return -1;
}
@@ -3352,14 +3348,14 @@ xenHypervisorNodeGetCellsFreeMemory(virConnectPtr conn, unsigned
long long *free
* Support only hv_versions.sys_interface >=4
*/
if (hv_versions.sys_interface < SYS_IFACE_MIN_VERS_NUMA) {
- virXenError(VIR_ERR_XEN_CALL, "%s",
- _("unsupported in sys interface < 4"));
+ virReportError(VIR_ERR_XEN_CALL, "%s",
+ _("unsupported in sys interface < 4"));
return -1;
}
if (priv->handle < 0) {
- virXenError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("priv->handle invalid"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("priv->handle invalid"));
return -1;
}
@@ -3600,13 +3596,13 @@ xenHypervisorGetVcpus(virDomainPtr domain, virVcpuInfoPtr info,
int maxinfo,
if (priv->handle < 0 || (domain->id < 0) ||
(info == NULL) || (maxinfo < 1) ||
(sizeof(cpumap_t) & 7)) {
- virXenError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("domain shut off or invalid"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("domain shut off or invalid"));
return -1;
}
if ((cpumaps != NULL) && (maplen < 1)) {
- virXenError(VIR_ERR_INVALID_ARG, "%s",
- _("invalid argument"));
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("invalid argument"));
return -1;
}
/* first get the number of virtual CPUs in this domain */
@@ -3615,8 +3611,8 @@ xenHypervisorGetVcpus(virDomainPtr domain, virVcpuInfoPtr info, int
maxinfo,
&dominfo);
if ((ret < 0) || (XEN_GETDOMAININFO_DOMAIN(dominfo) != domain->id)) {
- virXenError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot get domain details"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot get domain details"));
return -1;
}
nbinfo = XEN_GETDOMAININFO_CPUCOUNT(dominfo) + 1;
@@ -3632,16 +3628,16 @@ xenHypervisorGetVcpus(virDomainPtr domain, virVcpuInfoPtr info,
int maxinfo,
(unsigned char *)VIR_GET_CPUMAP(cpumaps, maplen,
i),
maplen);
if (ret < 0) {
- virXenError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot get VCPUs info"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot get VCPUs info"));
return -1;
}
} else {
ret = virXen_getvcpusinfo(priv->handle, domain->id, i,
ipt, NULL, 0);
if (ret < 0) {
- virXenError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot get VCPUs info"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot get VCPUs info"));
return -1;
}
}
diff --git a/src/xen/xen_inotify.c b/src/xen/xen_inotify.c
index f7495b5..7185366 100644
--- a/src/xen/xen_inotify.c
+++ b/src/xen/xen_inotify.c
@@ -44,10 +44,6 @@
#define VIR_FROM_THIS VIR_FROM_XEN_INOTIFY
-#define virXenInotifyError(code, ...) \
- virReportErrorHelper(VIR_FROM_XEN_INOTIFY, code, __FILE__, \
- __FUNCTION__, __LINE__, __VA_ARGS__)
-
struct xenUnifiedDriver xenInotifyDriver = {
.xenClose = xenInotifyClose,
};
@@ -91,8 +87,8 @@ xenInotifyXendDomainsDirLookup(virConnectPtr conn, const char
*filename,
uuid_str = filename + strlen(XEND_DOMAINS_DIR) + 1;
if (virUUIDParse(uuid_str, rawuuid) < 0) {
- virXenInotifyError(VIR_ERR_INTERNAL_ERROR,
- _("parsing uuid %s"), uuid_str);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("parsing uuid %s"), uuid_str);
return -1;
}
/* call directly into xend here, as driver may not yet
@@ -116,8 +112,8 @@ xenInotifyXendDomainsDirLookup(virConnectPtr conn, const char
*filename,
return 0;
}
}
- virXenInotifyError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("finding dom on config list"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("finding dom on config list"));
return -1;
}
@@ -168,8 +164,8 @@ xenInotifyXendDomainsDirRemoveEntry(virConnectPtr conn,
int i;
if (virUUIDParse(uuidstr, uuid) < 0) {
- virXenInotifyError(VIR_ERR_INTERNAL_ERROR,
- _("parsing uuid %s"), uuidstr);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("parsing uuid %s"), uuidstr);
return -1;
}
@@ -204,15 +200,15 @@ xenInotifyXendDomainsDirAddEntry(virConnectPtr conn,
xenUnifiedPrivatePtr priv = conn->privateData;
if (xenInotifyDomainLookup(conn, fname, &name, uuid) < 0) {
- virXenInotifyError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Error looking up domain"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Error looking up domain"));
return -1;
}
if (xenUnifiedAddDomainInfo(priv->configInfoList,
-1, name, uuid) < 0) {
- virXenInotifyError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Error adding file to config
cache"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Error adding file to config
cache"));
VIR_FREE(name);
return -1;
}
@@ -257,8 +253,8 @@ xenInotifyEvent(int watch ATTRIBUTE_UNUSED,
if( conn && conn->privateData ) {
priv = conn->privateData;
} else {
- virXenInotifyError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("conn, or private data is
NULL"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("conn, or private data is NULL"));
return;
}
@@ -300,19 +296,19 @@ reread:
if (event)
xenUnifiedDomainEventDispatch(conn->privateData, event);
else
- virXenInotifyError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("looking up dom"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("looking up dom"));
if (xenInotifyRemoveDomainConfigInfo(conn, fname) < 0 ) {
- virXenInotifyError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Error adding file to config
cache"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Error adding file to config
cache"));
goto cleanup;
}
} else if (e->mask & ( IN_CREATE | IN_CLOSE_WRITE | IN_MOVED_TO) ) {
virDomainEventPtr event;
if (xenInotifyAddDomainConfigInfo(conn, fname) < 0 ) {
- virXenInotifyError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Error adding file to config
cache"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Error adding file to config
cache"));
goto cleanup;
}
@@ -323,8 +319,8 @@ reread:
if (event)
xenUnifiedDomainEventDispatch(conn->privateData, event);
else
- virXenInotifyError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("looking up dom"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("looking up dom"));
}
@@ -386,8 +382,8 @@ xenInotifyOpen(virConnectPtr conn,
}
if (xenInotifyAddDomainConfigInfo(conn, path) < 0 ) {
- virXenInotifyError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Error adding file to config
list"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Error adding file to config
list"));
closedir(dh);
VIR_FREE(path);
return -1;
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index f965129..9c27933 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -65,13 +65,6 @@ virDomainXMLDevID(virDomainPtr domain,
char *ref,
int ref_len);
-#define virXendError(code, ...) \
- virReportErrorHelper(VIR_FROM_XEND, code, __FILE__, \
- __FUNCTION__, __LINE__, __VA_ARGS__)
-
-#define virXendErrorInt(code, ival) \
- virXendError(code, "%d", ival)
-
/**
* do_connect:
* @xend: pointer to the Xen Daemon structure
@@ -89,8 +82,8 @@ do_connect(virConnectPtr xend)
s = socket(priv->addrfamily, SOCK_STREAM, priv->addrprotocol);
if (s == -1) {
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("failed to create a socket"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("failed to create a socket"));
return -1;
}
@@ -109,8 +102,8 @@ do_connect(virConnectPtr xend)
* error
*/
if (xenHavePrivilege()) {
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("failed to connect to xend"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("failed to connect to xend"));
}
}
@@ -156,11 +149,11 @@ wr_sync(int fd, void *buffer, size_t size, int do_read)
/* unrecoverable error */
if (len == -1) {
if (do_read)
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("failed to read from Xen
Daemon"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("failed to read from Xen
Daemon"));
else
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("failed to write to Xen
Daemon"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("failed to write to Xen
Daemon"));
return -1;
}
@@ -303,11 +296,11 @@ xend_req(int fd, char **content)
ssize_t ret;
if (content_length > XEND_RCV_BUF_MAX_LEN) {
- virXendError(VIR_ERR_INTERNAL_ERROR,
- _("Xend returned HTTP Content-Length of %d, "
- "which exceeds maximum of %d"),
- content_length,
- XEND_RCV_BUF_MAX_LEN);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Xend returned HTTP Content-Length of %d, "
+ "which exceeds maximum of %d"),
+ content_length,
+ XEND_RCV_BUF_MAX_LEN);
return -1;
}
@@ -363,9 +356,9 @@ xend_get(virConnectPtr xend, const char *path,
return ret;
if ((ret >= 300) && ((ret != 404) || (!STRPREFIX(path,
"/xend/domain/")))) {
- virXendError(VIR_ERR_GET_FAILED,
- _("%d status from xen daemon: %s:%s"),
- ret, path, NULLSTR(*content));
+ virReportError(VIR_ERR_GET_FAILED,
+ _("%d status from xen daemon: %s:%s"),
+ ret, path, NULLSTR(*content));
}
return ret;
@@ -411,11 +404,11 @@ xend_post(virConnectPtr xend, const char *path, const char *ops)
VIR_FORCE_CLOSE(s);
if ((ret < 0) || (ret >= 300)) {
- virXendError(VIR_ERR_POST_FAILED,
- _("xend_post: error from xen daemon: %s"), err_buf);
+ virReportError(VIR_ERR_POST_FAILED,
+ _("xend_post: error from xen daemon: %s"), err_buf);
} else if ((ret == 202) && err_buf && (strstr(err_buf,
"failed") != NULL)) {
- virXendError(VIR_ERR_POST_FAILED,
- _("xend_post: error from xen daemon: %s"), err_buf);
+ virReportError(VIR_ERR_POST_FAILED,
+ _("xend_post: error from xen daemon: %s"), err_buf);
ret = -1;
} else if (((ret >= 200) && (ret <= 202)) && err_buf
&&
(strstr(err_buf, "xend.err") != NULL)) {
@@ -423,8 +416,8 @@ xend_post(virConnectPtr xend, const char *path, const char *ops)
* which returns a success code, but the word 'xend.err'
* in body to indicate error :-(
*/
- virXendError(VIR_ERR_POST_FAILED,
- _("xend_post: error from xen daemon: %s"), err_buf);
+ virReportError(VIR_ERR_POST_FAILED,
+ _("xend_post: error from xen daemon: %s"), err_buf);
ret = -1;
}
@@ -458,7 +451,8 @@ http2unix(int ret)
errno = EIO;
break;
default:
- virXendErrorInt(VIR_ERR_HTTP_ERROR, ret);
+ virReportError(VIR_ERR_HTTP_ERROR,
+ _("Unexpected HTTP error code %d"), ret);
errno = EINVAL;
break;
}
@@ -677,9 +671,9 @@ xenDaemonOpen_tcp(virConnectPtr conn, const char *host, const char
*port)
ret = getaddrinfo (host, port, &hints, &res);
if (ret != 0) {
- virXendError(VIR_ERR_UNKNOWN_HOST,
- _("unable to resolve hostname '%s': %s"),
- host, gai_strerror (ret));
+ virReportError(VIR_ERR_UNKNOWN_HOST,
+ _("unable to resolve hostname '%s': %s"),
+ host, gai_strerror (ret));
return -1;
}
@@ -851,19 +845,19 @@ xenDaemonDomainLookupByName_ids(virConnectPtr xend, const char
*domname,
value = sexpr_node(root, "domain/domid");
if (value == NULL) {
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("domain information incomplete, missing
domid"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("domain information incomplete, missing
domid"));
goto error;
}
ret = strtol(value, NULL, 0);
if ((ret == 0) && (value[0] != '0')) {
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("domain information incorrect domid not
numeric"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("domain information incorrect domid not
numeric"));
ret = -1;
} else if (uuid != NULL) {
if (sexpr_uuid(uuid, root, "domain/uuid") < 0) {
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("domain information incomplete, missing
uuid"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("domain information incomplete, missing
uuid"));
}
}
@@ -901,8 +895,8 @@ xenDaemonDomainLookupByID(virConnectPtr xend,
name = sexpr_node(root, "domain/name");
if (name == NULL) {
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("domain information incomplete, missing
name"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("domain information incomplete, missing
name"));
goto error;
}
if (domname) {
@@ -914,8 +908,8 @@ xenDaemonDomainLookupByID(virConnectPtr xend,
}
if (sexpr_uuid(uuid, root, "domain/uuid") < 0) {
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("domain information incomplete, missing
uuid"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("domain information incomplete, missing
uuid"));
goto error;
}
@@ -937,7 +931,7 @@ xend_detect_config_version(virConnectPtr conn) {
xenUnifiedPrivatePtr priv;
if (!VIR_IS_CONNECT(conn)) {
- virXendError(VIR_ERR_INVALID_CONN, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_CONN, __FUNCTION__);
return -1;
}
@@ -1178,7 +1172,7 @@ sexpr_to_xend_topology(const struct sexpr *root,
return 0;
parse_error:
- virXendError(VIR_ERR_XEN_CALL, "%s", _("topology syntax
error"));
+ virReportError(VIR_ERR_XEN_CALL, "%s", _("topology syntax
error"));
error:
VIR_FREE(cpuNums);
VIR_FREE(cpuset);
@@ -1240,8 +1234,8 @@ sexpr_to_domain(virConnectPtr conn, const struct sexpr *root)
return ret;
error:
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("failed to parse Xend domain
information"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("failed to parse Xend domain
information"));
if (ret != NULL)
virUnrefDomain(ret);
return NULL;
@@ -1285,7 +1279,7 @@ xenDaemonOpen(virConnectPtr conn,
if (conn->uri->scheme == NULL) {
/* It should be a file access */
if (conn->uri->path == NULL) {
- virXendError(VIR_ERR_NO_CONNECT, __FUNCTION__);
+ virReportError(VIR_ERR_NO_CONNECT, __FUNCTION__);
goto failed;
}
if (xenDaemonOpen_unix(conn, conn->uri->path) < 0 ||
@@ -1319,7 +1313,7 @@ xenDaemonOpen(virConnectPtr conn,
xend_detect_config_version(conn) == -1)
goto failed;
} else {
- virXendError(VIR_ERR_NO_CONNECT, __FUNCTION__);
+ virReportError(VIR_ERR_NO_CONNECT, __FUNCTION__);
goto failed;
}
@@ -1361,13 +1355,13 @@ int
xenDaemonDomainSuspend(virDomainPtr domain)
{
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
if (domain->id < 0) {
- virXendError(VIR_ERR_OPERATION_INVALID,
- _("Domain %s isn't running."), domain->name);
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("Domain %s isn't running."), domain->name);
return -1;
}
@@ -1387,13 +1381,13 @@ int
xenDaemonDomainResume(virDomainPtr domain)
{
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
if (domain->id < 0) {
- virXendError(VIR_ERR_OPERATION_INVALID,
- _("Domain %s isn't running."), domain->name);
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("Domain %s isn't running."), domain->name);
return -1;
}
@@ -1414,13 +1408,13 @@ int
xenDaemonDomainShutdown(virDomainPtr domain)
{
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
if (domain->id < 0) {
- virXendError(VIR_ERR_OPERATION_INVALID,
- _("Domain %s isn't running."), domain->name);
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("Domain %s isn't running."), domain->name);
return -1;
}
@@ -1444,13 +1438,13 @@ xenDaemonDomainReboot(virDomainPtr domain, unsigned int flags)
virCheckFlags(0, -1);
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
if (domain->id < 0) {
- virXendError(VIR_ERR_OPERATION_INVALID,
- _("Domain %s isn't running."), domain->name);
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("Domain %s isn't running."), domain->name);
return -1;
}
@@ -1481,13 +1475,13 @@ xenDaemonDomainDestroyFlags(virDomainPtr domain,
virCheckFlags(0, -1);
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
if (domain->id < 0) {
- virXendError(VIR_ERR_OPERATION_INVALID,
- _("Domain %s isn't running."), domain->name);
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("Domain %s isn't running."), domain->name);
return -1;
}
@@ -1511,7 +1505,7 @@ xenDaemonDomainGetOSType(virDomainPtr domain)
xenUnifiedPrivatePtr priv;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return NULL;
}
@@ -1557,13 +1551,13 @@ xenDaemonDomainSave(virDomainPtr domain, const char *filename)
{
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL) ||
(filename == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
if (domain->id < 0) {
- virXendError(VIR_ERR_OPERATION_INVALID,
- _("Domain %s isn't running."), domain->name);
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("Domain %s isn't running."), domain->name);
return -1;
}
@@ -1595,13 +1589,13 @@ xenDaemonDomainCoreDump(virDomainPtr domain, const char
*filename,
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL) ||
(filename == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
if (domain->id < 0) {
- virXendError(VIR_ERR_OPERATION_INVALID,
- _("Domain %s isn't running."), domain->name);
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("Domain %s isn't running."), domain->name);
return -1;
}
@@ -1628,7 +1622,7 @@ xenDaemonDomainRestore(virConnectPtr conn, const char *filename)
{
if ((conn == NULL) || (filename == NULL)) {
/* this should be caught at the interface but ... */
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
return xend_op(conn, "", "op", "restore",
"file", filename, NULL);
@@ -1651,7 +1645,7 @@ xenDaemonDomainGetMaxMemory(virDomainPtr domain)
xenUnifiedPrivatePtr priv;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return 0;
}
@@ -1690,7 +1684,7 @@ xenDaemonDomainSetMaxMemory(virDomainPtr domain, unsigned long
memory)
xenUnifiedPrivatePtr priv;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -1727,7 +1721,7 @@ xenDaemonDomainSetMemory(virDomainPtr domain, unsigned long memory)
xenUnifiedPrivatePtr priv;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -1808,7 +1802,7 @@ xenDaemonDomainGetXMLDesc(virDomainPtr domain, unsigned int flags,
/* Flags checked by virDomainDefFormat */
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return NULL;
}
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
@@ -1851,7 +1845,7 @@ xenDaemonDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL) ||
(info == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -1926,7 +1920,7 @@ xenDaemonLookupByName(virConnectPtr conn, const char *domname)
virDomainPtr ret = NULL;
if ((conn == NULL) || (domname == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return NULL;
}
@@ -1957,11 +1951,11 @@ xenDaemonNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info) {
struct sexpr *root;
if (!VIR_IS_CONNECT(conn)) {
- virXendError(VIR_ERR_INVALID_CONN, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_CONN, __FUNCTION__);
return -1;
}
if (info == NULL) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -1990,12 +1984,12 @@ xenDaemonNodeGetTopology(virConnectPtr conn,
struct sexpr *root;
if (!VIR_IS_CONNECT(conn)) {
- virXendError(VIR_ERR_INVALID_CONN, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_CONN, __FUNCTION__);
return -1;
}
if (caps == NULL) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -2028,11 +2022,11 @@ xenDaemonGetVersion(virConnectPtr conn, unsigned long *hvVer)
unsigned long version;
if (!VIR_IS_CONNECT(conn)) {
- virXendError(VIR_ERR_INVALID_CONN, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_CONN, __FUNCTION__);
return -1;
}
if (hvVer == NULL) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
root = sexpr_get(conn, "/xend/node/");
@@ -2185,7 +2179,7 @@ xenDaemonDomainSetVcpusFlags(virDomainPtr domain, unsigned int
vcpus,
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)
|| (vcpus < 1)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -2200,23 +2194,23 @@ xenDaemonDomainSetVcpusFlags(virDomainPtr domain, unsigned int
vcpus,
* running domains, or _CONFIG for inactive domains. */
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
if (flags & VIR_DOMAIN_VCPU_CONFIG) {
- virXendError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Xend version does not support modifying "
- "persistent config"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Xend version does not support modifying "
+ "persistent config"));
return -1;
}
} else if (domain->id < 0) {
if (flags & VIR_DOMAIN_VCPU_LIVE) {
- virXendError(VIR_ERR_OPERATION_INVALID, "%s",
- _("domain not running"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("domain not running"));
return -1;
}
} else {
if ((flags & (VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_CONFIG)) !=
(VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_CONFIG)) {
- virXendError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Xend only supports modifying both live and "
- "persistent config"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Xend only supports modifying both live and "
+ "persistent config"));
}
}
@@ -2224,14 +2218,14 @@ xenDaemonDomainSetVcpusFlags(virDomainPtr domain, unsigned int
vcpus,
* the maximum. */
flags |= VIR_DOMAIN_VCPU_MAXIMUM;
if ((max = xenDaemonDomainGetVcpusFlags(domain, flags)) < 0) {
- virXendError(VIR_ERR_OPERATION_INVALID, "%s",
- _("could not determine max vcpus for the domain"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("could not determine max vcpus for the domain"));
return -1;
}
if (vcpus > max) {
- virXendError(VIR_ERR_INVALID_ARG,
- _("requested vcpus is greater than max allowable"
- " vcpus for the domain: %d > %d"), vcpus, max);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("requested vcpus is greater than max allowable"
+ " vcpus for the domain: %d > %d"), vcpus, max);
return -1;
}
@@ -2267,7 +2261,7 @@ xenDaemonDomainPinVcpu(virDomainPtr domain, unsigned int vcpu,
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)
|| (cpumap == NULL) || (maplen < 1) || (maplen > (int)sizeof(cpumap_t))) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -2303,8 +2297,8 @@ xenDaemonDomainPinVcpu(virDomainPtr domain, unsigned int vcpu,
if (ret == 0) {
if (virDomainVcpuPinAdd(def, cpumap, maplen, vcpu) < 0) {
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("failed to add vcpupin xml
entry"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("failed to add vcpupin xml
entry"));
return -1;
}
}
@@ -2339,7 +2333,7 @@ xenDaemonDomainGetVcpusFlags(virDomainPtr domain, unsigned int
flags)
VIR_DOMAIN_VCPU_MAXIMUM, -1);
if (domain == NULL || domain->conn == NULL || domain->name == NULL) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -2351,8 +2345,8 @@ xenDaemonDomainGetVcpusFlags(virDomainPtr domain, unsigned int
flags)
if (domain->id < 0 && priv->xendConfigVersion <
XEND_CONFIG_VERSION_3_0_4)
return -2;
if (domain->id < 0 && (flags & VIR_DOMAIN_VCPU_LIVE)) {
- virXendError(VIR_ERR_OPERATION_INVALID, "%s",
- _("domain not active"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("domain not active"));
return -1;
}
@@ -2403,11 +2397,11 @@ xenDaemonDomainGetVcpus(virDomainPtr domain, virVcpuInfoPtr info,
int maxinfo,
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)
|| (info == NULL) || (maxinfo < 1)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
if (cpumaps != NULL && maplen < 1) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -2639,7 +2633,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr domain, const char *xml,
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1);
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -2648,14 +2642,14 @@ xenDaemonAttachDeviceFlags(virDomainPtr domain, const char *xml,
if (domain->id < 0) {
/* Cannot modify live config if domain is inactive */
if (flags & VIR_DOMAIN_DEVICE_MODIFY_LIVE) {
- virXendError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Cannot modify live config if domain is
inactive"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Cannot modify live config if domain is
inactive"));
return -1;
}
/* If xendConfigVersion < 3 only live config can be changed */
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
- virXendError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Xend version does not support modifying "
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Xend version does not support modifying "
"persistent config"));
return -1;
}
@@ -2664,9 +2658,9 @@ xenDaemonAttachDeviceFlags(virDomainPtr domain, const char *xml,
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4 &&
(flags != VIR_DOMAIN_DEVICE_MODIFY_CURRENT &&
flags != VIR_DOMAIN_DEVICE_MODIFY_LIVE)) {
- virXendError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Xend version does not support modifying "
- "persistent config"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Xend version does not support modifying "
+ "persistent config"));
return -1;
}
/* Xen only supports modifying both live and persistent config if
@@ -2675,9 +2669,9 @@ xenDaemonAttachDeviceFlags(virDomainPtr domain, const char *xml,
if (priv->xendConfigVersion >= XEND_CONFIG_VERSION_3_0_4 &&
(flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE |
VIR_DOMAIN_DEVICE_MODIFY_CONFIG))) {
- virXendError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Xend only supports modifying both live and "
- "persistent config"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Xend only supports modifying both live and "
+ "persistent config"));
return -1;
}
}
@@ -2743,15 +2737,15 @@ xenDaemonAttachDeviceFlags(virDomainPtr domain, const char *xml,
goto cleanup;
}
} else {
- virXendError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("unsupported device type"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("unsupported device type"));
goto cleanup;
}
break;
default:
- virXendError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("unsupported device type"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("unsupported device type"));
goto cleanup;
}
@@ -2763,8 +2757,8 @@ xenDaemonAttachDeviceFlags(virDomainPtr domain, const char *xml,
"config", sexpr, NULL);
} else {
if (dev->data.disk->device != VIR_DOMAIN_DISK_DEVICE_CDROM) {
- virXendError(VIR_ERR_OPERATION_INVALID,
- _("target '%s' already exists"), target);
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("target '%s' already exists"), target);
} else {
/* device exists, attempt to modify it */
ret = xend_op(domain->conn, domain->name, "op",
"device_configure",
@@ -2807,7 +2801,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr domain, const char *xml,
VIR_DOMAIN_DEVICE_MODIFY_CONFIG, -1);
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -2816,14 +2810,14 @@ xenDaemonUpdateDeviceFlags(virDomainPtr domain, const char *xml,
if (domain->id < 0) {
/* Cannot modify live config if domain is inactive */
if (flags & VIR_DOMAIN_DEVICE_MODIFY_LIVE) {
- virXendError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Cannot modify live config if domain is
inactive"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Cannot modify live config if domain is
inactive"));
return -1;
}
/* If xendConfigVersion < 3 only live config can be changed */
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
- virXendError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Xend version does not support modifying "
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Xend version does not support modifying "
"persistent config"));
return -1;
}
@@ -2832,9 +2826,9 @@ xenDaemonUpdateDeviceFlags(virDomainPtr domain, const char *xml,
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4 &&
(flags != VIR_DOMAIN_DEVICE_MODIFY_CURRENT &&
flags != VIR_DOMAIN_DEVICE_MODIFY_LIVE)) {
- virXendError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Xend version does not support modifying "
- "persistent config"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Xend version does not support modifying "
+ "persistent config"));
return -1;
}
/* Xen only supports modifying both live and persistent config if
@@ -2843,9 +2837,9 @@ xenDaemonUpdateDeviceFlags(virDomainPtr domain, const char *xml,
if (priv->xendConfigVersion >= XEND_CONFIG_VERSION_3_0_4 &&
(flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE |
VIR_DOMAIN_DEVICE_MODIFY_CONFIG))) {
- virXendError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Xend only supports modifying both live and "
- "persistent config"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Xend only supports modifying both live and "
+ "persistent config"));
return -1;
}
}
@@ -2871,16 +2865,16 @@ xenDaemonUpdateDeviceFlags(virDomainPtr domain, const char *xml,
break;
default:
- virXendError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("unsupported device type"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("unsupported device type"));
goto cleanup;
}
sexpr = virBufferContentAndReset(&buf);
if (virDomainXMLDevID(domain, dev, class, ref, sizeof(ref))) {
- virXendError(VIR_ERR_OPERATION_INVALID, "%s",
- _("requested device does not exist"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("requested device does not exist"));
goto cleanup;
} else {
/* device exists, attempt to modify it */
@@ -2920,7 +2914,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr domain, const char *xml,
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1);
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -2929,15 +2923,15 @@ xenDaemonDetachDeviceFlags(virDomainPtr domain, const char *xml,
if (domain->id < 0) {
/* Cannot modify live config if domain is inactive */
if (flags & VIR_DOMAIN_DEVICE_MODIFY_LIVE) {
- virXendError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Cannot modify live config if domain is
inactive"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Cannot modify live config if domain is
inactive"));
return -1;
}
/* If xendConfigVersion < 3 only live config can be changed */
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
- virXendError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Xend version does not support modifying "
- "persistent config"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Xend version does not support modifying "
+ "persistent config"));
return -1;
}
} else {
@@ -2945,9 +2939,9 @@ xenDaemonDetachDeviceFlags(virDomainPtr domain, const char *xml,
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4 &&
(flags != VIR_DOMAIN_DEVICE_MODIFY_CURRENT &&
flags != VIR_DOMAIN_DEVICE_MODIFY_LIVE)) {
- virXendError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Xend version does not support modifying "
- "persistent config"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Xend version does not support modifying "
+ "persistent config"));
return -1;
}
/* Xen only supports modifying both live and persistent config if
@@ -2956,9 +2950,9 @@ xenDaemonDetachDeviceFlags(virDomainPtr domain, const char *xml,
if (priv->xendConfigVersion >= XEND_CONFIG_VERSION_3_0_4 &&
(flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE |
VIR_DOMAIN_DEVICE_MODIFY_CONFIG))) {
- virXendError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Xend only supports modifying both live and "
- "persistent config"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Xend only supports modifying both live and "
+ "persistent config"));
return -1;
}
}
@@ -2982,8 +2976,8 @@ xenDaemonDetachDeviceFlags(virDomainPtr domain, const char *xml,
if (xenFormatSxprOnePCI(dev->data.hostdev, &buf, 1) < 0)
goto cleanup;
} else {
- virXendError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("unsupported device type"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("unsupported device type"));
goto cleanup;
}
xendev = virBufferContentAndReset(&buf);
@@ -3013,7 +3007,7 @@ xenDaemonDomainGetAutostart(virDomainPtr domain,
xenUnifiedPrivatePtr priv;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -3026,8 +3020,8 @@ xenDaemonDomainGetAutostart(virDomainPtr domain,
root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1",
domain->name);
if (root == NULL) {
- virXendError(VIR_ERR_XEN_CALL,
- "%s", _("xenDaemonGetAutostart failed to find this
domain"));
+ virReportError(VIR_ERR_XEN_CALL,
+ "%s", _("xenDaemonGetAutostart failed to find this
domain"));
return -1;
}
@@ -3053,7 +3047,7 @@ xenDaemonDomainSetAutostart(virDomainPtr domain,
xenUnifiedPrivatePtr priv;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- virXendError(VIR_ERR_INTERNAL_ERROR, __FUNCTION__);
+ virReportError(VIR_ERR_INTERNAL_ERROR, __FUNCTION__);
return -1;
}
@@ -3066,8 +3060,8 @@ xenDaemonDomainSetAutostart(virDomainPtr domain,
root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1",
domain->name);
if (root == NULL) {
- virXendError(VIR_ERR_XEN_CALL,
- "%s", _("xenDaemonSetAutostart failed to find this
domain"));
+ virReportError(VIR_ERR_XEN_CALL,
+ "%s", _("xenDaemonSetAutostart failed to find this
domain"));
return -1;
}
@@ -3076,8 +3070,8 @@ xenDaemonDomainSetAutostart(virDomainPtr domain,
const char *val = (autonode->u.s.car->kind == SEXPR_VALUE
? autonode->u.s.car->u.value : NULL);
if (!val || (!STREQ(val, "ignore") && !STREQ(val,
"start"))) {
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("unexpected value from
on_xend_start"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("unexpected value from
on_xend_start"));
goto error;
}
@@ -3091,8 +3085,8 @@ xenDaemonDomainSetAutostart(virDomainPtr domain,
}
if (sexpr2string(root, &buffer) < 0) {
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("sexpr2string failed"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("sexpr2string failed"));
goto error;
}
@@ -3104,13 +3098,13 @@ xenDaemonDomainSetAutostart(virDomainPtr domain,
content = virBufferContentAndReset(&buffer);
if (xend_op(domain->conn, "", "op", "new",
"config", content, NULL) != 0) {
- virXendError(VIR_ERR_XEN_CALL,
- "%s", _("Failed to redefine sexpr"));
+ virReportError(VIR_ERR_XEN_CALL,
+ "%s", _("Failed to redefine sexpr"));
goto error;
}
} else {
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("on_xend_start not present in sexpr"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("on_xend_start not present in
sexpr"));
goto error;
}
@@ -3172,9 +3166,9 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
/* Xen doesn't support renaming domains during migration. */
if (dname) {
- virXendError(VIR_ERR_OPERATION_INVALID,
- "%s", _("xenDaemonDomainMigrate: Xen does not
support"
- " renaming domains during migration"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("xenDaemonDomainMigrate: Xen does not
support"
+ " renaming domains during migration"));
return -1;
}
@@ -3182,9 +3176,9 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
* ignores it.
*/
if (bandwidth) {
- virXendError(VIR_ERR_OPERATION_INVALID,
- "%s", _("xenDaemonDomainMigrate: Xen does not
support"
- " bandwidth limits during migration"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("xenDaemonDomainMigrate: Xen does not
support"
+ " bandwidth limits during migration"));
return -1;
}
@@ -3210,16 +3204,16 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
* a nice error message.
*/
if (flags & VIR_MIGRATE_PAUSED) {
- virXendError(VIR_ERR_OPERATION_INVALID,
- "%s", _("xenDaemonDomainMigrate: xend cannot migrate
paused domains"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("xenDaemonDomainMigrate: xend cannot
migrate paused domains"));
return -1;
}
/* XXX we could easily do tunnelled & peer2peer migration too
if we want to. support these... */
if (flags != 0) {
- virXendError(VIR_ERR_OPERATION_INVALID,
- "%s", _("xenDaemonDomainMigrate: unsupported
flag"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("xenDaemonDomainMigrate: unsupported
flag"));
return -1;
}
@@ -3234,16 +3228,16 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
return -1;
if (uriptr->scheme && STRCASENEQ (uriptr->scheme,
"xenmigr")) {
- virXendError(VIR_ERR_INVALID_ARG,
- "%s", _("xenDaemonDomainMigrate: only
xenmigr://"
- " migrations are supported by Xen"));
+ virReportError(VIR_ERR_INVALID_ARG,
+ "%s", _("xenDaemonDomainMigrate: only
xenmigr://"
+ " migrations are supported by Xen"));
virURIFree (uriptr);
return -1;
}
if (!uriptr->server) {
- virXendError(VIR_ERR_INVALID_ARG,
- "%s", _("xenDaemonDomainMigrate: a hostname must
be"
- " specified in the URI"));
+ virReportError(VIR_ERR_INVALID_ARG,
+ "%s", _("xenDaemonDomainMigrate: a hostname
must be"
+ " specified in the URI"));
virURIFree (uriptr);
return -1;
}
@@ -3261,8 +3255,8 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
int port_nr, n;
if (virStrToLong_i(p+1, NULL, 10, &port_nr) < 0) {
- virXendError(VIR_ERR_INVALID_ARG,
- "%s", _("xenDaemonDomainMigrate: invalid port
number"));
+ virReportError(VIR_ERR_INVALID_ARG,
+ "%s", _("xenDaemonDomainMigrate: invalid port
number"));
return -1;
}
snprintf (port, sizeof(port), "%d", port_nr);
@@ -3327,22 +3321,22 @@ virDomainPtr xenDaemonDomainDefineXML(virConnectPtr conn, const
char *xmlDesc) {
if (!(def = virDomainDefParseString(priv->caps, xmlDesc,
1 << VIR_DOMAIN_VIRT_XEN,
VIR_DOMAIN_XML_INACTIVE))) {
- virXendError(VIR_ERR_XML_ERROR,
- "%s", _("failed to parse domain description"));
+ virReportError(VIR_ERR_XML_ERROR,
+ "%s", _("failed to parse domain
description"));
return NULL;
}
if (!(sexpr = xenFormatSxpr(conn, def, priv->xendConfigVersion))) {
- virXendError(VIR_ERR_XML_ERROR,
- "%s", _("failed to build sexpr"));
+ virReportError(VIR_ERR_XML_ERROR,
+ "%s", _("failed to build sexpr"));
goto error;
}
ret = xend_op(conn, "", "op", "new",
"config", sexpr, NULL);
VIR_FREE(sexpr);
if (ret != 0) {
- virXendError(VIR_ERR_XEN_CALL,
- _("Failed to create inactive domain %s"), def->name);
+ virReportError(VIR_ERR_XEN_CALL,
+ _("Failed to create inactive domain %s"),
def->name);
goto error;
}
@@ -3364,7 +3358,7 @@ int xenDaemonDomainCreate(virDomainPtr domain)
virDomainPtr tmp;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -3391,7 +3385,7 @@ int xenDaemonDomainUndefine(virDomainPtr domain)
xenUnifiedPrivatePtr priv;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -3510,15 +3504,15 @@ xenDaemonGetSchedulerType(virDomainPtr domain, int *nparams)
char *schedulertype = NULL;
if (domain->conn == NULL || domain->name == NULL) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return NULL;
}
/* Support only xendConfigVersion >=4 */
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_1_0) {
- virXendError(VIR_ERR_OPERATION_INVALID,
- "%s", _("unsupported in xendConfigVersion <
4"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("unsupported in xendConfigVersion <
4"));
return NULL;
}
@@ -3529,8 +3523,8 @@ xenDaemonGetSchedulerType(virDomainPtr domain, int *nparams)
/* get xen_scheduler from xend/node */
ret = sexpr_node(root, "node/xen_scheduler");
if (ret == NULL){
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("node information incomplete, missing
scheduler name"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("node information incomplete, missing
scheduler name"));
goto error;
}
if (STREQ (ret, "credit")) {
@@ -3550,7 +3544,7 @@ xenDaemonGetSchedulerType(virDomainPtr domain, int *nparams)
if (nparams)
*nparams = XEN_SCHED_SEDF_NPARAM;
} else {
- virXendError(VIR_ERR_INTERNAL_ERROR, "%s", _("Unknown
scheduler"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Unknown
scheduler"));
goto error;
}
@@ -3583,15 +3577,15 @@ xenDaemonGetSchedulerParameters(virDomainPtr domain,
int ret = -1;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
/* Support only xendConfigVersion >=4 */
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_1_0) {
- virXendError(VIR_ERR_OPERATION_INVALID,
- "%s", _("unsupported in xendConfigVersion <
4"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("unsupported in xendConfigVersion <
4"));
return -1;
}
@@ -3603,16 +3597,16 @@ xenDaemonGetSchedulerParameters(virDomainPtr domain,
/* get the scheduler type */
sched_type = xenDaemonGetSchedulerType(domain, &sched_nparam);
if (sched_type == NULL) {
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Failed to get a scheduler name"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Failed to get a scheduler name"));
goto error;
}
switch (sched_nparam){
case XEN_SCHED_SEDF_NPARAM:
if (*nparams < XEN_SCHED_SEDF_NPARAM) {
- virXendError(VIR_ERR_INVALID_ARG,
- "%s", _("Invalid parameter count"));
+ virReportError(VIR_ERR_INVALID_ARG,
+ "%s", _("Invalid parameter count"));
goto error;
}
@@ -3622,21 +3616,21 @@ xenDaemonGetSchedulerParameters(virDomainPtr domain,
case XEN_SCHED_CRED_NPARAM:
/* get cpu_weight/cpu_cap from xend/domain */
if (sexpr_node(root, "domain/cpu_weight") == NULL) {
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("domain information incomplete, missing
cpu_weight"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("domain information incomplete,
missing cpu_weight"));
goto error;
}
if (sexpr_node(root, "domain/cpu_cap") == NULL) {
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("domain information incomplete, missing
cpu_cap"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("domain information incomplete,
missing cpu_cap"));
goto error;
}
if (virStrcpyStatic(params[0].field,
VIR_DOMAIN_SCHEDULER_WEIGHT) == NULL) {
- virXendError(VIR_ERR_INTERNAL_ERROR,
- _("Weight %s too big for destination"),
- VIR_DOMAIN_SCHEDULER_WEIGHT);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Weight %s too big for destination"),
+ VIR_DOMAIN_SCHEDULER_WEIGHT);
goto error;
}
params[0].type = VIR_TYPED_PARAM_UINT;
@@ -3645,9 +3639,9 @@ xenDaemonGetSchedulerParameters(virDomainPtr domain,
if (*nparams > 1) {
if (virStrcpyStatic(params[1].field,
VIR_DOMAIN_SCHEDULER_CAP) == NULL) {
- virXendError(VIR_ERR_INTERNAL_ERROR,
- _("Cap %s too big for destination"),
- VIR_DOMAIN_SCHEDULER_CAP);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Cap %s too big for destination"),
+ VIR_DOMAIN_SCHEDULER_CAP);
goto error;
}
params[1].type = VIR_TYPED_PARAM_UINT;
@@ -3659,7 +3653,7 @@ xenDaemonGetSchedulerParameters(virDomainPtr domain,
ret = 0;
break;
default:
- virXendError(VIR_ERR_INTERNAL_ERROR, "%s", _("Unknown
scheduler"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Unknown
scheduler"));
goto error;
}
@@ -3691,15 +3685,15 @@ xenDaemonSetSchedulerParameters(virDomainPtr domain,
int ret = -1;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
/* Support only xendConfigVersion >=4 and active domains */
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_1_0) {
- virXendError(VIR_ERR_OPERATION_INVALID,
- "%s", _("unsupported in xendConfigVersion <
4"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("unsupported in xendConfigVersion <
4"));
return -1;
}
@@ -3711,8 +3705,8 @@ xenDaemonSetSchedulerParameters(virDomainPtr domain,
/* get the scheduler type */
sched_type = xenDaemonGetSchedulerType(domain, &sched_nparam);
if (sched_type == NULL) {
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Failed to get a scheduler name"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Failed to get a scheduler name"));
goto error;
}
@@ -3738,7 +3732,7 @@ xenDaemonSetSchedulerParameters(virDomainPtr domain,
params[i].type == VIR_TYPED_PARAM_UINT) {
snprintf(buf_cap, sizeof(buf_cap), "%u",
params[i].value.ui);
} else {
- virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
goto error;
}
}
@@ -3747,8 +3741,8 @@ xenDaemonSetSchedulerParameters(virDomainPtr domain,
if (strlen(buf_weight) == 0) {
weight = sexpr_node(root, "domain/cpu_weight");
if (weight == NULL) {
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("domain information incomplete,
missing cpu_weight"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("domain information incomplete,
missing cpu_weight"));
goto error;
}
snprintf(buf_weight, sizeof(buf_weight), "%s", weight);
@@ -3756,8 +3750,8 @@ xenDaemonSetSchedulerParameters(virDomainPtr domain,
if (strlen(buf_cap) == 0) {
cap = sexpr_node(root, "domain/cpu_cap");
if (cap == NULL) {
- virXendError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("domain information incomplete,
missing cpu_cap"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("domain information incomplete,
missing cpu_cap"));
goto error;
}
snprintf(buf_cap, sizeof(buf_cap), "%s", cap);
@@ -3769,7 +3763,7 @@ xenDaemonSetSchedulerParameters(virDomainPtr domain,
break;
}
default:
- virXendError(VIR_ERR_INTERNAL_ERROR, "%s", _("Unknown
scheduler"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Unknown
scheduler"));
goto error;
}
@@ -3817,13 +3811,13 @@ xenDaemonDomainBlockPeek (virDomainPtr domain, const char *path,
domain->name);
else {
/* This call always fails for dom0. */
- virXendError(VIR_ERR_OPERATION_INVALID,
- "%s", _("domainBlockPeek is not supported for
dom0"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("domainBlockPeek is not supported for
dom0"));
return -1;
}
if (!root) {
- virXendError(VIR_ERR_XEN_CALL, __FUNCTION__);
+ virReportError(VIR_ERR_XEN_CALL, __FUNCTION__);
return -1;
}
@@ -3838,8 +3832,8 @@ xenDaemonDomainBlockPeek (virDomainPtr domain, const char *path,
goto cleanup;
if (!(actual = virDomainDiskPathByName(def, path))) {
- virXendError(VIR_ERR_INVALID_ARG,
- _("%s: invalid path"), path);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("%s: invalid path"), path);
goto cleanup;
}
path = actual;
@@ -4000,8 +3994,8 @@ virDomainXMLDevID(virDomainPtr domain,
if (tmp == NULL)
return -1;
} else {
- virXendError(VIR_ERR_OPERATION_INVALID,
- "%s", _("hotplug of device type not
supported"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("hotplug of device type not
supported"));
return -1;
}
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index cde0abb..c073f25 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -96,10 +96,6 @@ struct xenUnifiedDriver xenXMDriver = {
.xenDomainDetachDeviceFlags = xenXMDomainDetachDeviceFlags,
};
-#define xenXMError(code, ...) \
- virReportErrorHelper(VIR_FROM_XENXM, code, __FILE__, \
- __FUNCTION__, __LINE__, __VA_ARGS__)
-
#ifndef WITH_XEN_INOTIFY
static int xenInotifyActive(virConnectPtr conn ATTRIBUTE_UNUSED)
{
@@ -281,8 +277,8 @@ xenXMConfigCacheAddFile(virConnectPtr conn, const char *filename)
virDomainDefFree(entry->def);
VIR_FREE(entry->filename);
VIR_FREE(entry);
- xenXMError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("xenXMConfigCacheRefresh:
virHashAddEntry"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("xenXMConfigCacheRefresh:
virHashAddEntry"));
return -1;
}
}
@@ -486,7 +482,7 @@ int xenXMDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) {
const char *filename;
xenXMConfCachePtr entry;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -532,7 +528,7 @@ char *xenXMDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
/* Flags checked by virDomainDefFormat */
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return NULL;
}
if (domain->id != -1)
@@ -565,7 +561,7 @@ int xenXMDomainSetMemory(virDomainPtr domain, unsigned long memory) {
int ret = -1;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
if (domain->conn->flags & VIR_CONNECT_RO)
@@ -610,7 +606,7 @@ int xenXMDomainSetMaxMemory(virDomainPtr domain, unsigned long memory)
{
int ret = -1;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
if (domain->conn->flags & VIR_CONNECT_RO)
@@ -653,7 +649,7 @@ unsigned long long xenXMDomainGetMaxMemory(virDomainPtr domain) {
unsigned long long ret = 0;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return 0;
}
if (domain->id != -1)
@@ -701,18 +697,18 @@ xenXMDomainSetVcpusFlags(virDomainPtr domain, unsigned int vcpus,
VIR_DOMAIN_VCPU_MAXIMUM, -1);
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
if (domain->conn->flags & VIR_CONNECT_RO) {
- xenXMError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+ virReportError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
return -1;
}
if (domain->id != -1)
return -2;
if (flags & VIR_DOMAIN_VCPU_LIVE) {
- xenXMError(VIR_ERR_OPERATION_INVALID, "%s",
- _("domain is not running"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("domain is not running"));
return -1;
}
@@ -727,8 +723,8 @@ xenXMDomainSetVcpusFlags(virDomainPtr domain, unsigned int vcpus,
/* Hypervisor maximum. */
if ((max = xenUnifiedGetMaxVcpus(domain->conn, NULL)) < 0) {
- xenXMError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not determine max vcpus for the domain"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("could not determine max vcpus for the domain"));
goto cleanup;
}
/* Can't specify a current larger than stored maximum; but
@@ -736,9 +732,9 @@ xenXMDomainSetVcpusFlags(virDomainPtr domain, unsigned int vcpus,
if (!(flags & VIR_DOMAIN_VCPU_MAXIMUM))
max = entry->def->maxvcpus;
if (vcpus > max) {
- xenXMError(VIR_ERR_INVALID_ARG,
- _("requested vcpus is greater than max allowable"
- " vcpus for the domain: %d > %d"), vcpus, max);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("requested vcpus is greater than max allowable"
+ " vcpus for the domain: %d > %d"), vcpus, max);
goto cleanup;
}
@@ -785,14 +781,14 @@ xenXMDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags)
VIR_DOMAIN_VCPU_MAXIMUM, -1);
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
if (domain->id != -1)
return -2;
if (flags & VIR_DOMAIN_VCPU_LIVE) {
- xenXMError(VIR_ERR_OPERATION_FAILED, "%s", _("domain not
active"));
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("domain not
active"));
return -1;
}
@@ -840,17 +836,17 @@ int xenXMDomainPinVcpu(virDomainPtr domain,
if (domain == NULL || domain->conn == NULL || domain->name == NULL
|| cpumap == NULL || maplen < 1 || maplen > (int)sizeof(cpumap_t)) {
- xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
if (domain->conn->flags & VIR_CONNECT_RO) {
- xenXMError(VIR_ERR_INVALID_ARG,
- "%s", _("read only connection"));
+ virReportError(VIR_ERR_INVALID_ARG,
+ "%s", _("read only connection"));
return -1;
}
if (domain->id != -1) {
- xenXMError(VIR_ERR_INVALID_ARG,
- "%s", _("not inactive domain"));
+ virReportError(VIR_ERR_INVALID_ARG,
+ "%s", _("not inactive domain"));
return -1;
}
@@ -858,12 +854,12 @@ int xenXMDomainPinVcpu(virDomainPtr domain,
xenUnifiedLock(priv);
if (!(filename = virHashLookup(priv->nameConfigMap, domain->name))) {
- xenXMError(VIR_ERR_INTERNAL_ERROR, "%s",
_("virHashLookup"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("virHashLookup"));
goto cleanup;
}
if (!(entry = virHashLookup(priv->configCache, filename))) {
- xenXMError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("can't retrieve config file for
domain"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("can't retrieve config file for
domain"));
goto cleanup;
}
@@ -923,11 +919,11 @@ virDomainPtr xenXMDomainLookupByName(virConnectPtr conn, const char
*domname) {
virDomainPtr ret = NULL;
if (!VIR_IS_CONNECT(conn)) {
- xenXMError(VIR_ERR_INVALID_CONN, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_CONN, __FUNCTION__);
return NULL;
}
if (domname == NULL) {
- xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return NULL;
}
@@ -979,11 +975,11 @@ virDomainPtr xenXMDomainLookupByUUID(virConnectPtr conn,
virDomainPtr ret = NULL;
if (!VIR_IS_CONNECT(conn)) {
- xenXMError(VIR_ERR_INVALID_CONN, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_CONN, __FUNCTION__);
return NULL;
}
if (uuid == NULL) {
- xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return NULL;
}
@@ -1078,11 +1074,11 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char
*xml)
xenUnifiedPrivatePtr priv = (xenUnifiedPrivatePtr) conn->privateData;
if (!VIR_IS_CONNECT(conn)) {
- xenXMError(VIR_ERR_INVALID_CONN, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_CONN, __FUNCTION__);
return NULL;
}
if (xml == NULL) {
- xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return NULL;
}
if (conn->flags & VIR_CONNECT_RO)
@@ -1116,9 +1112,9 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char
*xml)
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(entry->def->uuid, uuidstr);
- xenXMError(VIR_ERR_OPERATION_FAILED,
- _("domain '%s' is already defined with uuid
%s"),
- entry->def->name, uuidstr);
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("domain '%s' is already defined with uuid
%s"),
+ entry->def->name, uuidstr);
entry = NULL;
goto error;
}
@@ -1129,28 +1125,28 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char
*xml)
/* domain exists, we will overwrite it */
if (!(oldfilename = (char *)virHashLookup(priv->nameConfigMap, def->name)))
{
- xenXMError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("can't retrieve config filename for
domain to overwrite"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("can't retrieve config filename for
domain to overwrite"));
goto error;
}
if (!(entry = virHashLookup(priv->configCache, oldfilename))) {
- xenXMError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("can't retrieve config entry for domain
to overwrite"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("can't retrieve config entry for
domain to overwrite"));
goto error;
}
/* Remove the name -> filename mapping */
if (virHashRemoveEntry(priv->nameConfigMap, def->name) < 0) {
- xenXMError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("failed to remove old domain from config
map"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("failed to remove old domain from
config map"));
goto error;
}
/* Remove the config record itself */
if (virHashRemoveEntry(priv->configCache, oldfilename) < 0) {
- xenXMError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("failed to remove old domain from config
map"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("failed to remove old domain from
config map"));
goto error;
}
@@ -1169,8 +1165,8 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char
*xml)
}
if ((entry->refreshedAt = time(NULL)) == ((time_t)-1)) {
- xenXMError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("unable to get current time"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("unable to get current time"));
goto error;
}
@@ -1181,15 +1177,15 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char
*xml)
entry->def = def;
if (virHashAddEntry(priv->configCache, filename, entry) < 0) {
- xenXMError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("unable to store config file handle"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("unable to store config file
handle"));
goto error;
}
if (virHashAddEntry(priv->nameConfigMap, def->name, entry->filename) < 0)
{
virHashSteal(priv->configCache, filename);
- xenXMError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("unable to store config file handle"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("unable to store config file
handle"));
goto error;
}
@@ -1219,7 +1215,7 @@ int xenXMDomainUndefine(virDomainPtr domain) {
int ret = -1;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -1295,7 +1291,7 @@ int xenXMListDefinedDomains(virConnectPtr conn, char **const names,
int maxnames
int i, ret = -1;
if (!VIR_IS_CONNECT(conn)) {
- xenXMError(VIR_ERR_INVALID_CONN, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_CONN, __FUNCTION__);
return -1;
}
@@ -1340,7 +1336,7 @@ int xenXMNumOfDefinedDomains(virConnectPtr conn) {
int ret = -1;
if (!VIR_IS_CONNECT(conn)) {
- xenXMError(VIR_ERR_INVALID_CONN, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_CONN, __FUNCTION__);
return -1;
}
@@ -1385,7 +1381,7 @@ xenXMDomainAttachDeviceFlags(virDomainPtr domain, const char *xml,
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1);
if ((!domain) || (!domain->conn) || (!domain->name) || (!xml)) {
- xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -1394,8 +1390,8 @@ xenXMDomainAttachDeviceFlags(virDomainPtr domain, const char *xml,
if ((flags & VIR_DOMAIN_DEVICE_MODIFY_LIVE) ||
(domain->id != -1 && flags == VIR_DOMAIN_DEVICE_MODIFY_CURRENT)) {
- xenXMError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Xm driver only supports modifying persistent config"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Xm driver only supports modifying persistent
config"));
return -1;
}
@@ -1436,8 +1432,8 @@ xenXMDomainAttachDeviceFlags(virDomainPtr domain, const char *xml,
}
default:
- xenXMError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Xm driver only supports adding disk or network
devices"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Xm driver only supports adding disk or network
devices"));
goto cleanup;
}
@@ -1482,7 +1478,7 @@ xenXMDomainDetachDeviceFlags(virDomainPtr domain, const char *xml,
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1);
if ((!domain) || (!domain->conn) || (!domain->name) || (!xml)) {
- xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -1491,8 +1487,8 @@ xenXMDomainDetachDeviceFlags(virDomainPtr domain, const char *xml,
if ((flags & VIR_DOMAIN_DEVICE_MODIFY_LIVE) ||
(domain->id != -1 && flags == VIR_DOMAIN_DEVICE_MODIFY_CURRENT)) {
- xenXMError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Xm driver only supports modifying persistent config"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Xm driver only supports modifying persistent
config"));
return -1;
}
@@ -1547,9 +1543,9 @@ xenXMDomainDetachDeviceFlags(virDomainPtr domain, const char *xml,
break;
}
default:
- xenXMError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("device type '%s' cannot be detached"),
- virDomainDeviceTypeToString(dev->type));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("device type '%s' cannot be detached"),
+ virDomainDeviceTypeToString(dev->type));
goto cleanup;
}
@@ -1574,8 +1570,8 @@ xenXMDomainBlockPeek (virDomainPtr dom ATTRIBUTE_UNUSED,
size_t size ATTRIBUTE_UNUSED,
void *buffer ATTRIBUTE_UNUSED)
{
- xenXMError(VIR_ERR_OPERATION_INVALID, "%s",
- _("block peeking not implemented"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("block peeking not implemented"));
return -1;
}
diff --git a/src/xen/xs_internal.c b/src/xen/xs_internal.c
index d1bcb27..8f52e8f 100644
--- a/src/xen/xs_internal.c
+++ b/src/xen/xs_internal.c
@@ -51,10 +51,6 @@ struct xenUnifiedDriver xenStoreDriver = {
.xenDomainGetInfo = xenStoreGetDomainInfo,
};
-#define virXenStoreError(code, ...) \
- virReportErrorHelper(VIR_FROM_XENSTORE, code, __FILE__, \
- __FUNCTION__, __LINE__, __VA_ARGS__)
-
/************************************************************************
* *
* Helper internal APIs *
@@ -254,8 +250,8 @@ xenStoreOpen(virConnectPtr conn,
* remote) mechanism.
*/
if (xenHavePrivilege()) {
- virXenStoreError(VIR_ERR_NO_XEN,
- "%s", _("failed to connect to Xen
Store"));
+ virReportError(VIR_ERR_NO_XEN,
+ "%s", _("failed to connect to Xen
Store"));
}
return -1;
}
@@ -278,8 +274,8 @@ xenStoreOpen(virConnectPtr conn,
if ( xenStoreAddWatch(conn, "@releaseDomain",
"releaseDomain", xenStoreDomainReleased, priv) < 0 )
{
- virXenStoreError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("adding watch @releaseDomain"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("adding watch @releaseDomain"));
return -1;
}
@@ -287,8 +283,8 @@ xenStoreOpen(virConnectPtr conn,
if( xenStoreAddWatch(conn, "@introduceDomain",
"introduceDomain", xenStoreDomainIntroduced, priv) < 0
)
{
- virXenStoreError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("adding watch @introduceDomain"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("adding watch @introduceDomain"));
return -1;
}
@@ -317,7 +313,7 @@ xenStoreClose(virConnectPtr conn)
xenUnifiedPrivatePtr priv;
if (conn == NULL) {
- virXenStoreError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -371,7 +367,7 @@ xenStoreGetDomainInfo(virDomainPtr domain, virDomainInfoPtr info)
return -1;
if ((domain == NULL) || (domain->conn == NULL) || (info == NULL)) {
- virXenStoreError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -472,7 +468,7 @@ xenStoreDomainSetMemory(virDomainPtr domain, unsigned long memory)
if ((domain == NULL) || (domain->conn == NULL) ||
(memory < 1024 * MIN_XEN_GUEST_SIZE)) {
- virXenStoreError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
if (domain->id == -1)
@@ -536,13 +532,13 @@ xenStoreNumOfDomains(virConnectPtr conn)
xenUnifiedPrivatePtr priv;
if (conn == NULL) {
- virXenStoreError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
priv = (xenUnifiedPrivatePtr) conn->privateData;
if (priv->xshandle == NULL) {
- virXenStoreError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -624,7 +620,7 @@ xenStoreListDomains(virConnectPtr conn, int *ids, int maxids)
int ret;
if ((conn == NULL) || (ids == NULL)) {
- virXenStoreError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
@@ -659,7 +655,7 @@ xenStoreLookupByName(virConnectPtr conn, const char *name)
xenUnifiedPrivatePtr priv;
if ((conn == NULL) || (name == NULL)) {
- virXenStoreError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return NULL;
}
@@ -723,7 +719,7 @@ xenStoreDomainShutdown(virDomainPtr domain)
xenUnifiedPrivatePtr priv;
if ((domain == NULL) || (domain->conn == NULL)) {
- virXenStoreError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
if (domain->id == -1 || domain->id == 0)
@@ -759,7 +755,7 @@ xenStoreDomainReboot(virDomainPtr domain, unsigned int flags)
virCheckFlags(0, -1);
if ((domain == NULL) || (domain->conn == NULL)) {
- virXenStoreError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
if (domain->id == -1 || domain->id == 0)
@@ -789,7 +785,7 @@ xenStoreDomainGetOSType(virDomainPtr domain) {
char *vm, *str = NULL;
if ((domain == NULL) || (domain->conn == NULL)) {
- virXenStoreError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return NULL;
}
@@ -1156,8 +1152,8 @@ int xenStoreAddWatch(virConnectPtr conn,
for (n=0; n < list->count; n++) {
if( STREQ(list->watches[n]->path, path) &&
STREQ(list->watches[n]->token, token)) {
- virXenStoreError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("watch already tracked"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("watch already tracked"));
return -1;
}
}
--
1.7.10.4