mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-24 05:25:18 +00:00
Replace use of XENXS_ERROR with virReportError
Update the XenXS shared code to use virReportError instead of the XENXS_ERROR custom macro Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
29bf82593c
commit
76a0ecd2cd
1
cfg.mk
1
cfg.mk
@ -512,7 +512,6 @@ msg_gen_function += HYPERV_ERROR
|
||||
msg_gen_function += PHYP_ERROR
|
||||
msg_gen_function += VIR_ERROR
|
||||
msg_gen_function += VMX_ERROR
|
||||
msg_gen_function += XENXS_ERROR
|
||||
msg_gen_function += lxcError
|
||||
msg_gen_function += libxlError
|
||||
msg_gen_function += nodeReportError
|
||||
|
@ -56,7 +56,7 @@ int xenGetDomIdFromSxpr(const struct sexpr *root, int xendConfigVersion)
|
||||
int id = -1;
|
||||
const char * tmp = sexpr_node(root, "domain/domid");
|
||||
if (tmp == NULL && xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) { /* domid was mandatory */
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("domain information incomplete, missing id"));
|
||||
} else {
|
||||
id = tmp ? sexpr_int(root, "domain/domid") : -1;
|
||||
@ -93,7 +93,7 @@ xenParseSxprOS(const struct sexpr *node,
|
||||
goto no_memory;
|
||||
|
||||
if (def->os.loader == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("domain information incomplete, missing HVM loader"));
|
||||
return -1;
|
||||
}
|
||||
@ -153,7 +153,7 @@ xenParseSxprOS(const struct sexpr *node,
|
||||
if (!hvm &&
|
||||
!def->os.kernel &&
|
||||
!def->os.bootloader) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("domain information incomplete, missing kernel & bootloader"));
|
||||
return -1;
|
||||
}
|
||||
@ -204,7 +204,7 @@ xenParseSxprChar(const char *value,
|
||||
def->source.data.tcp.protocol = VIR_DOMAIN_CHR_TCP_PROTOCOL_TELNET;
|
||||
} else {
|
||||
if ((def->source.type = virDomainChrTypeFromString(prefix)) < 0) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unknown chr device type '%s'"), prefix);
|
||||
goto error;
|
||||
}
|
||||
@ -230,7 +230,7 @@ xenParseSxprChar(const char *value,
|
||||
const char *offset2;
|
||||
|
||||
if (offset == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("malformed char device string"));
|
||||
goto error;
|
||||
}
|
||||
@ -260,7 +260,7 @@ xenParseSxprChar(const char *value,
|
||||
const char *offset2, *offset3;
|
||||
|
||||
if (offset == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("malformed char device string"));
|
||||
goto error;
|
||||
}
|
||||
@ -278,7 +278,7 @@ xenParseSxprChar(const char *value,
|
||||
|
||||
offset3 = strchr(offset2, ':');
|
||||
if (offset3 == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("malformed char device string"));
|
||||
goto error;
|
||||
}
|
||||
@ -382,7 +382,7 @@ xenParseSxprDisks(virDomainDefPtr def,
|
||||
goto no_memory;
|
||||
|
||||
if (dst == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("domain information incomplete, vbd has no dev"));
|
||||
goto error;
|
||||
}
|
||||
@ -393,7 +393,7 @@ xenParseSxprDisks(virDomainDefPtr def,
|
||||
if (!offset ||
|
||||
!hvm ||
|
||||
STRNEQ(offset, ":cdrom")) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("domain information incomplete, vbd has no src"));
|
||||
goto error;
|
||||
}
|
||||
@ -402,7 +402,7 @@ xenParseSxprDisks(virDomainDefPtr def,
|
||||
if (src != NULL) {
|
||||
offset = strchr(src, ':');
|
||||
if (!offset) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("cannot parse vbd filename, missing driver name"));
|
||||
goto error;
|
||||
}
|
||||
@ -416,7 +416,7 @@ xenParseSxprDisks(virDomainDefPtr def,
|
||||
goto no_memory;
|
||||
if (virStrncpy(disk->driverName, src, offset-src,
|
||||
(offset-src)+1) == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Driver name %s too big for destination"),
|
||||
src);
|
||||
goto error;
|
||||
@ -429,7 +429,7 @@ xenParseSxprDisks(virDomainDefPtr def,
|
||||
STREQ (disk->driverName, "tap2")) {
|
||||
offset = strchr(src, ':');
|
||||
if (!offset) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("cannot parse vbd filename, missing driver type"));
|
||||
goto error;
|
||||
}
|
||||
@ -438,7 +438,7 @@ xenParseSxprDisks(virDomainDefPtr def,
|
||||
goto no_memory;
|
||||
if (virStrncpy(disk->driverType, src, offset-src,
|
||||
(offset-src)+1) == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Driver type %s too big for destination"),
|
||||
src);
|
||||
goto error;
|
||||
@ -601,7 +601,7 @@ xenParseSxprNets(virDomainDefPtr def,
|
||||
tmp = sexpr_node(node, "device/vif/mac");
|
||||
if (tmp) {
|
||||
if (virMacAddrParse(tmp, &net->mac) < 0) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("malformed mac address '%s'"), tmp);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -688,7 +688,7 @@ xenParseSxprSound(virDomainDefPtr def,
|
||||
else
|
||||
len = strlen(offset);
|
||||
if (virStrncpy(model, offset, len, sizeof(model)) == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Sound model %s too big for destination"),
|
||||
offset);
|
||||
goto error;
|
||||
@ -910,7 +910,7 @@ xenParseSxprGraphicsNew(virDomainDefPtr def,
|
||||
goto no_memory;
|
||||
|
||||
if ((graphics->type = virDomainGraphicsTypeFromString(tmp)) < 0) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unknown graphics type '%s'"), tmp);
|
||||
goto error;
|
||||
}
|
||||
@ -1035,43 +1035,43 @@ xenParseSxprPCI(virDomainDefPtr def,
|
||||
continue;
|
||||
|
||||
if (!(domain = sexpr_node(node, "dev/domain"))) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("missing PCI domain"));
|
||||
goto error;
|
||||
}
|
||||
if (!(bus = sexpr_node(node, "dev/bus"))) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("missing PCI bus"));
|
||||
goto error;
|
||||
}
|
||||
if (!(slot = sexpr_node(node, "dev/slot"))) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("missing PCI slot"));
|
||||
goto error;
|
||||
}
|
||||
if (!(func = sexpr_node(node, "dev/func"))) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("missing PCI func"));
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (virStrToLong_i(domain, NULL, 0, &domainID) < 0) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("cannot parse PCI domain '%s'"), domain);
|
||||
goto error;
|
||||
}
|
||||
if (virStrToLong_i(bus, NULL, 0, &busID) < 0) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("cannot parse PCI bus '%s'"), bus);
|
||||
goto error;
|
||||
}
|
||||
if (virStrToLong_i(slot, NULL, 0, &slotID) < 0) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("cannot parse PCI slot '%s'"), slot);
|
||||
goto error;
|
||||
}
|
||||
if (virStrToLong_i(func, NULL, 0, &funcID) < 0) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("cannot parse PCI func '%s'"), func);
|
||||
goto error;
|
||||
}
|
||||
@ -1134,7 +1134,7 @@ xenParseSxpr(const struct sexpr *root,
|
||||
|
||||
tmp = sexpr_node(root, "domain/domid");
|
||||
if (tmp == NULL && xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) { /* domid was mandatory */
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("domain information incomplete, missing id"));
|
||||
goto error;
|
||||
}
|
||||
@ -1147,14 +1147,14 @@ xenParseSxpr(const struct sexpr *root,
|
||||
if (sexpr_node_copy(root, "domain/name", &def->name) < 0)
|
||||
goto no_memory;
|
||||
if (def->name == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("domain information incomplete, missing name"));
|
||||
goto error;
|
||||
}
|
||||
|
||||
tmp = sexpr_node(root, "domain/uuid");
|
||||
if (tmp == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("domain information incomplete, missing name"));
|
||||
goto error;
|
||||
}
|
||||
@ -1205,7 +1205,7 @@ xenParseSxpr(const struct sexpr *root,
|
||||
|
||||
if (virDomainCpuSetParse(cpus, 0, def->cpumask,
|
||||
def->cpumasklen) < 0) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("invalid CPU mask %s"), cpus);
|
||||
goto error;
|
||||
}
|
||||
@ -1219,7 +1219,7 @@ xenParseSxpr(const struct sexpr *root,
|
||||
tmp = sexpr_node(root, "domain/on_poweroff");
|
||||
if (tmp != NULL) {
|
||||
if ((def->onPoweroff = virDomainLifecycleTypeFromString(tmp)) < 0) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unknown lifecycle type %s"), tmp);
|
||||
goto error;
|
||||
}
|
||||
@ -1229,7 +1229,7 @@ xenParseSxpr(const struct sexpr *root,
|
||||
tmp = sexpr_node(root, "domain/on_reboot");
|
||||
if (tmp != NULL) {
|
||||
if ((def->onReboot = virDomainLifecycleTypeFromString(tmp)) < 0) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unknown lifecycle type %s"), tmp);
|
||||
goto error;
|
||||
}
|
||||
@ -1239,7 +1239,7 @@ xenParseSxpr(const struct sexpr *root,
|
||||
tmp = sexpr_node(root, "domain/on_crash");
|
||||
if (tmp != NULL) {
|
||||
if ((def->onCrash = virDomainLifecycleCrashTypeFromString(tmp)) < 0) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unknown lifecycle type %s"), tmp);
|
||||
goto error;
|
||||
}
|
||||
@ -1265,7 +1265,7 @@ xenParseSxpr(const struct sexpr *root,
|
||||
const char *value = sexpr_node(root, "domain/image/hvm/localtime");
|
||||
if (value) {
|
||||
if (virStrToLong_i(value, NULL, 0, &vmlocaltime) < 0) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unknown localtime offset %s"), value);
|
||||
goto error;
|
||||
}
|
||||
@ -1307,7 +1307,7 @@ xenParseSxpr(const struct sexpr *root,
|
||||
const char *value = sexpr_node(root, "domain/image/linux/localtime");
|
||||
if (value) {
|
||||
if (virStrToLong_i(value, NULL, 0, &vmlocaltime) < 0) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unknown localtime offset %s"), value);
|
||||
goto error;
|
||||
}
|
||||
@ -1575,7 +1575,7 @@ xenFormatSxprGraphicsNew(virDomainGraphicsDefPtr def,
|
||||
|
||||
if (def->type != VIR_DOMAIN_GRAPHICS_TYPE_SDL &&
|
||||
def->type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected graphics type %d"),
|
||||
def->type);
|
||||
return -1;
|
||||
@ -1634,7 +1634,7 @@ xenFormatSxprGraphicsOld(virDomainGraphicsDefPtr def,
|
||||
|
||||
if (def->type != VIR_DOMAIN_GRAPHICS_TYPE_SDL &&
|
||||
def->type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected graphics type %d"),
|
||||
def->type);
|
||||
return -1;
|
||||
@ -1688,7 +1688,7 @@ xenFormatSxprChr(virDomainChrDefPtr def,
|
||||
const char *type = virDomainChrTypeToString(def->source.type);
|
||||
|
||||
if (!type) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("unexpected chr device type"));
|
||||
return -1;
|
||||
}
|
||||
@ -1744,7 +1744,7 @@ xenFormatSxprChr(virDomainChrDefPtr def,
|
||||
break;
|
||||
|
||||
default:
|
||||
XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unsupported chr device type '%s'"), type);
|
||||
return -1;
|
||||
}
|
||||
@ -1783,7 +1783,7 @@ xenFormatSxprDisk(virDomainDiskDefPtr def,
|
||||
if (hvm &&
|
||||
def->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY) {
|
||||
if (isAttach) {
|
||||
XENXS_ERROR(VIR_ERR_INVALID_ARG,
|
||||
virReportError(VIR_ERR_INVALID_ARG,
|
||||
_("Cannot directly attach floppy %s"), def->src);
|
||||
return -1;
|
||||
}
|
||||
@ -1795,7 +1795,7 @@ xenFormatSxprDisk(virDomainDiskDefPtr def,
|
||||
def->device == VIR_DOMAIN_DISK_DEVICE_CDROM &&
|
||||
xendConfigVersion == XEND_CONFIG_VERSION_3_0_2) {
|
||||
if (isAttach) {
|
||||
XENXS_ERROR(VIR_ERR_INVALID_ARG,
|
||||
virReportError(VIR_ERR_INVALID_ARG,
|
||||
_("Cannot directly attach CDROM %s"), def->src);
|
||||
return -1;
|
||||
}
|
||||
@ -1855,7 +1855,7 @@ xenFormatSxprDisk(virDomainDiskDefPtr def,
|
||||
virBufferEscapeSexpr(buf, "(uname 'phy:/dev/%s')",
|
||||
def->src);
|
||||
} else {
|
||||
XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unsupported disk type %s"),
|
||||
virDomainDiskTypeToString(def->type));
|
||||
return -1;
|
||||
@ -1870,7 +1870,7 @@ xenFormatSxprDisk(virDomainDiskDefPtr def,
|
||||
else
|
||||
virBufferAddLit(buf, "(mode 'w')");
|
||||
if (def->transient) {
|
||||
XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("transient disks not supported yet"));
|
||||
return -1;
|
||||
}
|
||||
@ -1912,14 +1912,14 @@ xenFormatSxprNet(virConnectPtr conn,
|
||||
if (def->type != VIR_DOMAIN_NET_TYPE_BRIDGE &&
|
||||
def->type != VIR_DOMAIN_NET_TYPE_NETWORK &&
|
||||
def->type != VIR_DOMAIN_NET_TYPE_ETHERNET) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unsupported network type %d"), def->type);
|
||||
return -1;
|
||||
}
|
||||
if (def->script &&
|
||||
def->type != VIR_DOMAIN_NET_TYPE_BRIDGE &&
|
||||
def->type != VIR_DOMAIN_NET_TYPE_ETHERNET) {
|
||||
XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("scripts are not supported on interfaces of type %s"),
|
||||
virDomainNetTypeToString(def->type));
|
||||
return -1;
|
||||
@ -1953,7 +1953,7 @@ xenFormatSxprNet(virConnectPtr conn,
|
||||
char *bridge;
|
||||
|
||||
if (!network) {
|
||||
XENXS_ERROR(VIR_ERR_NO_NETWORK, "%s",
|
||||
virReportError(VIR_ERR_NO_NETWORK, "%s",
|
||||
def->data.network.name);
|
||||
return -1;
|
||||
}
|
||||
@ -1961,7 +1961,7 @@ xenFormatSxprNet(virConnectPtr conn,
|
||||
bridge = virNetworkGetBridgeName(network);
|
||||
virNetworkFree(network);
|
||||
if (!bridge) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("network %s is not active"),
|
||||
def->data.network.name);
|
||||
return -1;
|
||||
@ -2063,7 +2063,7 @@ xenFormatSxprOnePCI(virDomainHostdevDefPtr def,
|
||||
int detach)
|
||||
{
|
||||
if (def->managed) {
|
||||
XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("managed PCI devices not supported with XenD"));
|
||||
return -1;
|
||||
}
|
||||
@ -2123,7 +2123,7 @@ xenFormatSxprAllPCI(virDomainDefPtr def,
|
||||
if (def->hostdevs[i]->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
|
||||
def->hostdevs[i]->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) {
|
||||
if (def->hostdevs[i]->managed) {
|
||||
XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("managed PCI devices not supported with XenD"));
|
||||
return -1;
|
||||
}
|
||||
@ -2155,7 +2155,7 @@ xenFormatSxprSound(virDomainDefPtr def,
|
||||
|
||||
for (i = 0 ; i < def->nsounds ; i++) {
|
||||
if (!(str = virDomainSoundModelTypeToString(def->sounds[i]->model))) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected sound model %d"),
|
||||
def->sounds[i]->model);
|
||||
return -1;
|
||||
@ -2192,7 +2192,7 @@ xenFormatSxprInput(virDomainInputDefPtr input,
|
||||
|
||||
if (input->type != VIR_DOMAIN_INPUT_TYPE_MOUSE &&
|
||||
input->type != VIR_DOMAIN_INPUT_TYPE_TABLET) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected input type %d"), input->type);
|
||||
return -1;
|
||||
}
|
||||
@ -2270,21 +2270,21 @@ xenFormatSxpr(virConnectPtr conn,
|
||||
}
|
||||
|
||||
if (!(tmp = virDomainLifecycleTypeToString(def->onPoweroff))) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected lifecycle value %d"), def->onPoweroff);
|
||||
goto error;
|
||||
}
|
||||
virBufferAsprintf(&buf, "(on_poweroff '%s')", tmp);
|
||||
|
||||
if (!(tmp = virDomainLifecycleTypeToString(def->onReboot))) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected lifecycle value %d"), def->onReboot);
|
||||
goto error;
|
||||
}
|
||||
virBufferAsprintf(&buf, "(on_reboot '%s')", tmp);
|
||||
|
||||
if (!(tmp = virDomainLifecycleCrashTypeToString(def->onCrash))) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected lifecycle value %d"), def->onCrash);
|
||||
goto error;
|
||||
}
|
||||
@ -2302,7 +2302,7 @@ xenFormatSxpr(virConnectPtr conn,
|
||||
|
||||
if (hvm &&
|
||||
def->os.loader == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s",_("no HVM domain loader"));
|
||||
goto error;
|
||||
}
|
||||
@ -2492,7 +2492,7 @@ xenFormatSxpr(virConnectPtr conn,
|
||||
vmlocaltime = 1;
|
||||
break;
|
||||
default:
|
||||
XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unsupported clock offset='%s'"),
|
||||
virDomainClockOffsetTypeToString(def->clock.offset));
|
||||
goto error;
|
||||
@ -2515,7 +2515,7 @@ xenFormatSxpr(virConnectPtr conn,
|
||||
break;
|
||||
case VIR_DOMAIN_CLOCK_OFFSET_UTC:
|
||||
if (def->clock.data.utc_reset) {
|
||||
XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unsupported clock adjustment='reset'"));
|
||||
goto error;
|
||||
}
|
||||
@ -2524,7 +2524,7 @@ xenFormatSxpr(virConnectPtr conn,
|
||||
break;
|
||||
case VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME:
|
||||
if (def->clock.data.utc_reset) {
|
||||
XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unsupported clock adjustment='reset'"));
|
||||
goto error;
|
||||
}
|
||||
@ -2532,7 +2532,7 @@ xenFormatSxpr(virConnectPtr conn,
|
||||
rtc_timeoffset = 0;
|
||||
break;
|
||||
default:
|
||||
XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unsupported clock offset='%s'"),
|
||||
virDomainClockOffsetTypeToString(def->clock.offset));
|
||||
goto error;
|
||||
@ -2548,7 +2548,7 @@ xenFormatSxpr(virConnectPtr conn,
|
||||
vmlocaltime = 1;
|
||||
break;
|
||||
default:
|
||||
XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unsupported clock offset='%s'"),
|
||||
virDomainClockOffsetTypeToString(def->clock.offset));
|
||||
goto error;
|
||||
|
@ -56,7 +56,7 @@ static int xenXMConfigGetBool(virConfPtr conf,
|
||||
} else if (val->type == VIR_CONF_STRING) {
|
||||
*value = STREQ(val->str, "1") ? 1 : 0;
|
||||
} else {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("config value %s was malformed"), name);
|
||||
return -1;
|
||||
}
|
||||
@ -83,12 +83,12 @@ static int xenXMConfigGetULong(virConfPtr conf,
|
||||
char *ret;
|
||||
*value = strtol(val->str, &ret, 10);
|
||||
if (ret == val->str) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("config value %s was malformed"), name);
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("config value %s was malformed"), name);
|
||||
return -1;
|
||||
}
|
||||
@ -115,12 +115,12 @@ static int xenXMConfigGetULongLong(virConfPtr conf,
|
||||
char *ret;
|
||||
*value = strtoll(val->str, &ret, 10);
|
||||
if (ret == val->str) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("config value %s was malformed"), name);
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("config value %s was malformed"), name);
|
||||
return -1;
|
||||
}
|
||||
@ -142,7 +142,7 @@ static int xenXMConfigGetString(virConfPtr conf,
|
||||
}
|
||||
|
||||
if (val->type != VIR_CONF_STRING) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("config value %s was malformed"), name);
|
||||
return -1;
|
||||
}
|
||||
@ -163,20 +163,20 @@ static int xenXMConfigCopyStringInternal(virConfPtr conf,
|
||||
if (!(val = virConfGetValue(conf, name))) {
|
||||
if (allowMissing)
|
||||
return 0;
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("config value %s was missing"), name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (val->type != VIR_CONF_STRING) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("config value %s was not a string"), name);
|
||||
return -1;
|
||||
}
|
||||
if (!val->str) {
|
||||
if (allowMissing)
|
||||
return 0;
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("config value %s was missing"), name);
|
||||
return -1;
|
||||
}
|
||||
@ -208,31 +208,31 @@ static int xenXMConfigGetUUID(virConfPtr conf, const char *name, unsigned char *
|
||||
virConfValuePtr val;
|
||||
|
||||
if (!uuid || !name || !conf) {
|
||||
XENXS_ERROR(VIR_ERR_INVALID_ARG,
|
||||
virReportError(VIR_ERR_INVALID_ARG,
|
||||
_("Arguments must be non null"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!(val = virConfGetValue(conf, name))) {
|
||||
XENXS_ERROR(VIR_ERR_CONF_SYNTAX,
|
||||
virReportError(VIR_ERR_CONF_SYNTAX,
|
||||
_("config value %s was missing"), name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (val->type != VIR_CONF_STRING) {
|
||||
XENXS_ERROR(VIR_ERR_CONF_SYNTAX,
|
||||
virReportError(VIR_ERR_CONF_SYNTAX,
|
||||
_("config value %s not a string"), name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!val->str) {
|
||||
XENXS_ERROR(VIR_ERR_CONF_SYNTAX,
|
||||
virReportError(VIR_ERR_CONF_SYNTAX,
|
||||
_("%s can't be empty"), name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (virUUIDParse(val->str, uuid) < 0) {
|
||||
XENXS_ERROR(VIR_ERR_CONF_SYNTAX,
|
||||
virReportError(VIR_ERR_CONF_SYNTAX,
|
||||
_("%s not parseable"), val->str);
|
||||
return -1;
|
||||
}
|
||||
@ -287,7 +287,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
||||
|
||||
defaultArch = virCapabilitiesDefaultGuestArch(caps, def->os.type, virDomainVirtTypeToString(def->virtType));
|
||||
if (defaultArch == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("no supported architecture for os type '%s'"),
|
||||
def->os.type);
|
||||
goto cleanup;
|
||||
@ -379,7 +379,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
||||
if (xenXMConfigGetString(conf, "on_poweroff", &str, "destroy") < 0)
|
||||
goto cleanup;
|
||||
if ((def->onPoweroff = virDomainLifecycleTypeFromString(str)) < 0) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected value %s for on_poweroff"), str);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -387,7 +387,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
||||
if (xenXMConfigGetString(conf, "on_reboot", &str, "restart") < 0)
|
||||
goto cleanup;
|
||||
if ((def->onReboot = virDomainLifecycleTypeFromString(str)) < 0) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected value %s for on_reboot"), str);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -395,7 +395,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
||||
if (xenXMConfigGetString(conf, "on_crash", &str, "restart") < 0)
|
||||
goto cleanup;
|
||||
if ((def->onCrash = virDomainLifecycleCrashTypeFromString(str)) < 0) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected value %s for on_crash"), str);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -509,7 +509,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
||||
goto no_memory;
|
||||
if (virStrncpy(disk->src, head, offset - head,
|
||||
(offset - head) + 1) == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Source file %s too big for destination"),
|
||||
head);
|
||||
goto cleanup;
|
||||
@ -528,7 +528,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
||||
goto no_memory;
|
||||
if (virStrncpy(disk->dst, head, offset - head,
|
||||
(offset - head) + 1) == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Dest file %s too big for destination"), head);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -544,7 +544,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
||||
if (virStrncpy(disk->driverName, disk->src,
|
||||
(tmp - disk->src),
|
||||
(tmp - disk->src) + 1) == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Driver name %s too big for destination"),
|
||||
disk->src);
|
||||
goto cleanup;
|
||||
@ -565,7 +565,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
||||
if (virStrncpy(disk->driverType, disk->src,
|
||||
(tmp - disk->src),
|
||||
(tmp - disk->src) + 1) == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Driver type %s too big for destination"),
|
||||
disk->src);
|
||||
goto cleanup;
|
||||
@ -681,7 +681,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
||||
if (STRPREFIX(key, "mac=")) {
|
||||
int len = nextkey ? (nextkey - data) : sizeof(mac) - 1;
|
||||
if (virStrncpy(mac, data, len, sizeof(mac)) == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("MAC address %s too big for destination"),
|
||||
data);
|
||||
goto skipnic;
|
||||
@ -689,7 +689,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
||||
} else if (STRPREFIX(key, "bridge=")) {
|
||||
int len = nextkey ? (nextkey - data) : sizeof(bridge) - 1;
|
||||
if (virStrncpy(bridge, data, len, sizeof(bridge)) == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Bridge %s too big for destination"),
|
||||
data);
|
||||
goto skipnic;
|
||||
@ -703,21 +703,21 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
||||
} else if (STRPREFIX(key, "model=")) {
|
||||
int len = nextkey ? (nextkey - data) : sizeof(model) - 1;
|
||||
if (virStrncpy(model, data, len, sizeof(model)) == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Model %s too big for destination"), data);
|
||||
goto skipnic;
|
||||
}
|
||||
} else if (STRPREFIX(key, "type=")) {
|
||||
int len = nextkey ? (nextkey - data) : sizeof(type) - 1;
|
||||
if (virStrncpy(type, data, len, sizeof(type)) == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Type %s too big for destination"), data);
|
||||
goto skipnic;
|
||||
}
|
||||
} else if (STRPREFIX(key, "vifname=")) {
|
||||
int len = nextkey ? (nextkey - data) : sizeof(vifname) - 1;
|
||||
if (virStrncpy(vifname, data, len, sizeof(vifname)) == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Vifname %s too big for destination"),
|
||||
data);
|
||||
goto skipnic;
|
||||
@ -725,7 +725,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
||||
} else if (STRPREFIX(key, "ip=")) {
|
||||
int len = nextkey ? (nextkey - data) : sizeof(ip) - 1;
|
||||
if (virStrncpy(ip, data, len, sizeof(ip)) == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("IP %s too big for destination"), data);
|
||||
goto skipnic;
|
||||
}
|
||||
@ -743,7 +743,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
||||
|
||||
if (mac[0]) {
|
||||
if (virMacAddrParse(mac, &net->mac) < 0) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("malformed mac address '%s'"), mac);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -823,7 +823,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
||||
goto skippci;
|
||||
|
||||
if (virStrncpy(domain, key, (nextkey - key), sizeof(domain)) == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Domain %s too big for destination"), key);
|
||||
goto skippci;
|
||||
}
|
||||
@ -833,7 +833,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
||||
goto skippci;
|
||||
|
||||
if (virStrncpy(bus, key, (nextkey - key), sizeof(bus)) == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Bus %s too big for destination"), key);
|
||||
goto skippci;
|
||||
}
|
||||
@ -843,7 +843,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
||||
goto skippci;
|
||||
|
||||
if (virStrncpy(slot, key, (nextkey - key), sizeof(slot)) == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Slot %s too big for destination"), key);
|
||||
goto skippci;
|
||||
}
|
||||
@ -853,7 +853,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
||||
goto skippci;
|
||||
|
||||
if (virStrncpy(func, key, 1, sizeof(func)) == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Function %s too big for destination"), key);
|
||||
goto skippci;
|
||||
}
|
||||
@ -979,7 +979,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
||||
char *key = vfb;
|
||||
|
||||
if (virStrcpyStatic(vfb, list->list->str) == NULL) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("VFB %s too big for destination"),
|
||||
list->list->str);
|
||||
goto cleanup;
|
||||
@ -1159,7 +1159,7 @@ int xenXMConfigSetInt(virConfPtr conf, const char *setting, long long l) {
|
||||
virConfValuePtr value = NULL;
|
||||
|
||||
if ((long) l != l) {
|
||||
XENXS_ERROR(VIR_ERR_OVERFLOW, _("failed to store %lld to %s"),
|
||||
virReportError(VIR_ERR_OVERFLOW, _("failed to store %lld to %s"),
|
||||
l, setting);
|
||||
return -1;
|
||||
}
|
||||
@ -1219,7 +1219,7 @@ static int xenFormatXMDisk(virConfValuePtr list,
|
||||
virBufferAddLit(&buf, "phy:");
|
||||
break;
|
||||
default:
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unsupported disk type %s"),
|
||||
virDomainDiskTypeToString(disk->type));
|
||||
goto cleanup;
|
||||
@ -1242,7 +1242,7 @@ static int xenFormatXMDisk(virConfValuePtr list,
|
||||
else
|
||||
virBufferAddLit(&buf, ",w");
|
||||
if (disk->transient) {
|
||||
XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("transient disks not supported yet"));
|
||||
return -1;
|
||||
}
|
||||
@ -1350,14 +1350,14 @@ static int xenFormatXMNet(virConnectPtr conn,
|
||||
virNetworkPtr network = virNetworkLookupByName(conn, net->data.network.name);
|
||||
char *bridge;
|
||||
if (!network) {
|
||||
XENXS_ERROR(VIR_ERR_NO_NETWORK, "%s",
|
||||
virReportError(VIR_ERR_NO_NETWORK, "%s",
|
||||
net->data.network.name);
|
||||
return -1;
|
||||
}
|
||||
bridge = virNetworkGetBridgeName(network);
|
||||
virNetworkFree(network);
|
||||
if (!bridge) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("network %s is not active"),
|
||||
net->data.network.name);
|
||||
return -1;
|
||||
@ -1369,7 +1369,7 @@ static int xenFormatXMNet(virConnectPtr conn,
|
||||
break;
|
||||
|
||||
default:
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unsupported network type %d"),
|
||||
net->type);
|
||||
goto cleanup;
|
||||
@ -1670,7 +1670,7 @@ virConfPtr xenFormatXM(virConnectPtr conn,
|
||||
vmlocaltime = 1;
|
||||
break;
|
||||
default:
|
||||
XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unsupported clock offset='%s'"),
|
||||
virDomainClockOffsetTypeToString(def->clock.offset));
|
||||
goto cleanup;
|
||||
@ -1686,7 +1686,7 @@ virConfPtr xenFormatXM(virConnectPtr conn,
|
||||
break;
|
||||
case VIR_DOMAIN_CLOCK_OFFSET_UTC:
|
||||
if (def->clock.data.utc_reset) {
|
||||
XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unsupported clock adjustment='reset'"));
|
||||
goto cleanup;
|
||||
}
|
||||
@ -1695,7 +1695,7 @@ virConfPtr xenFormatXM(virConnectPtr conn,
|
||||
break;
|
||||
case VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME:
|
||||
if (def->clock.data.utc_reset) {
|
||||
XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unsupported clock adjustment='reset'"));
|
||||
goto cleanup;
|
||||
}
|
||||
@ -1703,7 +1703,7 @@ virConfPtr xenFormatXM(virConnectPtr conn,
|
||||
rtc_timeoffset = 0;
|
||||
break;
|
||||
default:
|
||||
XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unsupported clock offset='%s'"),
|
||||
virDomainClockOffsetTypeToString(def->clock.offset));
|
||||
goto cleanup;
|
||||
@ -1720,7 +1720,7 @@ virConfPtr xenFormatXM(virConnectPtr conn,
|
||||
vmlocaltime = 1;
|
||||
break;
|
||||
default:
|
||||
XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unsupported clock offset='%s'"),
|
||||
virDomainClockOffsetTypeToString(def->clock.offset));
|
||||
goto cleanup;
|
||||
@ -1732,7 +1732,7 @@ virConfPtr xenFormatXM(virConnectPtr conn,
|
||||
|
||||
|
||||
if (!(lifecycle = virDomainLifecycleTypeToString(def->onPoweroff))) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected lifecycle action %d"), def->onPoweroff);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -1741,7 +1741,7 @@ virConfPtr xenFormatXM(virConnectPtr conn,
|
||||
|
||||
|
||||
if (!(lifecycle = virDomainLifecycleTypeToString(def->onReboot))) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected lifecycle action %d"), def->onReboot);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -1750,7 +1750,7 @@ virConfPtr xenFormatXM(virConnectPtr conn,
|
||||
|
||||
|
||||
if (!(lifecycle = virDomainLifecycleCrashTypeToString(def->onCrash))) {
|
||||
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected lifecycle action %d"), def->onCrash);
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -57,8 +57,4 @@
|
||||
|
||||
# define VIR_FROM_THIS VIR_FROM_NONE
|
||||
|
||||
# define XENXS_ERROR(code, ...) \
|
||||
virReportErrorHelper(VIR_FROM_NONE, code, __FILE__, __FUNCTION__, \
|
||||
__LINE__, __VA_ARGS__)
|
||||
|
||||
#endif /* __VIR_XENXS_PRIVATE_H__ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user