mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
Replace use of libxlError with virReportError
Update the libxl driver to use virReportError instead of the libxlError custom macro Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
73a5c94e50
commit
3445a3ec2f
1
cfg.mk
1
cfg.mk
@ -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,7 +372,7 @@ 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,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("libxenlight failed to parse UUID '%s'"), uuidstr);
|
||||
goto error;
|
||||
}
|
||||
@ -397,7 +397,7 @@ 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",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("This version of libxenlight only supports 32 "
|
||||
"vcpus per domain"));
|
||||
return -1;
|
||||
@ -532,7 +532,7 @@ libxlMakeDisk(virDomainDefPtr def, virDomainDiskDefPtr l_disk,
|
||||
x_disk->format = DISK_FORMAT_RAW;
|
||||
x_disk->backend = DISK_BACKEND_PHY;
|
||||
} else {
|
||||
libxlError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("libxenlight does not support disk driver %s"),
|
||||
l_disk->driverName);
|
||||
return -1;
|
||||
@ -548,7 +548,7 @@ 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",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("libxenlight does not support transient disks"));
|
||||
return -1;
|
||||
}
|
||||
@ -626,7 +626,7 @@ libxlMakeNic(virDomainDefPtr def, virDomainNetDefPtr l_nic,
|
||||
}
|
||||
} else {
|
||||
if (l_nic->script) {
|
||||
libxlError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("scripts are not supported on interfaces of type %s"),
|
||||
virDomainNetTypeToString(l_nic->type));
|
||||
return -1;
|
||||
@ -697,7 +697,7 @@ 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,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("Unable to find an unused VNC port"));
|
||||
return -1;
|
||||
}
|
||||
@ -779,7 +779,7 @@ libxlMakeChrdevStr(virDomainChrDefPtr def, char **buf)
|
||||
const char *type = virDomainChrTypeToString(def->source.type);
|
||||
|
||||
if (!type) {
|
||||
libxlError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("unexpected chr device type"));
|
||||
return -1;
|
||||
}
|
||||
@ -917,13 +917,13 @@ 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",
|
||||
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",
|
||||
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);
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user