#define VIR_FROM_THIS VIR_FROM_NONE
-#define VMX_ERROR(code, ...) \
- virReportErrorHelper(VIR_FROM_NONE, code, __FILE__, __FUNCTION__, \
- __LINE__, __VA_ARGS__)
-
#define VMX_BUILD_NAME_EXTRA(_suffix, _extra) \
snprintf(_suffix##_name, sizeof(_suffix##_name), "%s."_extra, prefix);
handler = xmlFindCharEncodingHandler(encoding);
if (handler == NULL) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("libxml2 doesn't handle %s encoding"), encoding);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("libxml2 doesn't handle %s encoding"), encoding);
return NULL;
}
utf8 = xmlBufferCreate();
if (xmlCharEncInFunc(handler, utf8, input) < 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not convert from %s to UTF-8 encoding"), encoding);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not convert from %s to UTF-8 encoding"), encoding);
goto cleanup;
}
return 0;
}
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Missing essential config entry '%s'"), name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Missing essential config entry '%s'"), name);
return -1;
}
if (value->type != VIR_CONF_STRING) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Config entry '%s' must be a string"), name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Config entry '%s' must be a string"), name);
return -1;
}
return 0;
}
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Missing essential config entry '%s'"), name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Missing essential config entry '%s'"), name);
return -1;
}
if (optional) {
return 0;
} else {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Missing essential config entry '%s'"), name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Missing essential config entry '%s'"), name);
return -1;
}
}
if (value->type != VIR_CONF_STRING) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Config entry '%s' must be a string"), name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Config entry '%s' must be a string"), name);
return -1;
}
if (optional) {
return 0;
} else {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Missing essential config entry '%s'"), name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Missing essential config entry '%s'"), name);
return -1;
}
}
if (virUUIDParse(value->str, uuid) < 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not parse UUID from string '%s'"), value->str);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not parse UUID from string '%s'"), value->str);
return -1;
}
if (optional) {
return 0;
} else {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Missing essential config entry '%s'"), name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Missing essential config entry '%s'"), name);
return -1;
}
}
if (optional) {
return 0;
} else {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Missing essential config entry '%s'"), name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Missing essential config entry '%s'"), name);
return -1;
}
}
if (STRCASEEQ(value->str, "unlimited")) {
*number = -1;
} else if (virStrToLong_ll(value->str, NULL, 10, number) < 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Config entry '%s' must represent an integer value"),
- name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Config entry '%s' must represent an integer value"),
+ name);
return -1;
}
} else {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Config entry '%s' must be a string"), name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Config entry '%s' must be a string"), name);
return -1;
}
if (optional) {
return 0;
} else {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Missing essential config entry '%s'"), name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Missing essential config entry '%s'"), name);
return -1;
}
}
if (optional) {
return 0;
} else {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Missing essential config entry '%s'"), name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Missing essential config entry '%s'"), name);
return -1;
}
}
} else if (STRCASEEQ(value->str, "false")) {
*boolean_ = 0;
} else {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Config entry '%s' must represent a boolean value "
- "(true|false)"), name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Config entry '%s' must represent a boolean value "
+ "(true|false)"), name);
return -1;
}
} else {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Config entry '%s' must be a string"), name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Config entry '%s' must be a string"), name);
return -1;
}
int idx;
if (! STRPREFIX(name, "sd")) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Expecting domain XML attribute 'dev' of entry "
- "'devices/disk/target' to start with 'sd'"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Expecting domain XML attribute 'dev' of entry "
+ "'devices/disk/target' to start with 'sd'"));
return -1;
}
idx = virDiskNameToIndex(name);
if (idx < 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not parse valid disk index from '%s'"), name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not parse valid disk index from '%s'"), name);
return -1;
}
/* Each of the 4 SCSI controllers has 1 bus with 15 units each for devices */
if (idx >= (4 * 15)) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("SCSI disk index (parsed from '%s') is too large"), name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("SCSI disk index (parsed from '%s') is too large"), name);
return -1;
}
int idx;
if (! STRPREFIX(name, "hd")) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Expecting domain XML attribute 'dev' of entry "
- "'devices/disk/target' to start with 'hd'"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Expecting domain XML attribute 'dev' of entry "
+ "'devices/disk/target' to start with 'hd'"));
return -1;
}
idx = virDiskNameToIndex(name);
if (idx < 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not parse valid disk index from '%s'"), name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not parse valid disk index from '%s'"), name);
return -1;
}
/* The IDE controller has 2 buses with 2 units each for devices */
if (idx >= (2 * 2)) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("IDE disk index (parsed from '%s') is too large"), name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("IDE disk index (parsed from '%s') is too large"), name);
return -1;
}
int idx;
if (! STRPREFIX(name, "fd")) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Expecting domain XML attribute 'dev' of entry "
- "'devices/disk/target' to start with 'fd'"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Expecting domain XML attribute 'dev' of entry "
+ "'devices/disk/target' to start with 'fd'"));
return -1;
}
idx = virDiskNameToIndex(name);
if (idx < 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not parse valid disk index from '%s'"), name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not parse valid disk index from '%s'"), name);
return -1;
}
/* The FDC controller has 1 bus with 2 units for devices */
if (idx >= 2) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Floppy disk index (parsed from '%s') is too large"), name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Floppy disk index (parsed from '%s') is too large"), name);
return -1;
}
memset(&def, 0, sizeof(def));
if (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) {
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Unsupported disk address type '%s'"),
- virDomainDeviceAddressTypeToString(disk->info.type));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported disk address type '%s'"),
+ virDomainDeviceAddressTypeToString(disk->info.type));
return -1;
}
def.bus = disk->bus;
if (virDomainDiskDefAssignAddress(caps, &def) < 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Could not verify disk address"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not verify disk address"));
return -1;
}
if (def.info.addr.drive.controller != drive->controller ||
def.info.addr.drive.bus != drive->bus ||
def.info.addr.drive.unit != drive->unit) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Disk address %d:%d:%d doesn't match target device '%s'"),
- drive->controller, drive->bus, drive->unit, disk->dst);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Disk address %d:%d:%d doesn't match target device '%s'"),
+ drive->controller, drive->bus, drive->unit, disk->dst);
return -1;
}
/* drive->{controller|bus|unit} is unsigned, no >= 0 checks are necessary */
if (disk->bus == VIR_DOMAIN_DISK_BUS_SCSI) {
if (drive->controller > 3) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("SCSI controller index %d out of [0..3] range"),
- drive->controller);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("SCSI controller index %d out of [0..3] range"),
+ drive->controller);
return -1;
}
if (drive->bus != 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("SCSI bus index %d out of [0] range"),
- drive->bus);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("SCSI bus index %d out of [0] range"),
+ drive->bus);
return -1;
}
if (drive->unit > 15 || drive->unit == 7) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("SCSI unit index %d out of [0..6,8..15] range"),
- drive->unit);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("SCSI unit index %d out of [0..6,8..15] range"),
+ drive->unit);
return -1;
}
} else if (disk->bus == VIR_DOMAIN_DISK_BUS_IDE) {
if (drive->controller != 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("IDE controller index %d out of [0] range"),
- drive->controller);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("IDE controller index %d out of [0] range"),
+ drive->controller);
return -1;
}
if (drive->bus > 1) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("IDE bus index %d out of [0..1] range"),
- drive->bus);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("IDE bus index %d out of [0..1] range"),
+ drive->bus);
return -1;
}
if (drive->unit > 1) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("IDE unit index %d out of [0..1] range"),
- drive->unit);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("IDE unit index %d out of [0..1] range"),
+ drive->unit);
return -1;
}
} else if (disk->bus == VIR_DOMAIN_DISK_BUS_FDC) {
if (drive->controller != 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("FDC controller index %d out of [0] range"),
- drive->controller);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("FDC controller index %d out of [0] range"),
+ drive->controller);
return -1;
}
if (drive->bus != 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("FDC bus index %d out of [0] range"),
- drive->bus);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("FDC bus index %d out of [0] range"),
+ drive->bus);
return -1;
}
if (drive->unit > 1) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("FDC unit index %d out of [0..1] range"),
- drive->unit);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("FDC unit index %d out of [0..1] range"),
+ drive->unit);
return -1;
}
} else {
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Unsupported bus type '%s'"),
- virDomainDiskBusTypeToString(disk->bus));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported bus type '%s'"),
+ virDomainDiskBusTypeToString(disk->bus));
return -1;
}
model = virDomainControllerModelSCSITypeFromString(disk->driverName);
if (model < 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Unknown driver name '%s'"), disk->driverName);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unknown driver name '%s'"), disk->driverName);
return -1;
}
}
if (controller == NULL) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Missing SCSI controller for index %d"),
- disk->info.addr.drive.controller);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Missing SCSI controller for index %d"),
+ disk->info.addr.drive.controller);
return -1;
}
if (controller->model == -1) {
controller->model = model;
} else if (controller->model != model) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Inconsistent SCSI controller model ('%s' is not '%s') "
- "for SCSI controller index %d"), disk->driverName,
- virDomainControllerModelSCSITypeToString(controller->model),
- controller->idx);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Inconsistent SCSI controller model ('%s' is not '%s') "
+ "for SCSI controller index %d"), disk->driverName,
+ virDomainControllerModelSCSITypeToString(controller->model),
+ controller->idx);
return -1;
}
* have inconsistent SCSI controller models */
for (k = 0; k < count; ++k) {
if (autodetectedModels[k] != autodetectedModels[0]) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Disks on SCSI controller %d have inconsistent "
- "controller models, cannot autodetect model"),
- controller->idx);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Disks on SCSI controller %d have inconsistent "
+ "controller models, cannot autodetect model"),
+ controller->idx);
goto cleanup;
}
}
controller->model != VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC &&
controller->model != VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1068 &&
controller->model != VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VMPVSCSI) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting domain XML attribute 'model' of entry "
- "'controller' to be 'buslogic' or 'lsilogic' or "
- "'lsisas1068' or 'vmpvscsi' but found '%s'"),
- virDomainControllerModelSCSITypeToString(controller->model));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting domain XML attribute 'model' of entry "
+ "'controller' to be 'buslogic' or 'lsilogic' or "
+ "'lsisas1068' or 'vmpvscsi' but found '%s'"),
+ virDomainControllerModelSCSITypeToString(controller->model));
goto cleanup;
}
int unit;
if (ctx->parseFileName == NULL) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("virVMXContext has no parseFileName function set"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("virVMXContext has no parseFileName function set"));
return NULL;
}
}
if (config_version != 8) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry 'config.version' to be 8 but found "
- "%lld"), config_version);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry 'config.version' to be 8 but found "
+ "%lld"), config_version);
goto cleanup;
}
if (virtualHW_version != 4 && virtualHW_version != 7 &&
virtualHW_version != 8) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry 'virtualHW.version' to be 4, 7 or 8 "
- "but found %lld"),
- virtualHW_version);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry 'virtualHW.version' to be 4, 7 or 8 "
+ "but found %lld"),
+ virtualHW_version);
goto cleanup;
}
if (def->name != NULL) {
if (virVMXUnescapeHexPercent(def->name) < 0 ||
virVMXUnescapeHexPipe(def->name) < 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("VMX entry 'name' contains invalid escape sequence"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("VMX entry 'name' contains invalid escape sequence"));
goto cleanup;
}
}
if (def->description != NULL) {
if (virVMXUnescapeHexPipe(def->description) < 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("VMX entry 'annotation' contains invalid escape "
- "sequence"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("VMX entry 'annotation' contains invalid escape "
+ "sequence"));
goto cleanup;
}
}
}
if (memsize <= 0 || memsize % 4 != 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry 'memsize' to be an unsigned "
- "integer (multiple of 4) but found %lld"), memsize);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry 'memsize' to be an unsigned "
+ "integer (multiple of 4) but found %lld"), memsize);
goto cleanup;
}
}
if (numvcpus <= 0 || (numvcpus % 2 != 0 && numvcpus != 1)) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry 'numvcpus' to be an unsigned "
- "integer (1 or a multiple of 2) but found %lld"), numvcpus);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry 'numvcpus' to be an unsigned "
+ "integer (1 or a multiple of 2) but found %lld"), numvcpus);
goto cleanup;
}
number = virParseNumber(¤t);
if (number < 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry 'sched.cpu.affinity' to be "
- "a comma separated list of unsigned integers but "
- "found '%s'"), sched_cpu_affinity);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry 'sched.cpu.affinity' to be "
+ "a comma separated list of unsigned integers but "
+ "found '%s'"), sched_cpu_affinity);
goto cleanup;
}
if (number >= VIR_DOMAIN_CPUMASK_LEN) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("VMX entry 'sched.cpu.affinity' contains a %d, "
- "this value is too large"), number);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("VMX entry 'sched.cpu.affinity' contains a %d, "
+ "this value is too large"), number);
goto cleanup;
}
} else if (*current == '\0') {
break;
} else {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry 'sched.cpu.affinity' to be "
- "a comma separated list of unsigned integers but "
- "found '%s'"), sched_cpu_affinity);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry 'sched.cpu.affinity' to be "
+ "a comma separated list of unsigned integers but "
+ "found '%s'"), sched_cpu_affinity);
goto cleanup;
}
}
if (count < numvcpus) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry 'sched.cpu.affinity' to contain "
- "at least as many values as 'numvcpus' (%lld) but "
- "found only %d value(s)"), numvcpus, count);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry 'sched.cpu.affinity' to contain "
+ "at least as many values as 'numvcpus' (%lld) but "
+ "found only %d value(s)"), numvcpus, count);
goto cleanup;
}
}
def->cputune.shares = def->vcpus * 2000;
} else if (virStrToLong_ul(sched_cpu_shares, NULL, 10,
&def->cputune.shares) < 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry 'sched.cpu.shares' to be an "
- "unsigned integer or 'low', 'normal' or 'high' but "
- "found '%s'"), sched_cpu_shares);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry 'sched.cpu.shares' to be an "
+ "unsigned integer or 'low', 'normal' or 'high' but "
+ "found '%s'"), sched_cpu_shares);
goto cleanup;
}
}
/* def:controllers */
if (virDomainDefAddImplicitControllers(def) < 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Could not add controllers"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Could not add controllers"));
goto cleanup;
}
if (def->controllers[controller]->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI) {
if (def->controllers[controller]->idx < 0 ||
def->controllers[controller]->idx > 3) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("SCSI controller index %d out of [0..3] range"),
- def->controllers[controller]->idx);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("SCSI controller index %d out of [0..3] range"),
+ def->controllers[controller]->idx);
goto cleanup;
}
char *listenAddr = NULL;
if (def == NULL || *def != NULL) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
char *tmp;
if (virtualDev == NULL || *virtualDev != -1) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
if (controller < 0 || controller > 3) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("SCSI controller index %d out of [0..3] range"),
- controller);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("SCSI controller index %d out of [0..3] range"),
+ controller);
return -1;
}
*virtualDev != VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC &&
*virtualDev != VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1068 &&
*virtualDev != VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VMPVSCSI)) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry '%s' to be 'buslogic' or 'lsilogic' "
- "or 'lsisas1068' or 'pvscsi' but found '%s'"),
- virtualDev_name, virtualDev_string);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry '%s' to be 'buslogic' or 'lsilogic' "
+ "or 'lsisas1068' or 'pvscsi' but found '%s'"),
+ virtualDev_name, virtualDev_string);
goto cleanup;
}
}
bool writeThrough = false;
if (def == NULL || *def != NULL) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
if (busType == VIR_DOMAIN_DISK_BUS_SCSI) {
if (controllerOrBus < 0 || controllerOrBus > 3) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("SCSI controller index %d out of [0..3] range"),
- controllerOrBus);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("SCSI controller index %d out of [0..3] range"),
+ controllerOrBus);
goto cleanup;
}
if (unit < 0 || unit > 15 || unit == 7) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("SCSI unit index %d out of [0..6,8..15] range"),
- unit);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("SCSI unit index %d out of [0..6,8..15] range"),
+ unit);
goto cleanup;
}
}
} else if (busType == VIR_DOMAIN_DISK_BUS_IDE) {
if (controllerOrBus < 0 || controllerOrBus > 1) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("IDE bus index %d out of [0..1] range"),
- controllerOrBus);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("IDE bus index %d out of [0..1] range"),
+ controllerOrBus);
goto cleanup;
}
if (unit < 0 || unit > 1) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("IDE unit index %d out of [0..1] range"), unit);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("IDE unit index %d out of [0..1] range"), unit);
goto cleanup;
}
goto cleanup;
}
} else {
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Unsupported bus type '%s' for device type '%s'"),
- virDomainDiskBusTypeToString(busType),
- virDomainDiskDeviceTypeToString(device));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported bus type '%s' for device type '%s'"),
+ virDomainDiskBusTypeToString(busType),
+ virDomainDiskDeviceTypeToString(device));
goto cleanup;
}
} else if (device == VIR_DOMAIN_DISK_DEVICE_FLOPPY) {
if (busType == VIR_DOMAIN_DISK_BUS_FDC) {
if (controllerOrBus != 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("FDC controller index %d out of [0] range"),
- controllerOrBus);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("FDC controller index %d out of [0] range"),
+ controllerOrBus);
goto cleanup;
}
if (unit < 0 || unit > 1) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("FDC unit index %d out of [0..1] range"),
- unit);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("FDC unit index %d out of [0..1] range"),
+ unit);
goto cleanup;
}
goto cleanup;
}
} else {
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Unsupported bus type '%s' for device type '%s'"),
- virDomainDiskBusTypeToString(busType),
- virDomainDiskDeviceTypeToString(device));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported bus type '%s' for device type '%s'"),
+ virDomainDiskBusTypeToString(busType),
+ virDomainDiskDeviceTypeToString(device));
goto cleanup;
}
} else {
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Unsupported device type '%s'"),
- virDomainDiskDeviceTypeToString(device));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported device type '%s'"),
+ virDomainDiskDeviceTypeToString(device));
goto cleanup;
}
if (busType == VIR_DOMAIN_DISK_BUS_SCSI &&
STRCASENEQ(deviceType, "scsi-hardDisk") &&
STRCASENEQ(deviceType, "disk")) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry '%s' to be 'scsi-hardDisk' "
- "or 'disk' but found '%s'"), deviceType_name,
- deviceType);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry '%s' to be 'scsi-hardDisk' "
+ "or 'disk' but found '%s'"), deviceType_name,
+ deviceType);
goto cleanup;
} else if (busType == VIR_DOMAIN_DISK_BUS_IDE &&
STRCASENEQ(deviceType, "ata-hardDisk") &&
STRCASENEQ(deviceType, "disk")) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry '%s' to be 'ata-hardDisk' "
- "or 'disk' but found '%s'"), deviceType_name,
- deviceType);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry '%s' to be 'ata-hardDisk' "
+ "or 'disk' but found '%s'"), deviceType_name,
+ deviceType);
goto cleanup;
}
}
*/
goto ignore;
} else {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Invalid or not yet handled value '%s' for VMX entry "
- "'%s'"), fileName, fileName_name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Invalid or not yet handled value '%s' for VMX entry "
+ "'%s'"), fileName, fileName_name);
goto cleanup;
}
} else if (device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
if (virFileHasSuffix(fileName, ".iso")) {
if (deviceType != NULL) {
if (STRCASENEQ(deviceType, "cdrom-image")) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry '%s' to be 'cdrom-image' "
- "but found '%s'"), deviceType_name, deviceType);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry '%s' to be 'cdrom-image' "
+ "but found '%s'"), deviceType_name, deviceType);
goto cleanup;
}
}
fileName = NULL;
} else {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Invalid or not yet handled value '%s' for VMX entry "
- "'%s'"), fileName, fileName_name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Invalid or not yet handled value '%s' for VMX entry "
+ "'%s'"), fileName, fileName_name);
goto cleanup;
}
} else if (device == VIR_DOMAIN_DISK_DEVICE_FLOPPY) {
if (virFileHasSuffix(fileName, ".flp")) {
if (fileType != NULL) {
if (STRCASENEQ(fileType, "file")) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry '%s' to be 'file' but "
- "found '%s'"), fileType_name, fileType);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry '%s' to be 'file' but "
+ "found '%s'"), fileType_name, fileType);
goto cleanup;
}
}
fileName = NULL;
} else {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Invalid or not yet handled value '%s' for VMX entry "
- "'%s'"), fileName, fileName_name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Invalid or not yet handled value '%s' for VMX entry "
+ "'%s'"), fileName, fileName_name);
goto cleanup;
}
} else {
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED, _("Unsupported device type '%s'"),
- virDomainDiskDeviceTypeToString(device));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Unsupported device type '%s'"),
+ virDomainDiskDeviceTypeToString(device));
goto cleanup;
}
if (virDomainDiskDefAssignAddress(caps, *def) < 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not assign address to disk '%s'"), (*def)->src);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not assign address to disk '%s'"), (*def)->src);
goto cleanup;
}
char *networkName = NULL;
if (def == NULL || *def != NULL) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
if (controller < 0 || controller > 3) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Ethernet controller index %d out of [0..3] range"),
- controller);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Ethernet controller index %d out of [0..3] range"),
+ controller);
return -1;
}
STRCASEEQ(addressType, "vpx")) {
if (generatedAddress != NULL) {
if (virMacAddrParse(generatedAddress, &(*def)->mac) < 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry '%s' to be MAC address but "
- "found '%s'"), generatedAddress_name,
- generatedAddress);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry '%s' to be MAC address but "
+ "found '%s'"), generatedAddress_name,
+ generatedAddress);
goto cleanup;
}
}
} else if (STRCASEEQ(addressType, "static")) {
if (address != NULL) {
if (virMacAddrParse(address, &(*def)->mac) < 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry '%s' to be MAC address but "
- "found '%s'"), address_name, address);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry '%s' to be MAC address but "
+ "found '%s'"), address_name, address);
goto cleanup;
}
}
} else {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry '%s' to be 'generated' or 'static' or "
- "'vpx' but found '%s'"), addressType_name, addressType);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry '%s' to be 'generated' or 'static' or "
+ "'vpx' but found '%s'"), addressType_name, addressType);
goto cleanup;
}
STRCASENEQ(virtualDev, "vmxnet") &&
STRCASENEQ(virtualDev, "vmxnet3") &&
STRCASENEQ(virtualDev, "e1000")) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry '%s' to be 'vlance' or 'vmxnet' or "
- "'vmxnet3' or 'e1000' but found '%s'"), virtualDev_name,
- virtualDev);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry '%s' to be 'vlance' or 'vmxnet' or "
+ "'vmxnet3' or 'e1000' but found '%s'"), virtualDev_name,
+ virtualDev);
goto cleanup;
}
networkName = NULL;
} else if (STRCASEEQ(connectionType, "hostonly")) {
/* FIXME */
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("No yet handled value '%s' for VMX entry '%s'"),
- connectionType, connectionType_name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("No yet handled value '%s' for VMX entry '%s'"),
+ connectionType, connectionType_name);
goto cleanup;
} else if (STRCASEEQ(connectionType, "nat")) {
(*def)->type = VIR_DOMAIN_NET_TYPE_USER;
networkName = NULL;
vnet = NULL;
} else {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Invalid value '%s' for VMX entry '%s'"), connectionType,
- connectionType_name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Invalid value '%s' for VMX entry '%s'"), connectionType,
+ connectionType_name);
goto cleanup;
}
virURIPtr parsedUri = NULL;
if (def == NULL || *def != NULL) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
if (port < 0 || port > 3) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Serial port index %d out of [0..3] range"), port);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Serial port index %d out of [0..3] range"), port);
return -1;
}
goto cleanup;
if (parsedUri->port == 0) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("VMX entry '%s' doesn't contain a port part"),
- fileName_name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("VMX entry '%s' doesn't contain a port part"),
+ fileName_name);
goto cleanup;
}
STRCASEEQ(parsedUri->scheme, "tcp6+ssl")) {
(*def)->source.data.tcp.protocol = VIR_DOMAIN_CHR_TCP_PROTOCOL_TLS;
} else {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("VMX entry '%s' contains unsupported scheme '%s'"),
- fileName_name, parsedUri->scheme);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("VMX entry '%s' contains unsupported scheme '%s'"),
+ fileName_name, parsedUri->scheme);
goto cleanup;
}
} else if (STRCASEEQ(network_endPoint, "client")) {
(*def)->source.data.tcp.listen = false;
} else {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry '%s' to be 'server' or 'client' "
- "but found '%s'"), network_endPoint_name, network_endPoint);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry '%s' to be 'server' or 'client' "
+ "but found '%s'"), network_endPoint_name, network_endPoint);
goto cleanup;
}
} else {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry '%s' to be 'device', 'file' or 'pipe' "
- "or 'network' but found '%s'"), fileType_name, fileType);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry '%s' to be 'device', 'file' or 'pipe' "
+ "or 'network' but found '%s'"), fileType_name, fileType);
goto cleanup;
}
char *fileName = NULL;
if (def == NULL || *def != NULL) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
if (port < 0 || port > 2) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Parallel port index %d out of [0..2] range"), port);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Parallel port index %d out of [0..2] range"), port);
return -1;
}
goto cleanup;
}
} else {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry '%s' to be 'device' or 'file' but "
- "found '%s'"), fileType_name, fileType);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VMX entry '%s' to be 'device' or 'file' but "
+ "found '%s'"), fileType_name, fileType);
goto cleanup;
}
long long svga_vramSize = 0;
if (def == NULL || *def != NULL) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
bool floppy_present[2] = { false, false };
if (ctx->formatFileName == NULL) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("virVMXContext has no formatFileName function set"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("virVMXContext has no formatFileName function set"));
return NULL;
}
memset(zero, 0, VIR_UUID_BUFLEN);
if (def->virtType != VIR_DOMAIN_VIRT_VMWARE) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting virt type to be '%s' but found '%s'"),
- virDomainVirtTypeToString(VIR_DOMAIN_VIRT_VMWARE),
- virDomainVirtTypeToString(def->virtType));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting virt type to be '%s' but found '%s'"),
+ virDomainVirtTypeToString(VIR_DOMAIN_VIRT_VMWARE),
+ virDomainVirtTypeToString(def->virtType));
return NULL;
}
} else if (STRCASEEQ(def->os.arch, "x86_64")) {
virBufferAddLit(&buffer, "guestOS = \"other-64\"\n");
} else {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting domain XML attribute 'arch' of entry 'os/type' "
- "to be 'i686' or 'x86_64' but found '%s'"), def->os.arch);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting domain XML attribute 'arch' of entry 'os/type' "
+ "to be 'i686' or 'x86_64' but found '%s'"), def->os.arch);
goto cleanup;
}
} else if (def->os.smbios_mode == VIR_DOMAIN_SMBIOS_HOST) {
virBufferAddLit(&buffer, "smbios.reflecthost = \"true\"\n");
} else {
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Unsupported SMBIOS mode '%s'"),
- virDomainSmbiosModeTypeToString(def->os.smbios_mode));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported SMBIOS mode '%s'"),
+ virDomainSmbiosModeTypeToString(def->os.smbios_mode));
goto cleanup;
}
/* def:maxvcpus -> vmx:numvcpus */
if (def->vcpus != def->maxvcpus) {
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("No support for domain XML entry 'vcpu' attribute "
- "'current'"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("No support for domain XML entry 'vcpu' attribute "
+ "'current'"));
goto cleanup;
}
if (def->maxvcpus <= 0 || (def->maxvcpus % 2 != 0 && def->maxvcpus != 1)) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting domain XML entry 'vcpu' to be an unsigned "
- "integer (1 or a multiple of 2) but found %d"),
- def->maxvcpus);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting domain XML entry 'vcpu' to be an unsigned "
+ "integer (1 or a multiple of 2) but found %d"),
+ def->maxvcpus);
goto cleanup;
}
}
if (sched_cpu_affinity_length < def->maxvcpus) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting domain XML attribute 'cpuset' of entry "
- "'vcpu' to contain at least %d CPU(s)"),
- def->maxvcpus);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting domain XML attribute 'cpuset' of entry "
+ "'vcpu' to contain at least %d CPU(s)"),
+ def->maxvcpus);
goto cleanup;
}
break;
default:
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Unsupported graphics type '%s'"),
- virDomainGraphicsTypeToString(def->graphics[i]->type));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported graphics type '%s'"),
+ virDomainGraphicsTypeToString(def->graphics[i]->type));
goto cleanup;
}
}
break;
default:
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Unsupported disk device type '%s'"),
- virDomainDiskDeviceTypeToString(def->disks[i]->device));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported disk device type '%s'"),
+ virDomainDiskDeviceTypeToString(def->disks[i]->device));
goto cleanup;
}
}
/* def:videos */
if (def->nvideos > 0) {
if (def->nvideos > 1) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("No support for multiple video devices"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("No support for multiple video devices"));
goto cleanup;
}
const char *listenAddr;
if (def->type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
char *fileName = NULL;
if (def->device != VIR_DOMAIN_DISK_DEVICE_DISK) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
return -1;
}
} else {
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Unsupported bus type '%s' for harddisk"),
- virDomainDiskBusTypeToString(def->bus));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported bus type '%s' for harddisk"),
+ virDomainDiskBusTypeToString(def->bus));
return -1;
}
if (def->type != VIR_DOMAIN_DISK_TYPE_FILE) {
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
- _("%s harddisk '%s' has unsupported type '%s', expecting '%s'"),
- busName, def->dst, virDomainDiskTypeToString(def->type),
- virDomainDiskTypeToString(VIR_DOMAIN_DISK_TYPE_FILE));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("%s harddisk '%s' has unsupported type '%s', expecting '%s'"),
+ busName, def->dst, virDomainDiskTypeToString(def->type),
+ virDomainDiskTypeToString(VIR_DOMAIN_DISK_TYPE_FILE));
return -1;
}
if (def->src != NULL) {
if (! virFileHasSuffix(def->src, ".vmdk")) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Image file for %s harddisk '%s' has unsupported suffix, "
- "expecting '.vmdk'"), busName, def->dst);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Image file for %s harddisk '%s' has unsupported suffix, "
+ "expecting '.vmdk'"), busName, def->dst);
return -1;
}
virBufferAsprintf(buffer, "%s%d:%d.writeThrough = \"true\"\n",
entryPrefix, controllerOrBus, unit);
} else if (def->cachemode != VIR_DOMAIN_DISK_CACHE_DEFAULT) {
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
- _("%s harddisk '%s' has unsupported cache mode '%s'"),
- busName, def->dst,
- virDomainDiskCacheTypeToString(def->cachemode));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("%s harddisk '%s' has unsupported cache mode '%s'"),
+ busName, def->dst,
+ virDomainDiskCacheTypeToString(def->cachemode));
return -1;
}
}
char *fileName = NULL;
if (def->device != VIR_DOMAIN_DISK_DEVICE_CDROM) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
return -1;
}
} else {
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Unsupported bus type '%s' for cdrom"),
- virDomainDiskBusTypeToString(def->bus));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported bus type '%s' for cdrom"),
+ virDomainDiskBusTypeToString(def->bus));
return -1;
}
if (def->src != NULL) {
if (! virFileHasSuffix(def->src, ".iso")) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Image file for %s cdrom '%s' has unsupported "
- "suffix, expecting '.iso'"), busName, def->dst);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Image file for %s cdrom '%s' has unsupported "
+ "suffix, expecting '.iso'"), busName, def->dst);
return -1;
}
entryPrefix, controllerOrBus, unit, def->src);
}
} else {
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
- _("%s cdrom '%s' has unsupported type '%s', expecting '%s' "
- "or '%s'"), busName, def->dst,
- virDomainDiskTypeToString(def->type),
- virDomainDiskTypeToString(VIR_DOMAIN_DISK_TYPE_FILE),
- virDomainDiskTypeToString(VIR_DOMAIN_DISK_TYPE_BLOCK));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("%s cdrom '%s' has unsupported type '%s', expecting '%s' "
+ "or '%s'"), busName, def->dst,
+ virDomainDiskTypeToString(def->type),
+ virDomainDiskTypeToString(VIR_DOMAIN_DISK_TYPE_FILE),
+ virDomainDiskTypeToString(VIR_DOMAIN_DISK_TYPE_BLOCK));
return -1;
}
char *fileName = NULL;
if (def->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
if (def->src != NULL) {
if (! virFileHasSuffix(def->src, ".flp")) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Image file for floppy '%s' has unsupported "
- "suffix, expecting '.flp'"), def->dst);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Image file for floppy '%s' has unsupported "
+ "suffix, expecting '.flp'"), def->dst);
return -1;
}
unit, def->src);
}
} else {
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Floppy '%s' has unsupported type '%s', expecting '%s' "
- "or '%s'"), def->dst,
- virDomainDiskTypeToString(def->type),
- virDomainDiskTypeToString(VIR_DOMAIN_DISK_TYPE_FILE),
- virDomainDiskTypeToString(VIR_DOMAIN_DISK_TYPE_BLOCK));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Floppy '%s' has unsupported type '%s', expecting '%s' "
+ "or '%s'"), def->dst,
+ virDomainDiskTypeToString(def->type),
+ virDomainDiskTypeToString(VIR_DOMAIN_DISK_TYPE_FILE),
+ virDomainDiskTypeToString(VIR_DOMAIN_DISK_TYPE_BLOCK));
return -1;
}
unsigned int prefix, suffix;
if (controller < 0 || controller > 3) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Ethernet controller index %d out of [0..3] range"),
- controller);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Ethernet controller index %d out of [0..3] range"),
+ controller);
return -1;
}
STRCASENEQ(def->model, "vmxnet2") &&
STRCASENEQ(def->model, "vmxnet3") &&
STRCASENEQ(def->model, "e1000")) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting domain XML entry 'devices/interface/model' "
- "to be 'vlance' or 'vmxnet' or 'vmxnet2' or 'vmxnet3' "
- "or 'e1000' but found '%s'"), def->model);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting domain XML entry 'devices/interface/model' "
+ "to be 'vlance' or 'vmxnet' or 'vmxnet2' or 'vmxnet3' "
+ "or 'e1000' but found '%s'"), def->model);
return -1;
}
break;
default:
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED, _("Unsupported net type '%s'"),
- virDomainNetTypeToString(def->type));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Unsupported net type '%s'"),
+ virDomainNetTypeToString(def->type));
return -1;
}
const char *protocol;
if (def->target.port < 0 || def->target.port > 3) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Serial port index %d out of [0..3] range"),
- def->target.port);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Serial port index %d out of [0..3] range"),
+ def->target.port);
return -1;
}
break;
default:
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Unsupported character device TCP protocol '%s'"),
- virDomainChrTcpProtocolTypeToString(
- def->source.data.tcp.protocol));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported character device TCP protocol '%s'"),
+ virDomainChrTcpProtocolTypeToString(
+ def->source.data.tcp.protocol));
return -1;
}
break;
default:
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Unsupported character device type '%s'"),
- virDomainChrTypeToString(def->source.type));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported character device type '%s'"),
+ virDomainChrTypeToString(def->source.type));
return -1;
}
char *fileName = NULL;
if (def->target.port < 0 || def->target.port > 2) {
- VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Parallel port index %d out of [0..2] range"),
- def->target.port);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Parallel port index %d out of [0..2] range"),
+ def->target.port);
return -1;
}
break;
default:
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Unsupported character device type '%s'"),
- virDomainChrTypeToString(def->source.type));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported character device type '%s'"),
+ virDomainChrTypeToString(def->source.type));
return -1;
}
unsigned long long vram;
if (def->type != VIR_DOMAIN_VIDEO_TYPE_VMVGA) {
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Unsupported video device type '%s'"),
- virDomainVideoTypeToString(def->type));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported video device type '%s'"),
+ virDomainVideoTypeToString(def->type));
return -1;
}
vram = VIR_DIV_UP(def->vram, 64) * 64;
if (def->heads > 1) {
- VMX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Multi-head video devices are unsupported"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Multi-head video devices are unsupported"));
return -1;
}