提交 3445a3ec 编写于 作者: D Daniel P. Berrange

Replace use of libxlError with virReportError

Update the libxl driver to use virReportError instead of
the libxlError custom macro
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 73a5c94e
......@@ -513,7 +513,6 @@ msg_gen_function += PHYP_ERROR
msg_gen_function += VIR_ERROR
msg_gen_function += VMX_ERROR
msg_gen_function += lxcError
msg_gen_function += libxlError
msg_gen_function += nodeReportError
msg_gen_function += regerror
msg_gen_function += statsError
......
......@@ -372,8 +372,8 @@ libxlMakeDomCreateInfo(virDomainDefPtr def, libxl_domain_create_info *c_info)
virUUIDFormat(def->uuid, uuidstr);
if (libxl_uuid_from_string(&c_info->uuid, uuidstr) ) {
libxlError(VIR_ERR_INTERNAL_ERROR,
_("libxenlight failed to parse UUID '%s'"), uuidstr);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("libxenlight failed to parse UUID '%s'"), uuidstr);
goto error;
}
......@@ -397,9 +397,9 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
* only 32 can be represented.
*/
if (def->maxvcpus > 32 || def->vcpus > 32) {
libxlError(VIR_ERR_INTERNAL_ERROR, "%s",
_("This version of libxenlight only supports 32 "
"vcpus per domain"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("This version of libxenlight only supports 32 "
"vcpus per domain"));
return -1;
}
......@@ -532,9 +532,9 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
x_disk->format = DISK_FORMAT_RAW;
x_disk->backend = DISK_BACKEND_PHY;
} else {
libxlError(VIR_ERR_INTERNAL_ERROR,
_("libxenlight does not support disk driver %s"),
l_disk->driverName);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("libxenlight does not support disk driver %s"),
l_disk->driverName);
return -1;
}
} else {
......@@ -548,8 +548,8 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
x_disk->readwrite = !l_disk->readonly;
x_disk->is_cdrom = l_disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM ? 1 : 0;
if (l_disk->transient) {
libxlError(VIR_ERR_INTERNAL_ERROR, "%s",
_("libxenlight does not support transient disks"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("libxenlight does not support transient disks"));
return -1;
}
......@@ -626,9 +626,9 @@ libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
}
} else {
if (l_nic->script) {
libxlError(VIR_ERR_CONFIG_UNSUPPORTED,
_("scripts are not supported on interfaces of type %s"),
virDomainNetTypeToString(l_nic->type));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("scripts are not supported on interfaces of type %s"),
virDomainNetTypeToString(l_nic->type));
return -1;
}
}
......@@ -697,8 +697,8 @@ libxlMakeVfb(libxlDriverPrivatePtr driver, virDomainDefPtr def,
if (l_vfb->data.vnc.autoport) {
port = libxlNextFreeVncPort(driver, LIBXL_VNC_PORT_MIN);
if (port < 0) {
libxlError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to find an unused VNC port"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to find an unused VNC port"));
return -1;
}
l_vfb->data.vnc.port = port;
......@@ -779,8 +779,8 @@ libxlMakeChrdevStr(virDomainChrDefPtr def, char **buf)
const char *type = virDomainChrTypeToString(def->source.type);
if (!type) {
libxlError(VIR_ERR_INTERNAL_ERROR,
"%s", _("unexpected chr device type"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("unexpected chr device type"));
return -1;
}
......@@ -917,14 +917,14 @@ libxlMakeCapabilities(libxl_ctx *ctx)
regcomp (&xen_cap_rec, xen_cap_re, REG_EXTENDED);
if (libxl_get_physinfo(ctx, &phy_info) != 0) {
libxlError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Failed to get node physical info from libxenlight"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Failed to get node physical info from libxenlight"));
return NULL;
}
if ((ver_info = libxl_get_version_info(ctx)) == NULL) {
libxlError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Failed to get version info from libxenlight"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Failed to get version info from libxenlight"));
return NULL;
}
......
......@@ -96,10 +96,6 @@ struct _libxlSavefileHeader {
uint32_t unused[10];
};
# define libxlError(code, ...) \
virReportErrorHelper(VIR_FROM_LIBXL, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__)
virCapsPtr
libxlMakeCapabilities(libxl_ctx *ctx);
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册