unsigned int j;
if (arch == NULL) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("undefined hardware architecture"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("undefined hardware architecture"));
return NULL;
}
goto cleanup;
if (!cpu->model) {
- virCPUReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("no CPU model specified"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("no CPU model specified"));
goto cleanup;
}
return VIR_CPU_COMPARE_ERROR;
if (driver->compare == NULL) {
- virCPUReportError(VIR_ERR_NO_SUPPORT,
- _("cannot compare CPUs of %s architecture"),
- host->arch);
+ virReportError(VIR_ERR_NO_SUPPORT,
+ _("cannot compare CPUs of %s architecture"),
+ host->arch);
return VIR_CPU_COMPARE_ERROR;
}
}
if (models == NULL && nmodels != 0) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("nonzero nmodels doesn't match with NULL models"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("nonzero nmodels doesn't match with NULL models"));
return -1;
}
if (cpu == NULL) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("invalid CPU definition"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("invalid CPU definition"));
return -1;
}
return -1;
if (driver->decode == NULL) {
- virCPUReportError(VIR_ERR_NO_SUPPORT,
- _("cannot decode CPU data for %s architecture"),
- cpu->arch);
+ virReportError(VIR_ERR_NO_SUPPORT,
+ _("cannot decode CPU data for %s architecture"),
+ cpu->arch);
return -1;
}
return -1;
if (driver->encode == NULL) {
- virCPUReportError(VIR_ERR_NO_SUPPORT,
- _("cannot encode CPU data for %s architecture"),
- arch);
+ virReportError(VIR_ERR_NO_SUPPORT,
+ _("cannot encode CPU data for %s architecture"),
+ arch);
return -1;
}
return;
if (driver->free == NULL) {
- virCPUReportError(VIR_ERR_NO_SUPPORT,
- _("cannot free CPU data for %s architecture"),
- arch);
+ virReportError(VIR_ERR_NO_SUPPORT,
+ _("cannot free CPU data for %s architecture"),
+ arch);
return;
}
return NULL;
if (driver->nodeData == NULL) {
- virCPUReportError(VIR_ERR_NO_SUPPORT,
- _("cannot get node CPU data for %s architecture"),
- arch);
+ virReportError(VIR_ERR_NO_SUPPORT,
+ _("cannot get node CPU data for %s architecture"),
+ arch);
return NULL;
}
return VIR_CPU_COMPARE_ERROR;
if (driver->guestData == NULL) {
- virCPUReportError(VIR_ERR_NO_SUPPORT,
- _("cannot compute guest CPU data for %s architecture"),
- host->arch);
+ virReportError(VIR_ERR_NO_SUPPORT,
+ _("cannot compute guest CPU data for %s architecture"),
+ host->arch);
return VIR_CPU_COMPARE_ERROR;
}
}
if (xmlCPUs == NULL && ncpus != 0) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("nonzero ncpus doesn't match with NULL xmlCPUs"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("nonzero ncpus doesn't match with NULL xmlCPUs"));
return NULL;
}
if (ncpus < 1) {
- virCPUReportError(VIR_ERR_INVALID_ARG, "%s", _("No CPUs given"));
+ virReportError(VIR_ERR_INVALID_ARG, "%s", _("No CPUs given"));
return NULL;
}
}
if (cpus == NULL && ncpus != 0) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("nonzero ncpus doesn't match with NULL cpus"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("nonzero ncpus doesn't match with NULL cpus"));
return NULL;
}
if (ncpus < 1) {
- virCPUReportError(VIR_ERR_INVALID_ARG, "%s", _("No CPUs given"));
+ virReportError(VIR_ERR_INVALID_ARG, "%s", _("No CPUs given"));
return NULL;
}
if (models == NULL && nmodels != 0) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("nonzero nmodels doesn't match with NULL models"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("nonzero nmodels doesn't match with NULL models"));
return NULL;
}
return NULL;
if (driver->baseline == NULL) {
- virCPUReportError(VIR_ERR_NO_SUPPORT,
- _("cannot compute baseline CPU of %s architecture"),
- cpus[0]->arch);
+ virReportError(VIR_ERR_NO_SUPPORT,
+ _("cannot compute baseline CPU of %s architecture"),
+ cpus[0]->arch);
return NULL;
}
return -1;
if (driver->update == NULL) {
- virCPUReportError(VIR_ERR_NO_SUPPORT,
- _("cannot update guest CPU data for %s architecture"),
- host->arch);
+ virReportError(VIR_ERR_NO_SUPPORT,
+ _("cannot update guest CPU data for %s architecture"),
+ host->arch);
return -1;
}
return -1;
if (driver->hasFeature == NULL) {
- virCPUReportError(VIR_ERR_NO_SUPPORT,
- _("cannot check guest CPU data for %s architecture"),
- arch);
+ virReportError(VIR_ERR_NO_SUPPORT,
+ _("cannot check guest CPU data for %s architecture"),
+ arch);
return -1;
}
vendor->name = virXPathString("string(@name)", ctxt);
if (!vendor->name) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Missing CPU vendor name"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Missing CPU vendor name"));
goto ignore;
}
if (x86VendorFind(map, vendor->name)) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("CPU vendor %s already defined"), vendor->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("CPU vendor %s already defined"), vendor->name);
goto ignore;
}
string = virXPathString("string(@string)", ctxt);
if (!string) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("Missing vendor string for CPU vendor %s"), vendor->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Missing vendor string for CPU vendor %s"), vendor->name);
goto ignore;
}
if (strlen(string) != VENDOR_STRING_LENGTH) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("Invalid CPU vendor string '%s'"), string);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Invalid CPU vendor string '%s'"), string);
goto ignore;
}
feature->name = virXPathString("string(@name)", ctxt);
if (feature->name == NULL) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Missing CPU feature name"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Missing CPU feature name"));
goto ignore;
}
if (x86FeatureFind(map, feature->name)) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("CPU feature %s already defined"), feature->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("CPU feature %s already defined"), feature->name);
goto ignore;
}
if (ret_fun < 0 || ret_eax == -2 || ret_ebx == -2
|| ret_ecx == -2 || ret_edx == -2) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("Invalid cpuid[%d] in %s feature"), i, feature->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Invalid cpuid[%d] in %s feature"), i, feature->name);
goto ignore;
}
if (policy == VIR_CPU_FEATURE_REQUIRE) {
if ((model = x86ModelFind(map, cpu->model)) == NULL) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unknown CPU model %s"), cpu->model);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unknown CPU model %s"), cpu->model);
goto error;
}
continue;
if ((feature = x86FeatureFind(map, cpu->features[i].name)) == NULL) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unknown CPU feature %s"), cpu->features[i].name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unknown CPU feature %s"), cpu->features[i].name);
goto error;
}
unsigned int i;
if (!(cpu_model = x86ModelFind(map, cpu->model))) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unknown CPU model %s"),
- cpu->model);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unknown CPU model %s"),
+ cpu->model);
return -1;
}
const struct x86_feature *feature;
if (!(feature = x86FeatureFind(map, cpu->features[i].name))) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unknown CPU feature %s"),
- cpu->features[i].name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unknown CPU feature %s"),
+ cpu->features[i].name);
return -1;
}
model->name = virXPathString("string(@name)", ctxt);
if (model->name == NULL) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Missing CPU model name"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Missing CPU model name"));
goto ignore;
}
name = virXPathString("string(./model/@name)", ctxt);
if (name == NULL) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("Missing ancestor's name in CPU model %s"),
- model->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Missing ancestor's name in CPU model %s"),
+ model->name);
goto ignore;
}
if ((ancestor = x86ModelFind(map, name)) == NULL) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("Ancestor model %s not found for CPU model %s"),
- name, model->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Ancestor model %s not found for CPU model %s"),
+ name, model->name);
VIR_FREE(name);
goto ignore;
}
if (virXPathBoolean("boolean(./vendor)", ctxt)) {
vendor = virXPathString("string(./vendor/@name)", ctxt);
if (!vendor) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("Invalid vendor element in CPU model %s"),
- model->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Invalid vendor element in CPU model %s"),
+ model->name);
goto ignore;
}
if (!(model->vendor = x86VendorFind(map, vendor))) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unknown vendor %s referenced by CPU model %s"),
- vendor, model->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unknown vendor %s referenced by CPU model %s"),
+ vendor, model->name);
goto ignore;
}
}
char *name;
if ((name = virXMLPropString(nodes[i], "name")) == NULL) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("Missing feature name for CPU model %s"), model->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Missing feature name for CPU model %s"), model->name);
goto ignore;
}
if ((feature = x86FeatureFind(map, name)) == NULL) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("Feature %s required by CPU model %s not found"),
- name, model->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Feature %s required by CPU model %s not found"),
+ name, model->name);
VIR_FREE(name);
goto ignore;
}
if (!allowed) {
if (preferred && STREQ(candidate->name, preferred)) {
if (cpu->fallback != VIR_CPU_FALLBACK_ALLOW) {
- virCPUReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("CPU model %s is not supported by hypervisor"),
- preferred);
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("CPU model %s is not supported by hypervisor"),
+ preferred);
goto out;
} else {
VIR_WARN("Preferred CPU model %s not allowed by"
}
if (cpuModel == NULL) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Cannot find suitable CPU model for given data"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Cannot find suitable CPU model for given data"));
goto out;
}
const struct x86_vendor *v = NULL;
if (cpu->vendor && !(v = x86VendorFind(map, cpu->vendor))) {
- virCPUReportError(VIR_ERR_OPERATION_FAILED,
- _("CPU vendor %s not found"), cpu->vendor);
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("CPU vendor %s not found"), cpu->vendor);
goto error;
}
if (!cpus[0]->vendor)
outputVendor = false;
else if (!(vendor = x86VendorFind(map, cpus[0]->vendor))) {
- virCPUReportError(VIR_ERR_OPERATION_FAILED,
- _("Unknown CPU vendor %s"), cpus[0]->vendor);
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("Unknown CPU vendor %s"), cpus[0]->vendor);
goto error;
}
if (cpus[i]->vendor && model->vendor &&
STRNEQ(cpus[i]->vendor, model->vendor->name)) {
- virCPUReportError(VIR_ERR_OPERATION_FAILED,
- _("CPU vendor %s of model %s differs from vendor %s"),
- model->vendor->name, model->name, cpus[i]->vendor);
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("CPU vendor %s of model %s differs from vendor %s"),
+ model->vendor->name, model->name, cpus[i]->vendor);
goto error;
}
if (vn) {
if (!vendor) {
if (!(vendor = x86VendorFind(map, vn))) {
- virCPUReportError(VIR_ERR_OPERATION_FAILED,
- _("Unknown CPU vendor %s"), vn);
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("Unknown CPU vendor %s"), vn);
goto error;
}
} else if (STRNEQ(vendor->name, vn)) {
- virCPUReportError(VIR_ERR_OPERATION_FAILED,
- "%s", _("CPU vendors do not match"));
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ "%s", _("CPU vendors do not match"));
goto error;
}
}
}
if (x86DataIsEmpty(base_model->data)) {
- virCPUReportError(VIR_ERR_OPERATION_FAILED,
- "%s", _("CPUs are incompatible"));
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ "%s", _("CPUs are incompatible"));
goto error;
}
if (guest->features[i].policy == VIR_CPU_FEATURE_OPTIONAL) {
const struct x86_feature *feature;
if (!(feature = x86FeatureFind(map, guest->features[i].name))) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unknown CPU feature %s"),
- guest->features[i].name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unknown CPU feature %s"),
+ guest->features[i].name);
goto cleanup;
}
break;
}
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unexpected CPU mode: %d"), guest->mode);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unexpected CPU mode: %d"), guest->mode);
return -1;
}