qemu: Move error messages onto a single line

Error messages are exempt from the 80 columns rule. Move them
onto one line.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Michal Privoznik 2023-08-24 17:03:58 +02:00
parent ab20f75345
commit 895525db81
17 changed files with 243 additions and 493 deletions

View File

@ -160,8 +160,7 @@ qemuAgentOpenUnix(const char *socketpath)
if (virSetCloseExec(agentfd) < 0) { if (virSetCloseExec(agentfd) < 0) {
virReportSystemError(errno, "%s", virReportSystemError(errno, "%s",
_("Unable to set agent " _("Unable to set agent close-on-exec flag"));
"close-on-exec flag"));
goto error; goto error;
} }
@ -757,8 +756,7 @@ static int qemuAgentSend(qemuAgent *agent,
ret = -2; ret = -2;
} else { } else {
virReportSystemError(errno, "%s", virReportSystemError(errno, "%s",
_("Unable to wait on agent socket " _("Unable to wait on agent socket condition"));
"condition"));
} }
agent->inSync = false; agent->inSync = false;
goto cleanup; goto cleanup;
@ -1344,8 +1342,7 @@ qemuAgentGetVCPUs(qemuAgent *agent,
if (!entry) { if (!entry) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("array element missing in guest-get-vcpus return " _("array element missing in guest-get-vcpus return value"));
"value"));
return -1; return -1;
} }
@ -1862,8 +1859,7 @@ qemuAgentGetFSInfo(qemuAgent *agent,
if (!(result = virJSONValueObjectGetString(entry, "mountpoint"))) { if (!(result = virJSONValueObjectGetString(entry, "mountpoint"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("'mountpoint' missing in reply of " _("'mountpoint' missing in reply of guest-get-fsinfo"));
"guest-get-fsinfo"));
goto cleanup; goto cleanup;
} }
@ -2207,8 +2203,7 @@ qemuAgentGetUsers(qemuAgent *agent,
if (!entry) { if (!entry) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("array element missing in guest-get-users return " _("array element missing in guest-get-users return value"));
"value"));
return -1; return -1;
} }
@ -2522,8 +2517,7 @@ int qemuAgentGetDisks(qemuAgent *agent,
if (!entry) { if (!entry) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("array element missing in guest-get-disks return " _("array element missing in guest-get-disks return value"));
"value"));
goto error; goto error;
} }

View File

@ -3956,8 +3956,7 @@ virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsAccel *caps,
if (!(hostCPU->name = virXMLPropString(hostCPUNode, "model"))) { if (!(hostCPU->name = virXMLPropString(hostCPUNode, "model"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("missing host CPU model name in QEMU " _("missing host CPU model name in QEMU capabilities cache"));
"capabilities cache"));
return -1; return -1;
} }
@ -3982,16 +3981,14 @@ virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsAccel *caps,
if (!(prop->name = virXMLPropString(ctxt->node, "name"))) { if (!(prop->name = virXMLPropString(ctxt->node, "name"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("missing 'name' attribute for a host CPU" _("missing 'name' attribute for a host CPU model property in QEMU capabilities cache"));
" model property in QEMU capabilities cache"));
return -1; return -1;
} }
if (!(type = virXMLPropString(ctxt->node, "type")) || if (!(type = virXMLPropString(ctxt->node, "type")) ||
(val = qemuMonitorCPUPropertyTypeFromString(type)) < 0) { (val = qemuMonitorCPUPropertyTypeFromString(type)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("missing or invalid CPU model property type " _("missing or invalid CPU model property type in QEMU capabilities cache"));
"in QEMU capabilities cache"));
return -1; return -1;
} }
@ -4108,8 +4105,7 @@ virQEMUCapsLoadCPUModels(virArch arch,
for (j = 0; j < nblockers; j++) { for (j = 0; j < nblockers; j++) {
if (!(cpu->blockers[j] = virXMLPropString(blockerNodes[j], "name"))) { if (!(cpu->blockers[j] = virXMLPropString(blockerNodes[j], "name"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("missing blocker name in QEMU " _("missing blocker name in QEMU capabilities cache"));
"capabilities cache"));
return -1; return -1;
} }
@ -4253,8 +4249,7 @@ virQEMUCapsParseSEVInfo(virQEMUCaps *qemuCaps, xmlXPathContextPtr ctxt)
if (virXPathBoolean("boolean(./sev)", ctxt) == 0) { if (virXPathBoolean("boolean(./sev)", ctxt) == 0) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("missing SEV platform data in QEMU " _("missing SEV platform data in QEMU capabilities cache"));
"capabilities cache"));
return -1; return -1;
} }
@ -4262,30 +4257,26 @@ virQEMUCapsParseSEVInfo(virQEMUCaps *qemuCaps, xmlXPathContextPtr ctxt)
if (virXPathUInt("string(./sev/cbitpos)", ctxt, &sev->cbitpos) < 0) { if (virXPathUInt("string(./sev/cbitpos)", ctxt, &sev->cbitpos) < 0) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("missing or malformed SEV cbitpos information " _("missing or malformed SEV cbitpos information in QEMU capabilities cache"));
"in QEMU capabilities cache"));
return -1; return -1;
} }
if (virXPathUInt("string(./sev/reducedPhysBits)", ctxt, if (virXPathUInt("string(./sev/reducedPhysBits)", ctxt,
&sev->reduced_phys_bits) < 0) { &sev->reduced_phys_bits) < 0) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("missing or malformed SEV reducedPhysBits information " _("missing or malformed SEV reducedPhysBits information in QEMU capabilities cache"));
"in QEMU capabilities cache"));
return -1; return -1;
} }
if (!(sev->pdh = virXPathString("string(./sev/pdh)", ctxt))) { if (!(sev->pdh = virXPathString("string(./sev/pdh)", ctxt))) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("missing SEV pdh information " _("missing SEV pdh information in QEMU capabilities cache"));
"in QEMU capabilities cache"));
return -1; return -1;
} }
if (!(sev->cert_chain = virXPathString("string(./sev/certChain)", ctxt))) { if (!(sev->cert_chain = virXPathString("string(./sev/certChain)", ctxt))) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("missing SEV certChain information " _("missing SEV certChain information in QEMU capabilities cache"));
"in QEMU capabilities cache"));
return -1; return -1;
} }
@ -4506,28 +4497,24 @@ virQEMUCapsParseGIC(virQEMUCaps *qemuCaps, xmlXPathContextPtr ctxt)
if (!(version = virXMLPropString(nodes[i], "version"))) { if (!(version = virXMLPropString(nodes[i], "version"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("missing GIC version " _("missing GIC version in QEMU capabilities cache"));
"in QEMU capabilities cache"));
return -1; return -1;
} }
if (virStrToLong_ui(version, NULL, 10, &uintValue) < 0) { if (virStrToLong_ui(version, NULL, 10, &uintValue) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("malformed GIC version " _("malformed GIC version in QEMU capabilities cache"));
"in QEMU capabilities cache"));
return -1; return -1;
} }
cap->version = uintValue; cap->version = uintValue;
if (!(kernel = virXMLPropString(nodes[i], "kernel"))) { if (!(kernel = virXMLPropString(nodes[i], "kernel"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("missing in-kernel GIC information " _("missing in-kernel GIC information in QEMU capabilities cache"));
"in QEMU capabilities cache"));
return -1; return -1;
} }
if (!(boolValue = STREQ(kernel, "yes")) && STRNEQ(kernel, "no")) { if (!(boolValue = STREQ(kernel, "yes")) && STRNEQ(kernel, "no")) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("malformed in-kernel GIC information " _("malformed in-kernel GIC information in QEMU capabilities cache"));
"in QEMU capabilities cache"));
return -1; return -1;
} }
if (boolValue) if (boolValue)
@ -4535,14 +4522,12 @@ virQEMUCapsParseGIC(virQEMUCaps *qemuCaps, xmlXPathContextPtr ctxt)
if (!(emulated = virXMLPropString(nodes[i], "emulated"))) { if (!(emulated = virXMLPropString(nodes[i], "emulated"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("missing emulated GIC information " _("missing emulated GIC information in QEMU capabilities cache"));
"in QEMU capabilities cache"));
return -1; return -1;
} }
if (!(boolValue = STREQ(emulated, "yes")) && STRNEQ(emulated, "no")) { if (!(boolValue = STREQ(emulated, "yes")) && STRNEQ(emulated, "no")) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("malformed emulated GIC information " _("malformed emulated GIC information in QEMU capabilities cache"));
"in QEMU capabilities cache"));
return -1; return -1;
} }
if (boolValue) if (boolValue)

View File

@ -2912,8 +2912,7 @@ qemuBuildLegacyUSBControllerCommandLine(virCommand *cmd,
if (nlegacy > 1) { if (nlegacy > 1) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Multiple legacy USB controllers are " _("Multiple legacy USB controllers are not supported"));
"not supported"));
return -1; return -1;
} }
@ -3124,9 +3123,8 @@ qemuBuildMemoryGetDefaultPagesize(virQEMUDriverConfig *cfg,
virHugeTLBFS *p; virHugeTLBFS *p;
if (!cfg->nhugetlbfs) { if (!cfg->nhugetlbfs) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
"%s", _("hugetlbfs filesystem is not mounted " _("hugetlbfs filesystem is not mounted or disabled by administrator config"));
"or disabled by administrator config"));
return -1; return -1;
} }
@ -3484,8 +3482,7 @@ qemuBuildMemoryBackendProps(virJSONValue **backendProps,
mem->source.nvdimm.pmem) { mem->source.nvdimm.pmem) {
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE_PMEM)) { if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE_PMEM)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("nvdimm pmem property is not available " _("nvdimm pmem property is not available with this QEMU binary"));
"with this QEMU binary"));
return -1; return -1;
} }
if (virJSONValueObjectAdd(&props, "b:pmem", true, NULL) < 0) if (virJSONValueObjectAdd(&props, "b:pmem", true, NULL) < 0)
@ -5749,8 +5746,7 @@ qemuBuildSmbiosCommandLine(virCommand *cmd,
if (source->nbaseBoard > 1) { if (source->nbaseBoard > 1) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("qemu does not support more than " _("qemu does not support more than one entry to Type 2 in SMBIOS table"));
"one entry to Type 2 in SMBIOS table"));
return -1; return -1;
} }
@ -6244,8 +6240,7 @@ qemuBuildGlobalControllerCommandLine(virCommand *cmd,
default: default:
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("64-bit PCI hole setting is only for root" _("64-bit PCI hole setting is only for root PCI controllers"));
" PCI controllers"));
return -1; return -1;
} }
@ -6784,8 +6779,7 @@ qemuAppendDomainFeaturesMachineParam(virBuffer *buf,
case VIR_GIC_VERSION_HOST: case VIR_GIC_VERSION_HOST:
if (!hasGICVersionOption) { if (!hasGICVersionOption) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("gic-version option is not available " _("gic-version option is not available with this QEMU binary"));
"with this QEMU binary"));
return -1; return -1;
} }
@ -8254,9 +8248,7 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfig *cfg,
case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE: case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE:
if (!hasSecure) { if (!hasSecure) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("spice defaultMode secure requested in XML " _("spice defaultMode secure requested in XML configuration, but TLS connection is not available"));
"configuration, but TLS connection is not "
"available"));
return -1; return -1;
} }
virBufferAddLit(&opt, "tls-channel=default,"); virBufferAddLit(&opt, "tls-channel=default,");
@ -8264,9 +8256,7 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfig *cfg,
case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_INSECURE: case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_INSECURE:
if (!hasInsecure) { if (!hasInsecure) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("spice defaultMode insecure requested in XML " _("spice defaultMode insecure requested in XML configuration, but plaintext connection is not available"));
"configuration, but plaintext connection is not "
"available"));
return -1; return -1;
} }
virBufferAddLit(&opt, "plaintext-channel=default,"); virBufferAddLit(&opt, "plaintext-channel=default,");
@ -8282,9 +8272,7 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfig *cfg,
case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE: case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE:
if (!hasSecure) { if (!hasSecure) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("spice secure channels set in XML " _("spice secure channels set in XML configuration, but TLS connection is not available"));
"configuration, but TLS connection is not "
"available"));
return -1; return -1;
} }
virBufferAsprintf(&opt, "tls-channel=%s,", virBufferAsprintf(&opt, "tls-channel=%s,",
@ -8294,9 +8282,7 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfig *cfg,
case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_INSECURE: case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_INSECURE:
if (!hasInsecure) { if (!hasInsecure) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("spice insecure channels set in XML " _("spice insecure channels set in XML configuration, but plaintext connection is not available"));
"configuration, but plaintext connection "
"is not available"));
return -1; return -1;
} }
virBufferAsprintf(&opt, "plaintext-channel=%s,", virBufferAsprintf(&opt, "plaintext-channel=%s,",
@ -9032,8 +9018,7 @@ qemuBuildShmemCommandLine(virCommand *cmd,
if (shmem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { if (shmem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("only 'pci' addresses are supported for the " _("only 'pci' addresses are supported for the shared memory device"));
"shared memory device"));
return -1; return -1;
} }
@ -10029,8 +10014,7 @@ qemuBuildCommandLineValidate(virQEMUDriver *driver,
if (sdl > 1 || vnc > 1 || spice > 1 || egl_headless > 1 || dbus > 1) { if (sdl > 1 || vnc > 1 || spice > 1 || egl_headless > 1 || dbus > 1) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("only 1 graphics device of each type " _("only 1 graphics device of each type (sdl, vnc, spice, headless, dbus) is supported"));
"(sdl, vnc, spice, headless, dbus) is supported"));
return -1; return -1;
} }

View File

@ -1548,9 +1548,8 @@ qemuGetDomainHupageMemPath(virQEMUDriver *driver,
size_t i = 0; size_t i = 0;
if (!cfg->nhugetlbfs) { if (!cfg->nhugetlbfs) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
"%s", _("hugetlbfs filesystem is not mounted " _("hugetlbfs filesystem is not mounted or disabled by administrator config"));
"or disabled by administrator config"));
return -1; return -1;
} }

View File

@ -4591,8 +4591,7 @@ qemuDomainDefVcpusPostParse(virDomainDef *def)
/* they can be ordered only at the beginning */ /* they can be ordered only at the beginning */
if (prevvcpu->hotpluggable == VIR_TRISTATE_BOOL_YES) { if (prevvcpu->hotpluggable == VIR_TRISTATE_BOOL_YES) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("online non-hotpluggable vcpus need to be " _("online non-hotpluggable vcpus need to be ordered prior to hotplugable vcpus"));
"ordered prior to hotplugable vcpus"));
return -1; return -1;
} }
@ -4600,8 +4599,7 @@ qemuDomainDefVcpusPostParse(virDomainDef *def)
* Also note that multiple vcpus may share order on some platforms */ * Also note that multiple vcpus may share order on some platforms */
if (prevvcpu->order > vcpu->order) { if (prevvcpu->order > vcpu->order) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("online non-hotpluggable vcpus must be ordered " _("online non-hotpluggable vcpus must be ordered in ascending order"));
"in ascending order"));
return -1; return -1;
} }
} }
@ -4644,8 +4642,7 @@ qemuDomainDefSetDefaultCPU(virDomainDef *def,
if (STREQ(model, "host") && def->virtType != VIR_DOMAIN_VIRT_KVM) { if (STREQ(model, "host") && def->virtType != VIR_DOMAIN_VIRT_KVM) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("QEMU reports invalid default CPU model \"host\" " _("QEMU reports invalid default CPU model \"host\" for non-kvm domain virt type"));
"for non-kvm domain virt type"));
return -1; return -1;
} }
@ -5080,15 +5077,13 @@ qemuDomainValidateStorageSource(virStorageSource *src,
if (src->format == VIR_STORAGE_FILE_DIR) { if (src->format == VIR_STORAGE_FILE_DIR) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("'directory' storage format is not directly supported by QEMU, " _("'directory' storage format is not directly supported by QEMU, use 'dir' disk type instead"));
"use 'dir' disk type instead"));
return -1; return -1;
} }
if (src->format == VIR_STORAGE_FILE_ISO) { if (src->format == VIR_STORAGE_FILE_ISO) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("storage format 'iso' is not directly supported by QEMU, " _("storage format 'iso' is not directly supported by QEMU, use 'raw' instead"));
"use 'raw' instead"));
return -1; return -1;
} }
@ -5096,8 +5091,7 @@ qemuDomainValidateStorageSource(virStorageSource *src,
actualType != VIR_STORAGE_TYPE_VOLUME && actualType != VIR_STORAGE_TYPE_VOLUME &&
actualType != VIR_STORAGE_TYPE_DIR) { actualType != VIR_STORAGE_TYPE_DIR) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("storage format 'fat' is supported only with 'dir' " _("storage format 'fat' is supported only with 'dir' storage type"));
"storage type"));
return -1; return -1;
} }
@ -5628,23 +5622,20 @@ qemuDomainControllerDefPostParse(virDomainControllerDef *cont,
cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) && cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) &&
cont->idx != 0) { cont->idx != 0) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("pci-root and pcie-root controllers " _("pci-root and pcie-root controllers should have index 0"));
"should have index 0"));
return -1; return -1;
} }
if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS && if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS &&
!qemuDomainIsI440FX(def)) { !qemuDomainIsI440FX(def)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("pci-expander-bus controllers are only supported " _("pci-expander-bus controllers are only supported on 440fx-based machinetypes"));
"on 440fx-based machinetypes"));
return -1; return -1;
} }
if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS && if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS &&
!(qemuDomainIsQ35(def) || qemuDomainIsARMVirt(def))) { !(qemuDomainIsQ35(def) || qemuDomainIsARMVirt(def))) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("pcie-expander-bus controllers are not supported " _("pcie-expander-bus controllers are not supported with this machine type"));
"with this machine type"));
return -1; return -1;
} }
@ -6129,8 +6120,7 @@ qemuDomainNVDimmAlignSizePseries(virDomainMemoryDef *mem)
* smaller than the 256MiB alignment. */ * smaller than the 256MiB alignment. */
if (guestArea < ppc64AlignSize) { if (guestArea < ppc64AlignSize) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("minimum target size for the NVDIMM " _("minimum target size for the NVDIMM must be 256MB plus the label size"));
"must be 256MB plus the label size"));
return -1; return -1;
} }
@ -7868,8 +7858,7 @@ qemuDomainStorageSourceValidateDepth(virStorageSource *src,
diskdst); diskdst);
else else
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("backing chains more than 200 layers deep are not " _("backing chains more than 200 layers deep are not supported"));
"supported"));
return -1; return -1;
} }
@ -8787,8 +8776,7 @@ qemuDomainAgentAvailable(virDomainObj *vm,
if (priv->agentError) { if (priv->agentError) {
if (reportError) { if (reportError) {
virReportError(VIR_ERR_AGENT_UNRESPONSIVE, "%s", virReportError(VIR_ERR_AGENT_UNRESPONSIVE, "%s",
_("QEMU guest agent is not " _("QEMU guest agent is not available due to an error"));
"available due to an error"));
} }
return false; return false;
} }
@ -9286,8 +9274,7 @@ qemuDomainDefValidateMemoryHotplugDevice(const virDomainMemoryDef *mem,
if (mem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DIMM && if (mem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DIMM &&
mem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { mem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("only 'dimm' addresses are supported for the " _("only 'dimm' addresses are supported for the pc-dimm device"));
"pc-dimm device"));
return -1; return -1;
} }
@ -9309,8 +9296,7 @@ qemuDomainDefValidateMemoryHotplugDevice(const virDomainMemoryDef *mem,
if (mem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI && if (mem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
mem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { mem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("only 'pci' addresses are supported for the " _("only 'pci' addresses are supported for the virtio-pmem device"));
"virtio-pmem device"));
return -1; return -1;
} }
@ -9343,8 +9329,7 @@ qemuDomainDefValidateMemoryHotplugDevice(const virDomainMemoryDef *mem,
virDomainNumaGetNodeCount(def->numa) != 0) { virDomainNumaGetNodeCount(def->numa) != 0) {
if (mem->targetNode == -1) { if (mem->targetNode == -1) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("target NUMA node needs to be specified for " _("target NUMA node needs to be specified for memory device"));
"memory device"));
return -1; return -1;
} }
} }
@ -9402,8 +9387,7 @@ qemuDomainDefValidateMemoryHotplug(const virDomainDef *def,
if (!virDomainDefHasMemoryHotplug(def)) { if (!virDomainDefHasMemoryHotplug(def)) {
if (nmems) { if (nmems) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("cannot use/hotplug a memory device when domain " _("cannot use/hotplug a memory device when domain 'maxMemory' is not defined"));
"'maxMemory' is not defined"));
return -1; return -1;
} }
@ -9417,8 +9401,7 @@ qemuDomainDefValidateMemoryHotplug(const virDomainDef *def,
* with memory hotplug. */ * with memory hotplug. */
if (virDomainNumaGetNodeCount(def->numa) == 0) { if (virDomainNumaGetNodeCount(def->numa) == 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("At least one numa node has to be configured when " _("At least one numa node has to be configured when enabling memory hotplug"));
"enabling memory hotplug"));
return -1; return -1;
} }
} }

View File

@ -1633,8 +1633,7 @@ qemuDomainCollectPCIAddress(virDomainDef *def G_GNUC_UNUSED,
if (addrs->nbuses > 0 && if (addrs->nbuses > 0 &&
!(addrs->buses[0].flags & VIR_PCI_CONNECT_TYPE_PCI_DEVICE)) { !(addrs->buses[0].flags & VIR_PCI_CONNECT_TYPE_PCI_DEVICE)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Bus 0 must be PCI for integrated PIIX3 " _("Bus 0 must be PCI for integrated PIIX3 USB or IDE controllers"));
"USB or IDE controllers"));
return -1; return -1;
} }
return 0; return 0;
@ -1809,8 +1808,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDef *def,
if (!virPCIDeviceAddressEqual(&cont->info.addr.pci, if (!virPCIDeviceAddressEqual(&cont->info.addr.pci,
&primaryIDEAddr)) { &primaryIDEAddr)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Primary IDE controller must have PCI " _("Primary IDE controller must have PCI address 0:0:1.1"));
"address 0:0:1.1"));
return -1; return -1;
} }
} else { } else {
@ -1825,8 +1823,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDef *def,
if (!virPCIDeviceAddressEqual(&cont->info.addr.pci, if (!virPCIDeviceAddressEqual(&cont->info.addr.pci,
&piix3USBAddr)) { &piix3USBAddr)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("PIIX3 USB controller at index 0 must " _("PIIX3 USB controller at index 0 must have PCI address 0:0:1.2"));
"have PCI address 0:0:1.2"));
return -1; return -1;
} }
} else { } else {
@ -1919,8 +1916,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDef *def,
if (!virPCIDeviceAddressEqual(&cont->info.addr.pci, if (!virPCIDeviceAddressEqual(&cont->info.addr.pci,
&primarySATAAddr)) { &primarySATAAddr)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Primary SATA controller must have " _("Primary SATA controller must have PCI address 0:0:1f.2"));
"PCI address 0:0:1f.2"));
return -1; return -1;
} }
} else { } else {
@ -3053,8 +3049,7 @@ qemuDomainUSBAddressAddHubs(virDomainDef *def)
if (data.count > 0 && !virDomainDefHasUSB(def)) { if (data.count > 0 && !virDomainDefHasUSB(def)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("USB is disabled for this domain, but USB devices " _("USB is disabled for this domain, but USB devices are present in the domain XML"));
"are present in the domain XML"));
return -1; return -1;
} }

View File

@ -2198,8 +2198,7 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
if (def) { if (def) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s", virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("cannot resize the maximum memory on an " _("cannot resize the maximum memory on an active domain"));
"active domain"));
goto endjob; goto endjob;
} }
@ -2208,16 +2207,14 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
* is no way to change the individual node sizes with this API */ * is no way to change the individual node sizes with this API */
if (virDomainNumaGetNodeCount(persistentDef->numa) > 0) { if (virDomainNumaGetNodeCount(persistentDef->numa) > 0) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s", virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("initial memory size of a domain with NUMA " _("initial memory size of a domain with NUMA nodes cannot be modified with this API"));
"nodes cannot be modified with this API"));
goto endjob; goto endjob;
} }
if (persistentDef->mem.max_memory && if (persistentDef->mem.max_memory &&
persistentDef->mem.max_memory < newmem) { persistentDef->mem.max_memory < newmem) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s", virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("cannot set initial memory size greater than " _("cannot set initial memory size greater than the maximum memory size"));
"the maximum memory size"));
goto endjob; goto endjob;
} }
@ -2274,8 +2271,7 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
/* Lack of balloon support is a fatal error */ /* Lack of balloon support is a fatal error */
if (r == 0) { if (r == 0) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s", virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Unable to change memory of active domain without " _("Unable to change memory of active domain without the balloon device and guest OS balloon driver"));
"the balloon device and guest OS balloon driver"));
goto endjob; goto endjob;
} }
} }
@ -2341,8 +2337,7 @@ static int qemuDomainSetMemoryStatsPeriod(virDomainPtr dom, int period,
if (def) { if (def) {
if (!virDomainDefHasMemballoon(def)) { if (!virDomainDefHasMemballoon(def)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("No memory balloon device configured, " _("No memory balloon device configured, can not set the collection period"));
"can not set the collection period"));
goto endjob; goto endjob;
} }
@ -2362,8 +2357,7 @@ static int qemuDomainSetMemoryStatsPeriod(virDomainPtr dom, int period,
if (persistentDef) { if (persistentDef) {
if (!virDomainDefHasMemballoon(persistentDef)) { if (!virDomainDefHasMemballoon(persistentDef)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("No memory balloon device configured, " _("No memory balloon device configured, can not set the collection period"));
"can not set the collection period"));
goto endjob; goto endjob;
} }
persistentDef->memballoon->period = period; persistentDef->memballoon->period = period;
@ -3141,8 +3135,7 @@ doCoreDump(virQEMUDriver *driver,
} else { } else {
if (dumpformat != VIR_DOMAIN_CORE_DUMP_FORMAT_RAW) { if (dumpformat != VIR_DOMAIN_CORE_DUMP_FORMAT_RAW) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("kdump-compressed format is only supported with " _("kdump-compressed format is only supported with memory-only dump"));
"memory-only dump"));
goto cleanup; goto cleanup;
} }
@ -4166,8 +4159,7 @@ qemuDomainSetVcpusMax(virQEMUDriver *driver,
if (virDomainNumaGetCPUCountTotal(persistentDef->numa) > nvcpus) { if (virDomainNumaGetCPUCountTotal(persistentDef->numa) > nvcpus) {
virReportError(VIR_ERR_INVALID_ARG, "%s", virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Number of CPUs in <numa> exceeds the desired " _("Number of CPUs in <numa> exceeds the desired maximum vcpu count"));
"maximum vcpu count"));
return -1; return -1;
} }
@ -4514,8 +4506,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
if (virDomainCgroupSetupCpusetCpus(cgroup_emulator, pcpumap) < 0) { if (virDomainCgroupSetupCpusetCpus(cgroup_emulator, pcpumap) < 0) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s", virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("failed to set cpuset.cpus in cgroup" _("failed to set cpuset.cpus in cgroup for emulator threads"));
" for emulator threads"));
goto endjob; goto endjob;
} }
} }
@ -4665,8 +4656,7 @@ qemuDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags)
if (!virDomainObjIsActive(vm)) { if (!virDomainObjIsActive(vm)) {
virReportError(VIR_ERR_INVALID_ARG, "%s", virReportError(VIR_ERR_INVALID_ARG, "%s",
_("vCPU count provided by the guest agent can only be " _("vCPU count provided by the guest agent can only be requested for live domains"));
"requested for live domains"));
goto endjob; goto endjob;
} }
@ -6539,14 +6529,12 @@ qemuDomainUndefineFlags(virDomainPtr dom,
if (flags & VIR_DOMAIN_UNDEFINE_MANAGED_SAVE) { if (flags & VIR_DOMAIN_UNDEFINE_MANAGED_SAVE) {
if (unlink(name) < 0) { if (unlink(name) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Failed to remove domain managed " _("Failed to remove domain managed save image"));
"save image"));
goto endjob; goto endjob;
} }
} else { } else {
virReportError(VIR_ERR_OPERATION_INVALID, "%s", virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Refusing to undefine while domain managed " _("Refusing to undefine while domain managed save image exists"));
"save image exists"));
goto endjob; goto endjob;
} }
} }
@ -10635,8 +10623,7 @@ qemuDomainMigratePrepare2(virConnectPtr dconn,
* VIR_MIGRATE_TUNNELLED set * VIR_MIGRATE_TUNNELLED set
*/ */
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Tunnelled migration requested but invalid " _("Tunnelled migration requested but invalid RPC method called"));
"RPC method called"));
return -1; return -1;
} }
@ -10865,8 +10852,7 @@ qemuDomainMigratePrepare3(virConnectPtr dconn,
* VIR_MIGRATE_TUNNELLED set * VIR_MIGRATE_TUNNELLED set
*/ */
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Tunnelled migration requested but invalid " _("Tunnelled migration requested but invalid RPC method called"));
"RPC method called"));
return -1; return -1;
} }
@ -10952,24 +10938,21 @@ qemuDomainMigratePrepare3Params(virConnectPtr dconn,
nmigrate_disks > 0) { nmigrate_disks > 0) {
if (uri_in && STRPREFIX(uri_in, "unix:") && !nbdURI) { if (uri_in && STRPREFIX(uri_in, "unix:") && !nbdURI) {
virReportError(VIR_ERR_INVALID_ARG, "%s", virReportError(VIR_ERR_INVALID_ARG, "%s",
_("NBD URI must be supplied when " _("NBD URI must be supplied when migration URI uses UNIX transport method"));
"migration URI uses UNIX transport method"));
return -1; return -1;
} }
} }
if (nbdURI && nbdPort) { if (nbdURI && nbdPort) {
virReportError(VIR_ERR_INVALID_ARG, "%s", virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Both port and URI requested for disk migration " _("Both port and URI requested for disk migration while being mutually exclusive"));
"while being mutually exclusive"));
return -1; return -1;
} }
if (listenAddress) { if (listenAddress) {
if (uri_in && STRPREFIX(uri_in, "unix:")) { if (uri_in && STRPREFIX(uri_in, "unix:")) {
virReportError(VIR_ERR_INVALID_ARG, "%s", virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Usage of listen-address is forbidden when " _("Usage of listen-address is forbidden when migration URI uses UNIX transport method"));
"migration URI uses UNIX transport method"));
return -1; return -1;
} }
} else { } else {
@ -10981,8 +10964,7 @@ qemuDomainMigratePrepare3Params(virConnectPtr dconn,
* VIR_MIGRATE_TUNNELLED set * VIR_MIGRATE_TUNNELLED set
*/ */
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Tunnelled migration requested but invalid " _("Tunnelled migration requested but invalid RPC method called"));
"RPC method called"));
return -1; return -1;
} }
@ -11201,16 +11183,14 @@ qemuDomainMigratePerform3Params(virDomainPtr dom,
if (nbdURI && nbdPort) { if (nbdURI && nbdPort) {
virReportError(VIR_ERR_INVALID_ARG, "%s", virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Both port and URI requested for disk migration " _("Both port and URI requested for disk migration while being mutually exclusive"));
"while being mutually exclusive"));
goto cleanup; goto cleanup;
} }
if (listenAddress) { if (listenAddress) {
if (uri && STRPREFIX(uri, "unix:")) { if (uri && STRPREFIX(uri, "unix:")) {
virReportError(VIR_ERR_INVALID_ARG, "%s", virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Usage of listen-address is forbidden when " _("Usage of listen-address is forbidden when migration URI uses UNIX transport method"));
"migration URI uses UNIX transport method"));
return -1; return -1;
} }
} }
@ -11226,8 +11206,7 @@ qemuDomainMigratePerform3Params(virDomainPtr dom,
nmigrate_disks > 0) { nmigrate_disks > 0) {
if (uri && STRPREFIX(uri, "unix:") && !nbdURI) { if (uri && STRPREFIX(uri, "unix:") && !nbdURI) {
virReportError(VIR_ERR_INVALID_ARG, "%s", virReportError(VIR_ERR_INVALID_ARG, "%s",
_("NBD URI must be supplied when " _("NBD URI must be supplied when migration URI uses UNIX transport method"));
"migration URI uses UNIX transport method"));
return -1; return -1;
} }
} }
@ -11991,8 +11970,7 @@ qemuDomainGetJobStatsInternal(virDomainObj *vm,
if (vm->job->asyncJob == VIR_ASYNC_JOB_MIGRATION_IN) { if (vm->job->asyncJob == VIR_ASYNC_JOB_MIGRATION_IN) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("migration statistics are available only on " _("migration statistics are available only on the source host"));
"the source host"));
return -1; return -1;
} }
@ -12192,14 +12170,12 @@ qemuDomainAbortJobFlags(virDomainPtr dom,
case VIR_ASYNC_JOB_MIGRATION_IN: case VIR_ASYNC_JOB_MIGRATION_IN:
virReportError(VIR_ERR_OPERATION_INVALID, "%s", virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("cannot abort incoming migration;" _("cannot abort incoming migration; use virDomainDestroy instead"));
" use virDomainDestroy instead"));
break; break;
case VIR_ASYNC_JOB_START: case VIR_ASYNC_JOB_START:
virReportError(VIR_ERR_OPERATION_INVALID, "%s", virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("cannot abort VM start;" _("cannot abort VM start; use virDomainDestroy instead"));
" use virDomainDestroy instead"));
break; break;
case VIR_ASYNC_JOB_MIGRATION_OUT: case VIR_ASYNC_JOB_MIGRATION_OUT:
@ -12337,8 +12313,7 @@ qemuDomainMigrateGetMaxDowntime(virDomainPtr dom,
if (rc == 1) { if (rc == 1) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s", virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Querying migration downtime is not supported by " _("Querying migration downtime is not supported by QEMU binary"));
"QEMU binary"));
goto endjob; goto endjob;
} }
@ -12378,8 +12353,7 @@ qemuDomainMigrateGetCompressionCache(virDomainPtr dom,
if (!qemuMigrationCapsGet(vm, QEMU_MIGRATION_CAP_XBZRLE)) { if (!qemuMigrationCapsGet(vm, QEMU_MIGRATION_CAP_XBZRLE)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("Compressed migration is not supported by " _("Compressed migration is not supported by QEMU binary"));
"QEMU binary"));
goto endjob; goto endjob;
} }
@ -12427,8 +12401,7 @@ qemuDomainMigrateSetCompressionCache(virDomainPtr dom,
if (!qemuMigrationCapsGet(vm, QEMU_MIGRATION_CAP_XBZRLE)) { if (!qemuMigrationCapsGet(vm, QEMU_MIGRATION_CAP_XBZRLE)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("Compressed migration is not supported by " _("Compressed migration is not supported by QEMU binary"));
"QEMU binary"));
goto endjob; goto endjob;
} }
@ -12559,8 +12532,7 @@ qemuDomainMigrationGetPostcopyBandwidth(virDomainObj *vm,
if (rc == 1) { if (rc == 1) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s", virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("querying maximum post-copy migration speed is " _("querying maximum post-copy migration speed is not supported by QEMU binary"));
"not supported by QEMU binary"));
goto cleanup; goto cleanup;
} }
@ -12644,15 +12616,13 @@ qemuDomainMigrateStartPostCopy(virDomainPtr dom,
if (vm->job->asyncJob != VIR_ASYNC_JOB_MIGRATION_OUT) { if (vm->job->asyncJob != VIR_ASYNC_JOB_MIGRATION_OUT) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s", virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("post-copy can only be started while " _("post-copy can only be started while outgoing migration is in progress"));
"outgoing migration is in progress"));
goto endjob; goto endjob;
} }
if (!(vm->job->apiFlags & VIR_MIGRATE_POSTCOPY)) { if (!(vm->job->apiFlags & VIR_MIGRATE_POSTCOPY)) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s", virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("switching to post-copy requires migration to be " _("switching to post-copy requires migration to be started with VIR_MIGRATE_POSTCOPY flag"));
"started with VIR_MIGRATE_POSTCOPY flag"));
goto endjob; goto endjob;
} }
@ -13584,8 +13554,7 @@ qemuDomainBlockPullCommon(virDomainObj *vm,
if (flags & VIR_DOMAIN_BLOCK_REBASE_RELATIVE && !base) { if (flags & VIR_DOMAIN_BLOCK_REBASE_RELATIVE && !base) {
virReportError(VIR_ERR_INVALID_ARG, "%s", virReportError(VIR_ERR_INVALID_ARG, "%s",
_("flag VIR_DOMAIN_BLOCK_REBASE_RELATIVE is valid only " _("flag VIR_DOMAIN_BLOCK_REBASE_RELATIVE is valid only with non-null base"));
"with non-null base"));
goto cleanup; goto cleanup;
} }
@ -13972,8 +13941,7 @@ qemuDomainBlockCopyValidateMirror(virStorageSource *mirror,
if (virStorageSourceAccess(mirror, F_OK) < 0) { if (virStorageSourceAccess(mirror, F_OK) < 0) {
if (errno != ENOENT) { if (errno != ENOENT) {
virReportSystemError(errno, "%s", virReportSystemError(errno, "%s",
_("unable to verify existence of " _("unable to verify existence of block copy target"));
"block copy target"));
return -1; return -1;
} }
@ -14211,8 +14179,7 @@ qemuDomainBlockCopyCommon(virDomainObj *vm,
if (disk->src->shared && !disk->src->readonly && if (disk->src->shared && !disk->src->readonly &&
!qemuBlockStorageSourceSupportsConcurrentAccess(mirror)) { !qemuBlockStorageSourceSupportsConcurrentAccess(mirror)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("can't pivot a shared disk to a storage volume not " _("can't pivot a shared disk to a storage volume not supporting sharing"));
"supporting sharing"));
goto endjob; goto endjob;
} }
@ -14919,8 +14886,7 @@ qemuDomainCheckBlockIoTuneReset(virDomainDiskDef *disk,
if (newiotune->group_name && if (newiotune->group_name &&
STRNEQ_NULLABLE(newiotune->group_name, disk->blkdeviotune.group_name)) { STRNEQ_NULLABLE(newiotune->group_name, disk->blkdeviotune.group_name)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("creating a new group/updating existing with all" _("creating a new group/updating existing with all tune parameters zero is not supported"));
" tune parameters zero is not supported"));
return -1; return -1;
} }
@ -15099,32 +15065,28 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
if ((info.total_bytes_sec && info.read_bytes_sec) || if ((info.total_bytes_sec && info.read_bytes_sec) ||
(info.total_bytes_sec && info.write_bytes_sec)) { (info.total_bytes_sec && info.write_bytes_sec)) {
virReportError(VIR_ERR_INVALID_ARG, "%s", virReportError(VIR_ERR_INVALID_ARG, "%s",
_("total and read/write of bytes_sec " _("total and read/write of bytes_sec cannot be set at the same time"));
"cannot be set at the same time"));
goto endjob; goto endjob;
} }
if ((info.total_iops_sec && info.read_iops_sec) || if ((info.total_iops_sec && info.read_iops_sec) ||
(info.total_iops_sec && info.write_iops_sec)) { (info.total_iops_sec && info.write_iops_sec)) {
virReportError(VIR_ERR_INVALID_ARG, "%s", virReportError(VIR_ERR_INVALID_ARG, "%s",
_("total and read/write of iops_sec " _("total and read/write of iops_sec cannot be set at the same time"));
"cannot be set at the same time"));
goto endjob; goto endjob;
} }
if ((info.total_bytes_sec_max && info.read_bytes_sec_max) || if ((info.total_bytes_sec_max && info.read_bytes_sec_max) ||
(info.total_bytes_sec_max && info.write_bytes_sec_max)) { (info.total_bytes_sec_max && info.write_bytes_sec_max)) {
virReportError(VIR_ERR_INVALID_ARG, "%s", virReportError(VIR_ERR_INVALID_ARG, "%s",
_("total and read/write of bytes_sec_max " _("total and read/write of bytes_sec_max cannot be set at the same time"));
"cannot be set at the same time"));
goto endjob; goto endjob;
} }
if ((info.total_iops_sec_max && info.read_iops_sec_max) || if ((info.total_iops_sec_max && info.read_iops_sec_max) ||
(info.total_iops_sec_max && info.write_iops_sec_max)) { (info.total_iops_sec_max && info.write_iops_sec_max)) {
virReportError(VIR_ERR_INVALID_ARG, "%s", virReportError(VIR_ERR_INVALID_ARG, "%s",
_("total and read/write of iops_sec_max " _("total and read/write of iops_sec_max cannot be set at the same time"));
"cannot be set at the same time"));
goto endjob; goto endjob;
} }
@ -15916,8 +15878,7 @@ qemuDomainFSTrim(virDomainPtr dom,
if (mountPoint) { if (mountPoint) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
_("Specifying mount point " _("Specifying mount point is not supported for now"));
"is not supported for now"));
return -1; return -1;
} }
@ -16322,8 +16283,7 @@ qemuDomainSetTime(virDomainPtr dom,
!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_RTC_RESET_REINJECTION)) !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_RTC_RESET_REINJECTION))
{ {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot set time: qemu doesn't support " _("cannot set time: qemu doesn't support rtc-reset-reinjection command"));
"rtc-reset-reinjection command"));
goto cleanup; goto cleanup;
} }

View File

@ -245,8 +245,7 @@ qemuHostdevPrepareMediatedDevices(virQEMUDriver *driver,
if (virHostdevIsMdevDevice(hostdevs[i])) { if (virHostdevIsMdevDevice(hostdevs[i])) {
if (!supportsVFIO) { if (!supportsVFIO) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Mediated host device assignment requires " _("Mediated host device assignment requires VFIO support"));
"VFIO support"));
return -1; return -1;
} }
break; break;

View File

@ -6363,8 +6363,7 @@ qemuDomainHotplugDelVcpu(virQEMUDriver *driver,
if ((rc = qemuDomainWaitForDeviceRemoval(vm)) <= 0) { if ((rc = qemuDomainWaitForDeviceRemoval(vm)) <= 0) {
if (rc == 0) if (rc == 0)
virReportError(VIR_ERR_OPERATION_TIMEOUT, "%s", virReportError(VIR_ERR_OPERATION_TIMEOUT, "%s",
_("vcpu unplug request timed out. Unplug result " _("vcpu unplug request timed out. Unplug result must be manually inspected in the domain"));
"must be manually inspected in the domain"));
goto cleanup; goto cleanup;
} }
@ -6502,8 +6501,7 @@ qemuDomainSelectHotplugVcpuEntities(virDomainDef *def,
if (curvcpus > nvcpus) { if (curvcpus > nvcpus) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("target vm vcpu granularity does not allow the " _("target vm vcpu granularity does not allow the desired vcpu count"));
"desired vcpu count"));
return NULL; return NULL;
} }
@ -6529,8 +6527,7 @@ qemuDomainSelectHotplugVcpuEntities(virDomainDef *def,
if (curvcpus < nvcpus) { if (curvcpus < nvcpus) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("target vm vcpu granularity does not allow the " _("target vm vcpu granularity does not allow the desired vcpu count"));
"desired vcpu count"));
return NULL; return NULL;
} }
@ -6540,8 +6537,7 @@ qemuDomainSelectHotplugVcpuEntities(virDomainDef *def,
if (curvcpus != nvcpus) { if (curvcpus != nvcpus) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("failed to find appropriate hotpluggable vcpus to " _("failed to find appropriate hotpluggable vcpus to reach the desired target vcpu count"));
"reach the desired target vcpu count"));
return NULL; return NULL;
} }
@ -6848,8 +6844,7 @@ qemuDomainSetVcpuInternal(virQEMUDriver *driver,
if (def) { if (def) {
if (!qemuDomainSupportsNewVcpuHotplug(vm)) { if (!qemuDomainSupportsNewVcpuHotplug(vm)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("this qemu version does not support specific " _("this qemu version does not support specific vCPU hotplug"));
"vCPU hotplug"));
return -1; return -1;
} }
@ -6935,8 +6930,7 @@ qemuDomainChangeDiskLive(virDomainObj *vm,
if (disk->device != VIR_DOMAIN_DISK_DEVICE_CDROM && if (disk->device != VIR_DOMAIN_DISK_DEVICE_CDROM &&
disk->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY) { disk->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("disk source can be changed only in removable " _("disk source can be changed only in removable drives"));
"drives"));
return -1; return -1;
} }

View File

@ -476,8 +476,7 @@ qemuMigrationDstPrecreateStorage(virDomainObj *vm,
if (incremental) { if (incremental) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("pre-creation of storage targets for incremental " _("pre-creation of storage targets for incremental storage migration is not supported"));
"storage migration is not supported"));
goto cleanup; goto cleanup;
} }
@ -1479,8 +1478,7 @@ qemuMigrationSrcIsAllowed(virDomainObj *vm,
if (block) { if (block) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s", virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("domain has 'invtsc' CPU feature but " _("domain has 'invtsc' CPU feature but TSC frequency is not specified"));
"TSC frequency is not specified"));
return false; return false;
} }
} }
@ -1493,8 +1491,7 @@ qemuMigrationSrcIsAllowed(virDomainObj *vm,
if (mem->model == VIR_DOMAIN_MEMORY_MODEL_DIMM && if (mem->model == VIR_DOMAIN_MEMORY_MODEL_DIMM &&
mem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DIMM) { mem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DIMM) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s", virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("domain's dimm info lacks slot ID " _("domain's dimm info lacks slot ID or base address"));
"or base address"));
return false; return false;
} }
@ -1648,8 +1645,7 @@ qemuMigrationSrcIsSafe(virDomainDef *def,
} }
virReportError(VIR_ERR_MIGRATE_UNSAFE, "%s", virReportError(VIR_ERR_MIGRATE_UNSAFE, "%s",
_("Migration may lead to data corruption if disks" _("Migration may lead to data corruption if disks use cache other than none or directsync"));
" use cache other than none or directsync"));
return false; return false;
} }
@ -2205,8 +2201,7 @@ qemuMigrationDstCheckProtocol(virQEMUCaps *qemuCaps,
if (STRPREFIX(migrateFrom, "rdma")) { if (STRPREFIX(migrateFrom, "rdma")) {
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MIGRATE_RDMA)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MIGRATE_RDMA)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("incoming RDMA migration is not supported " _("incoming RDMA migration is not supported with this QEMU binary"));
"with this QEMU binary"));
return -1; return -1;
} }
} else if (!STRPREFIX(migrateFrom, "tcp") && } else if (!STRPREFIX(migrateFrom, "tcp") &&
@ -2572,8 +2567,7 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver,
(!(flags & VIR_MIGRATE_LIVE) || (!(flags & VIR_MIGRATE_LIVE) ||
flags & VIR_MIGRATE_PAUSED)) { flags & VIR_MIGRATE_PAUSED)) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
_("post-copy migration is not supported with non-live " _("post-copy migration is not supported with non-live or paused migration"));
"or paused migration"));
return NULL; return NULL;
} }
@ -3733,8 +3727,7 @@ qemuMigrationDstPrepareDirect(virQEMUDriver *driver,
if (STRPREFIX(hostname, "localhost")) { if (STRPREFIX(hostname, "localhost")) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("hostname on destination resolved to localhost," _("hostname on destination resolved to localhost, but migration requires an FQDN"));
" but migration requires an FQDN"));
goto cleanup; goto cleanup;
} }
@ -4600,8 +4593,7 @@ qemuMigrationSrcStart(virDomainObj *vm,
if (spec->fwdType != MIGRATION_FWD_DIRECT) { if (spec->fwdType != MIGRATION_FWD_DIRECT) {
if (!tunnelFd) { if (!tunnelFd) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("tunnelFD argument is required for tunnelled " _("tunnelFD argument is required for tunnelled migration"));
"migration"));
VIR_FORCE_CLOSE(spec->dest.fd.local); VIR_FORCE_CLOSE(spec->dest.fd.local);
VIR_FORCE_CLOSE(spec->dest.fd.qemu); VIR_FORCE_CLOSE(spec->dest.fd.qemu);
return -1; return -1;
@ -5149,14 +5141,12 @@ qemuMigrationSrcPerformNative(virQEMUDriver *driver,
if (STREQ(uribits->scheme, "rdma")) { if (STREQ(uribits->scheme, "rdma")) {
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_RDMA)) { if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_RDMA)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("outgoing RDMA migration is not supported " _("outgoing RDMA migration is not supported with this QEMU binary"));
"with this QEMU binary"));
return -1; return -1;
} }
if (!virMemoryLimitIsSet(vm->def->mem.hard_limit)) { if (!virMemoryLimitIsSet(vm->def->mem.hard_limit)) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s", virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("cannot start RDMA migration with no memory hard " _("cannot start RDMA migration with no memory hard limit set"));
"limit set"));
return -1; return -1;
} }
} }
@ -5166,8 +5156,7 @@ qemuMigrationSrcPerformNative(virQEMUDriver *driver,
!(flags & VIR_MIGRATE_POSTCOPY_RESUME) && !(flags & VIR_MIGRATE_POSTCOPY_RESUME) &&
!qemuMigrationParamsTLSHostnameIsSet(migParams)) { !qemuMigrationParamsTLSHostnameIsSet(migParams)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("Explicit destination hostname is required " _("Explicit destination hostname is required for TLS migration over UNIX socket"));
"for TLS migration over UNIX socket"));
return -1; return -1;
} }
@ -5878,22 +5867,19 @@ qemuMigrationSrcPerformPeer2Peer(virQEMUDriver *driver,
if (flags & VIR_MIGRATE_TUNNELLED && uri) { if (flags & VIR_MIGRATE_TUNNELLED && uri) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
_("migration URI is not supported by tunnelled " _("migration URI is not supported by tunnelled migration"));
"migration"));
goto cleanup; goto cleanup;
} }
if (flags & VIR_MIGRATE_TUNNELLED && listenAddress) { if (flags & VIR_MIGRATE_TUNNELLED && listenAddress) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
_("listen address is not supported by tunnelled " _("listen address is not supported by tunnelled migration"));
"migration"));
goto cleanup; goto cleanup;
} }
if (flags & VIR_MIGRATE_TUNNELLED && nbdPort) { if (flags & VIR_MIGRATE_TUNNELLED && nbdPort) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
_("disk port address is not supported by tunnelled " _("disk port address is not supported by tunnelled migration"));
"migration"));
goto cleanup; goto cleanup;
} }
@ -5956,15 +5942,13 @@ qemuMigrationSrcPerformPeer2Peer(virQEMUDriver *driver,
* old-style APIs. */ * old-style APIs. */
if (!useParams && (graphicsuri || listenAddress || nmigrate_disks)) { if (!useParams && (graphicsuri || listenAddress || nmigrate_disks)) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
_("Migration APIs with extensible parameters are not " _("Migration APIs with extensible parameters are not supported but extended parameters were passed"));
"supported but extended parameters were passed"));
goto cleanup; goto cleanup;
} }
if (offline && !dstOffline) { if (offline && !dstOffline) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
_("offline migration is not supported by " _("offline migration is not supported by the destination host"));
"the destination host"));
goto cleanup; goto cleanup;
} }

View File

@ -1006,8 +1006,7 @@ qemuMigrationParamsApply(virDomainObj *vm,
if (asyncJob == VIR_ASYNC_JOB_NONE) { if (asyncJob == VIR_ASYNC_JOB_NONE) {
if (!virBitmapIsAllClear(migParams->caps)) { if (!virBitmapIsAllClear(migParams->caps)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Migration capabilities can only be set by " _("Migration capabilities can only be set by a migration job"));
"a migration job"));
goto cleanup; goto cleanup;
} }
} else if (qemuMigrationParamsApplyCaps(vm, migParams->caps) < 0) { } else if (qemuMigrationParamsApplyCaps(vm, migParams->caps) < 0) {
@ -1091,8 +1090,7 @@ qemuMigrationParamsEnableTLS(virQEMUDriver *driver,
if (!jobPriv->migParams->params[QEMU_MIGRATION_PARAM_TLS_CREDS].set) { if (!jobPriv->migParams->params[QEMU_MIGRATION_PARAM_TLS_CREDS].set) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("TLS migration is not supported with this " _("TLS migration is not supported with this QEMU binary"));
"QEMU binary"));
return -1; return -1;
} }

View File

@ -976,8 +976,7 @@ qemuMonitorInitBalloonObjectPath(qemuMonitor *mon,
/* If we get here, we found the path, but not the property */ /* If we get here, we found the path, but not the property */
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Property 'guest-stats-polling-interval' " _("Property 'guest-stats-polling-interval' not found on memory balloon driver."));
"not found on memory balloon driver."));
cleanup: cleanup:
for (i = 0; i < nprops; i++) for (i = 0; i < nprops; i++)

View File

@ -2253,8 +2253,7 @@ qemuMonitorJSONBlockStatsCollectData(virJSONValue *dev,
if ((stats = virJSONValueObjectGetObject(dev, "stats")) == NULL) { if ((stats = virJSONValueObjectGetObject(dev, "stats")) == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("blockstats stats entry was not " _("blockstats stats entry was not in expected format"));
"in expected format"));
return NULL; return NULL;
} }
@ -2425,8 +2424,7 @@ qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitor *mon,
if (!dev || virJSONValueGetType(dev) != VIR_JSON_TYPE_OBJECT) { if (!dev || virJSONValueGetType(dev) != VIR_JSON_TYPE_OBJECT) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("blockstats device entry was not " _("blockstats device entry was not in expected format"));
"in expected format"));
return -1; return -1;
} }
@ -3025,8 +3023,7 @@ qemuMonitorJSONGetMigrationStatsReply(virJSONValue *reply,
&stats->disk_transferred); &stats->disk_transferred);
if (rc < 0) { if (rc < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("disk migration was active, but " _("disk migration was active, but 'transferred' data was missing"));
"'transferred' data was missing"));
return -1; return -1;
} }
@ -3034,8 +3031,7 @@ qemuMonitorJSONGetMigrationStatsReply(virJSONValue *reply,
&stats->disk_remaining); &stats->disk_remaining);
if (rc < 0) { if (rc < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("disk migration was active, but 'remaining' " _("disk migration was active, but 'remaining' data was missing"));
"data was missing"));
return -1; return -1;
} }
@ -3043,8 +3039,7 @@ qemuMonitorJSONGetMigrationStatsReply(virJSONValue *reply,
&stats->disk_total); &stats->disk_total);
if (rc < 0) { if (rc < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("disk migration was active, but 'total' " _("disk migration was active, but 'total' data was missing"));
"data was missing"));
return -1; return -1;
} }
@ -3062,8 +3057,7 @@ qemuMonitorJSONGetMigrationStatsReply(virJSONValue *reply,
&stats->xbzrle_cache_size); &stats->xbzrle_cache_size);
if (rc < 0) { if (rc < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("XBZRLE is active, but 'cache-size' data " _("XBZRLE is active, but 'cache-size' data was missing"));
"was missing"));
return -1; return -1;
} }
@ -3071,8 +3065,7 @@ qemuMonitorJSONGetMigrationStatsReply(virJSONValue *reply,
&stats->xbzrle_bytes); &stats->xbzrle_bytes);
if (rc < 0) { if (rc < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("XBZRLE is active, but 'bytes' data " _("XBZRLE is active, but 'bytes' data was missing"));
"was missing"));
return -1; return -1;
} }
@ -3080,8 +3073,7 @@ qemuMonitorJSONGetMigrationStatsReply(virJSONValue *reply,
&stats->xbzrle_pages); &stats->xbzrle_pages);
if (rc < 0) { if (rc < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("XBZRLE is active, but 'pages' data " _("XBZRLE is active, but 'pages' data was missing"));
"was missing"));
return -1; return -1;
} }
@ -3089,8 +3081,7 @@ qemuMonitorJSONGetMigrationStatsReply(virJSONValue *reply,
&stats->xbzrle_cache_miss); &stats->xbzrle_cache_miss);
if (rc < 0) { if (rc < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("XBZRLE is active, but 'cache-miss' data " _("XBZRLE is active, but 'cache-miss' data was missing"));
"was missing"));
return -1; return -1;
} }
@ -3098,8 +3089,7 @@ qemuMonitorJSONGetMigrationStatsReply(virJSONValue *reply,
&stats->xbzrle_overflow); &stats->xbzrle_overflow);
if (rc < 0) { if (rc < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("XBZRLE is active, but 'overflow' data " _("XBZRLE is active, but 'overflow' data was missing"));
"was missing"));
return -1; return -1;
} }
} }
@ -3619,30 +3609,26 @@ qemuMonitorJSONQueryRxFilterParse(virJSONValue *msg,
if (!(tmp = virJSONValueObjectGetString(entry, "name"))) { if (!(tmp = virJSONValueObjectGetString(entry, "name"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing or invalid name " _("Missing or invalid name in query-rx-filter response"));
"in query-rx-filter response"));
return -1; return -1;
} }
fil->name = g_strdup(tmp); fil->name = g_strdup(tmp);
if ((!(tmp = virJSONValueObjectGetString(entry, "main-mac"))) || if ((!(tmp = virJSONValueObjectGetString(entry, "main-mac"))) ||
virMacAddrParse(tmp, &fil->mac) < 0) { virMacAddrParse(tmp, &fil->mac) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing or invalid 'main-mac' " _("Missing or invalid 'main-mac' in query-rx-filter response"));
"in query-rx-filter response"));
return -1; return -1;
} }
if (virJSONValueObjectGetBoolean(entry, "promiscuous", if (virJSONValueObjectGetBoolean(entry, "promiscuous",
&fil->promiscuous) < 0) { &fil->promiscuous) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing or invalid 'promiscuous' " _("Missing or invalid 'promiscuous' in query-rx-filter response"));
"in query-rx-filter response"));
return -1; return -1;
} }
if (virJSONValueObjectGetBoolean(entry, "broadcast-allowed", if (virJSONValueObjectGetBoolean(entry, "broadcast-allowed",
&fil->broadcastAllowed) < 0) { &fil->broadcastAllowed) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing or invalid 'broadcast-allowed' " _("Missing or invalid 'broadcast-allowed' in query-rx-filter response"));
"in query-rx-filter response"));
return -1; return -1;
} }
@ -3650,15 +3636,13 @@ qemuMonitorJSONQueryRxFilterParse(virJSONValue *msg,
((fil->unicast.mode ((fil->unicast.mode
= virNetDevRxFilterModeTypeFromString(tmp)) < 0)) { = virNetDevRxFilterModeTypeFromString(tmp)) < 0)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing or invalid 'unicast' " _("Missing or invalid 'unicast' in query-rx-filter response"));
"in query-rx-filter response"));
return -1; return -1;
} }
if (virJSONValueObjectGetBoolean(entry, "unicast-overflow", if (virJSONValueObjectGetBoolean(entry, "unicast-overflow",
&fil->unicast.overflow) < 0) { &fil->unicast.overflow) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing or invalid 'unicast-overflow' " _("Missing or invalid 'unicast-overflow' in query-rx-filter response"));
"in query-rx-filter response"));
return -1; return -1;
} }
if ((!(table = virJSONValueObjectGetArray(entry, "unicast-table")))) { if ((!(table = virJSONValueObjectGetArray(entry, "unicast-table")))) {
@ -3689,15 +3673,13 @@ qemuMonitorJSONQueryRxFilterParse(virJSONValue *msg,
((fil->multicast.mode ((fil->multicast.mode
= virNetDevRxFilterModeTypeFromString(tmp)) < 0)) { = virNetDevRxFilterModeTypeFromString(tmp)) < 0)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing or invalid 'multicast' " _("Missing or invalid 'multicast' in query-rx-filter response"));
"in query-rx-filter response"));
return -1; return -1;
} }
if (virJSONValueObjectGetBoolean(entry, "multicast-overflow", if (virJSONValueObjectGetBoolean(entry, "multicast-overflow",
&fil->multicast.overflow) < 0) { &fil->multicast.overflow) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing or invalid 'multicast-overflow' " _("Missing or invalid 'multicast-overflow' in query-rx-filter response"));
"in query-rx-filter response"));
return -1; return -1;
} }
if ((!(table = virJSONValueObjectGetArray(entry, "multicast-table")))) { if ((!(table = virJSONValueObjectGetArray(entry, "multicast-table")))) {
@ -3728,8 +3710,7 @@ qemuMonitorJSONQueryRxFilterParse(virJSONValue *msg,
((fil->vlan.mode ((fil->vlan.mode
= virNetDevRxFilterModeTypeFromString(tmp)) < 0)) { = virNetDevRxFilterModeTypeFromString(tmp)) < 0)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing or invalid 'vlan' " _("Missing or invalid 'vlan' in query-rx-filter response"));
"in query-rx-filter response"));
return -1; return -1;
} }
if ((!(table = virJSONValueObjectGetArray(entry, "vlan-table")))) { if ((!(table = virJSONValueObjectGetArray(entry, "vlan-table")))) {
@ -4528,8 +4509,7 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValue *io_throttle,
if (!temp_dev || virJSONValueGetType(temp_dev) != VIR_JSON_TYPE_OBJECT) { if (!temp_dev || virJSONValueGetType(temp_dev) != VIR_JSON_TYPE_OBJECT) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("block_io_throttle device entry " _("block_io_throttle device entry was not in expected format"));
"was not in expected format"));
return -1; return -1;
} }
@ -4538,8 +4518,7 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValue *io_throttle,
if (!current_drive && !current_qdev) { if (!current_drive && !current_qdev) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("block_io_throttle device entry " _("block_io_throttle device entry was not in expected format"));
"was not in expected format"));
return -1; return -1;
} }
@ -4550,8 +4529,7 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValue *io_throttle,
found = true; found = true;
if (!(inserted = virJSONValueObjectGetObject(temp_dev, "inserted"))) { if (!(inserted = virJSONValueObjectGetObject(temp_dev, "inserted"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("block_io_throttle inserted entry " _("block_io_throttle inserted entry was not in expected format"));
"was not in expected format"));
return -1; return -1;
} }
GET_THROTTLE_STATS("bps", total_bytes_sec); GET_THROTTLE_STATS("bps", total_bytes_sec);
@ -4795,8 +4773,7 @@ int qemuMonitorJSONGetMachines(qemuMonitor *mon,
if (virJSONValueObjectHasKey(child, "default-cpu-type")) { if (virJSONValueObjectHasKey(child, "default-cpu-type")) {
if (!(tmp = virJSONValueObjectGetString(child, "default-cpu-type"))) { if (!(tmp = virJSONValueObjectGetString(child, "default-cpu-type"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("query-machines reply has malformed " _("query-machines reply has malformed 'default-cpu-type' data"));
"'default-cpu-type' data"));
goto cleanup; goto cleanup;
} }
@ -4806,8 +4783,7 @@ int qemuMonitorJSONGetMachines(qemuMonitor *mon,
if (virJSONValueObjectHasKey(child, "numa-mem-supported")) { if (virJSONValueObjectHasKey(child, "numa-mem-supported")) {
if (virJSONValueObjectGetBoolean(child, "numa-mem-supported", &info->numaMemSupported) < 0) { if (virJSONValueObjectGetBoolean(child, "numa-mem-supported", &info->numaMemSupported) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("query-machines reply has malformed " _("query-machines reply has malformed 'numa-mem-supported' data"));
"'numa-mem-supported' data"));
goto cleanup; goto cleanup;
} }
} else { } else {
@ -4817,8 +4793,7 @@ int qemuMonitorJSONGetMachines(qemuMonitor *mon,
if (virJSONValueObjectHasKey(child, "default-ram-id")) { if (virJSONValueObjectHasKey(child, "default-ram-id")) {
if (!(tmp = virJSONValueObjectGetString(child, "default-ram-id"))) { if (!(tmp = virJSONValueObjectGetString(child, "default-ram-id"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("query-machines reply has malformed " _("query-machines reply has malformed 'default-ram-id' data"));
"'default-ram-id' data"));
goto cleanup; goto cleanup;
} }
@ -5243,8 +5218,7 @@ qemuMonitorJSONGetCPUModelComparison(qemuMonitor *mon,
if (!(data_result = virJSONValueObjectGetString(data, "result"))) { if (!(data_result = virJSONValueObjectGetString(data, "result"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("query-cpu-model-comparison reply data was missing " _("query-cpu-model-comparison reply data was missing 'result'"));
"'result'"));
return -1; return -1;
} }
@ -5983,30 +5957,26 @@ qemuMonitorJSONGetSEVCapabilities(qemuMonitor *mon,
if (virJSONValueObjectGetNumberUint(caps, "cbitpos", &cbitpos) < 0) { if (virJSONValueObjectGetNumberUint(caps, "cbitpos", &cbitpos) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("query-sev-capabilities reply was missing" _("query-sev-capabilities reply was missing 'cbitpos' field"));
" 'cbitpos' field"));
return -1; return -1;
} }
if (virJSONValueObjectGetNumberUint(caps, "reduced-phys-bits", if (virJSONValueObjectGetNumberUint(caps, "reduced-phys-bits",
&reduced_phys_bits) < 0) { &reduced_phys_bits) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("query-sev-capabilities reply was missing" _("query-sev-capabilities reply was missing 'reduced-phys-bits' field"));
" 'reduced-phys-bits' field"));
return -1; return -1;
} }
if (!(pdh = virJSONValueObjectGetString(caps, "pdh"))) { if (!(pdh = virJSONValueObjectGetString(caps, "pdh"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("query-sev-capabilities reply was missing" _("query-sev-capabilities reply was missing 'pdh' field"));
" 'pdh' field"));
return -1; return -1;
} }
if (!(cert_chain = virJSONValueObjectGetString(caps, "cert-chain"))) { if (!(cert_chain = virJSONValueObjectGetString(caps, "cert-chain"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("query-sev-capabilities reply was missing" _("query-sev-capabilities reply was missing 'cert-chain' field"));
" 'cert-chain' field"));
return -1; return -1;
} }
@ -7072,8 +7042,7 @@ qemuMonitorJSONGetIOThreads(qemuMonitor *mon,
if (virJSONValueObjectGetNumberInt(child, "thread-id", if (virJSONValueObjectGetNumberInt(child, "thread-id",
&info->thread_id) < 0) { &info->thread_id) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("query-iothreads reply has malformed " _("query-iothreads reply has malformed 'thread-id' data"));
"'thread-id' data"));
goto cleanup; goto cleanup;
} }
@ -7194,8 +7163,7 @@ qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitor *mon,
if (!(modelStr = virJSONValueObjectGetString(elem, "type"))) { if (!(modelStr = virJSONValueObjectGetString(elem, "type"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("query-memory-devices reply data doesn't contain " _("query-memory-devices reply data doesn't contain enum type discriminator"));
"enum type discriminator"));
return -1; return -1;
} }
@ -7206,8 +7174,7 @@ qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitor *mon,
if (!(dimminfo = virJSONValueObjectGetObject(elem, "data"))) { if (!(dimminfo = virJSONValueObjectGetObject(elem, "data"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("query-memory-devices reply data doesn't " _("query-memory-devices reply data doesn't contain enum data"));
"contain enum data"));
return -1; return -1;
} }
@ -7622,8 +7589,7 @@ qemuMonitorJSONProcessHotpluggableCpusReply(virJSONValue *vcpu,
if (entry->node_id == -1 && entry->socket_id == -1 && if (entry->node_id == -1 && entry->socket_id == -1 &&
entry->core_id == -1 && entry->thread_id == -1) { entry->core_id == -1 && entry->thread_id == -1) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("query-hotpluggable-cpus entry doesn't report " _("query-hotpluggable-cpus entry doesn't report topology information"));
"topology information"));
return -1; return -1;
} }

View File

@ -4237,8 +4237,7 @@ qemuProcessSPICEAllocatePorts(virQEMUDriver *driver,
if (needTLSPort || graphics->data.spice.tlsPort == -1) { if (needTLSPort || graphics->data.spice.tlsPort == -1) {
if (!cfg->spiceTLS) { if (!cfg->spiceTLS) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Auto allocation of spice TLS port requested " _("Auto allocation of spice TLS port requested but spice TLS is disabled in qemu.conf"));
"but spice TLS is disabled in qemu.conf"));
return -1; return -1;
} }
@ -5003,8 +5002,7 @@ qemuProcessGraphicsSetupNetworkAddress(virDomainGraphicsListenDef *glisten,
rc = qemuProcessGetNetworkAddress(glisten->network, &glisten->address); rc = qemuProcessGetNetworkAddress(glisten->network, &glisten->address);
if (rc <= -2) { if (rc <= -2) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("network-based listen isn't possible, " _("network-based listen isn't possible, network driver isn't present"));
"network driver isn't present"));
return -1; return -1;
} }
if (rc < 0) if (rc < 0)
@ -5355,8 +5353,7 @@ qemuProcessStartValidateGraphics(virDomainObj *vm)
case VIR_DOMAIN_GRAPHICS_TYPE_SPICE: case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
if (graphics->nListens > 1) { if (graphics->nListens > 1) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("QEMU does not support multiple listens for " _("QEMU does not support multiple listens for one graphics device."));
"one graphics device."));
return -1; return -1;
} }
break; break;
@ -5412,8 +5409,7 @@ qemuProcessStartValidateDisks(virDomainObj *vm,
src->protocol == VIR_STORAGE_NET_PROTOCOL_VXHS && src->protocol == VIR_STORAGE_NET_PROTOCOL_VXHS &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VXHS)) { !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VXHS)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("VxHS protocol is not supported with this " _("VxHS protocol is not supported with this QEMU binary"));
"QEMU binary"));
return -1; return -1;
} }
@ -5527,10 +5523,7 @@ qemuProcessStartValidate(virQEMUDriver *driver,
VIR_DEBUG("Checking for KVM availability"); VIR_DEBUG("Checking for KVM availability");
if (!virFileExists("/dev/kvm")) { if (!virFileExists("/dev/kvm")) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Domain requires KVM, but it is not available. " _("Domain requires KVM, but it is not available. Check that virtualization is enabled in the host BIOS, and host configuration is setup to load the kvm modules."));
"Check that virtualization is enabled in the "
"host BIOS, and host configuration is setup to "
"load the kvm modules."));
return -1; return -1;
} }
} }
@ -9149,8 +9142,7 @@ qemuProcessReconnectHelper(virDomainObj *obj,
if (virThreadCreateFull(&thread, false, qemuProcessReconnect, if (virThreadCreateFull(&thread, false, qemuProcessReconnect,
name, false, data) < 0) { name, false, data) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not create thread. QEMU initialization " _("Could not create thread. QEMU initialization might be incomplete"));
"might be incomplete"));
/* We can't spawn a thread and thus connect to monitor. Kill qemu. /* We can't spawn a thread and thus connect to monitor. Kill qemu.
* It's safe to call qemuProcessStop without a job here since there * It's safe to call qemuProcessStop without a job here since there
* is no thread that could be doing anything else with the same domain * is no thread that could be doing anything else with the same domain

View File

@ -490,8 +490,7 @@ qemuSnapshotPrepareDiskExternalActive(virDomainSnapshotDiskDef *snapdisk,
if (domdisk->device == VIR_DOMAIN_DISK_DEVICE_LUN) { if (domdisk->device == VIR_DOMAIN_DISK_DEVICE_LUN) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("external active snapshots are not supported on scsi " _("external active snapshots are not supported on scsi passthrough devices"));
"passthrough devices"));
return -1; return -1;
} }
@ -766,16 +765,14 @@ qemuSnapshotPrepare(virDomainObj *vm,
if ((def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL && !found_internal) || if ((def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL && !found_internal) ||
(found_internal && forbid_internal)) { (found_internal && forbid_internal)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("internal and full system snapshots require all " _("internal and full system snapshots require all disks to be selected for snapshot"));
"disks to be selected for snapshot"));
return -1; return -1;
} }
/* disk snapshot requires at least one disk */ /* disk snapshot requires at least one disk */
if (def->state == VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT && !external) { if (def->state == VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT && !external) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("disk-only snapshots require at least " _("disk-only snapshots require at least one disk to be selected for snapshot"));
"one disk to be selected for snapshot"));
return -1; return -1;
} }
@ -786,8 +783,7 @@ qemuSnapshotPrepare(virDomainObj *vm,
(def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL && external) || (def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL && external) ||
(def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL && found_internal)) { (def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL && found_internal)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("mixing internal and external targets for a snapshot " _("mixing internal and external targets for a snapshot is not yet supported"));
"is not yet supported"));
return -1; return -1;
} }
@ -808,8 +804,7 @@ qemuSnapshotPrepare(virDomainObj *vm,
found_internal && found_internal &&
virDomainDefHasOldStyleUEFI(vm->def)) { virDomainDefHasOldStyleUEFI(vm->def)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("internal snapshots of a VM with pflash based " _("internal snapshots of a VM with pflash based firmware are not supported"));
"firmware are not supported"));
return -1; return -1;
} }
@ -1534,8 +1529,7 @@ qemuSnapshotCreateXMLValidateDef(virDomainObj *vm,
(!virDomainObjIsActive(vm) || (!virDomainObjIsActive(vm) ||
def->memory != VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)) { def->memory != VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("live snapshot creation is supported only " _("live snapshot creation is supported only during full system snapshots"));
"during full system snapshots"));
return -1; return -1;
} }
@ -1560,8 +1554,7 @@ qemuSnapshotCreateXMLValidateDef(virDomainObj *vm,
case VIR_DOMAIN_SNAPSHOT_PMSUSPENDED: case VIR_DOMAIN_SNAPSHOT_PMSUSPENDED:
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("qemu doesn't support taking snapshots of " _("qemu doesn't support taking snapshots of PMSUSPENDED guests"));
"PMSUSPENDED guests"));
return -1; return -1;
/* invalid states */ /* invalid states */
@ -1621,8 +1614,7 @@ qemuSnapshotCreateAlignDisks(virDomainObj *vm,
if (virDomainObjIsActive(vm) && if (virDomainObjIsActive(vm) &&
def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_NO) { def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_NO) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("internal snapshot of a running VM " _("internal snapshot of a running VM must include the memory state"));
"must include the memory state"));
return -1; return -1;
} }
@ -2551,8 +2543,7 @@ qemuSnapshotRevert(virDomainObj *vm,
case VIR_DOMAIN_SNAPSHOT_PMSUSPENDED: case VIR_DOMAIN_SNAPSHOT_PMSUSPENDED:
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("qemu doesn't support reversion of snapshot taken in " _("qemu doesn't support reversion of snapshot taken in PMSUSPENDED state"));
"PMSUSPENDED state"));
goto endjob; goto endjob;
case VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT: case VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT:

View File

@ -383,9 +383,7 @@ qemuTPMEmulatorRunSetup(const char *storagepath,
if (!privileged && tpmversion == VIR_DOMAIN_TPM_VERSION_1_2 && if (!privileged && tpmversion == VIR_DOMAIN_TPM_VERSION_1_2 &&
!virTPMSwtpmSetupCapsGet(VIR_TPM_SWTPM_SETUP_FEATURE_TPM12_NOT_NEED_ROOT)) { !virTPMSwtpmSetupCapsGet(VIR_TPM_SWTPM_SETUP_FEATURE_TPM12_NOT_NEED_ROOT)) {
return virFileWriteStr(logfile, return virFileWriteStr(logfile,
_("Did not create EK and certificates since " _("Did not create EK and certificates since this requires privileged mode for a TPM 1.2\n"), 0600);
"this requires privileged mode for a "
"TPM 1.2\n"), 0600);
} }
if (!privileged && qemuTPMCreateConfigFiles(swtpm_setup) < 0) if (!privileged && qemuTPMCreateConfigFiles(swtpm_setup) < 0)

View File

@ -139,8 +139,7 @@ qemuValidateDomainDefFeatures(const virDomainDef *def,
!virQEMUCapsSupportsVmport(qemuCaps, def)) { !virQEMUCapsSupportsVmport(qemuCaps, def)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("vmport is not available " _("vmport is not available with this QEMU binary"));
"with this QEMU binary"));
return -1; return -1;
} }
break; break;
@ -149,8 +148,7 @@ qemuValidateDomainDefFeatures(const virDomainDef *def,
if (def->features[i] == VIR_TRISTATE_SWITCH_ON && if (def->features[i] == VIR_TRISTATE_SWITCH_ON &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMCOREINFO)) { !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMCOREINFO)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("vmcoreinfo is not available " _("vmcoreinfo is not available with this QEMU binary"));
"with this QEMU binary"));
return -1; return -1;
} }
break; break;
@ -828,8 +826,7 @@ qemuValidateDomainDefMemory(const virDomainDef *def,
if (mem->allocation == VIR_DOMAIN_MEMORY_ALLOCATION_ONDEMAND) { if (mem->allocation == VIR_DOMAIN_MEMORY_ALLOCATION_ONDEMAND) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("hugepages are not allowed with memory " _("hugepages are not allowed with memory allocation ondemand"));
"allocation ondemand"));
return -1; return -1;
} }
@ -842,8 +839,7 @@ qemuValidateDomainDefMemory(const virDomainDef *def,
if (mem->source == VIR_DOMAIN_MEMORY_SOURCE_ANONYMOUS) { if (mem->source == VIR_DOMAIN_MEMORY_SOURCE_ANONYMOUS) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("hugepages are not allowed with anonymous " _("hugepages are not allowed with anonymous memory source"));
"memory source"));
return -1; return -1;
} }
@ -970,15 +966,13 @@ qemuValidateDomainDefPanic(const virDomainDef *def,
* cannot be configured by the user */ * cannot be configured by the user */
if (!ARCH_IS_S390(def->os.arch)) { if (!ARCH_IS_S390(def->os.arch)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("only S390 guests support " _("only S390 guests support panic device of model 's390'"));
"panic device of model 's390'"));
return -1; return -1;
} }
if (def->panics[i]->info.type != if (def->panics[i]->info.type !=
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("setting the panic device address is not " _("setting the panic device address is not supported for model 's390'"));
"supported for model 's390'"));
return -1; return -1;
} }
break; break;
@ -989,15 +983,13 @@ qemuValidateDomainDefPanic(const virDomainDef *def,
* cannot be configured by the user */ * cannot be configured by the user */
if (!ARCH_IS_X86(def->os.arch)) { if (!ARCH_IS_X86(def->os.arch)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("only i686 and x86_64 guests support " _("only i686 and x86_64 guests support panic device of model 'hyperv'"));
"panic device of model 'hyperv'"));
return -1; return -1;
} }
if (def->panics[i]->info.type != if (def->panics[i]->info.type !=
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("setting the panic device address is not " _("setting the panic device address is not supported for model 'hyperv'"));
"supported for model 'hyperv'"));
return -1; return -1;
} }
break; break;
@ -1008,15 +1000,13 @@ qemuValidateDomainDefPanic(const virDomainDef *def,
* cannot be configured by the user */ * cannot be configured by the user */
if (!qemuDomainIsPSeries(def)) { if (!qemuDomainIsPSeries(def)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("only pSeries guests support panic device " _("only pSeries guests support panic device of model 'pseries'"));
"of model 'pseries'"));
return -1; return -1;
} }
if (def->panics[i]->info.type != if (def->panics[i]->info.type !=
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("setting the panic device address is not " _("setting the panic device address is not supported for model 'pseries'"));
"supported for model 'pseries'"));
return -1; return -1;
} }
break; break;
@ -1024,16 +1014,14 @@ qemuValidateDomainDefPanic(const virDomainDef *def,
case VIR_DOMAIN_PANIC_MODEL_ISA: case VIR_DOMAIN_PANIC_MODEL_ISA:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PANIC)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PANIC)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("the QEMU binary does not support the " _("the QEMU binary does not support the ISA panic device"));
"ISA panic device"));
return -1; return -1;
} }
if (def->panics[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && if (def->panics[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
def->panics[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_ISA) { def->panics[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_ISA) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("panic is supported only " _("panic is supported only with ISA address type"));
"with ISA address type"));
return -1; return -1;
} }
break; break;
@ -1338,8 +1326,7 @@ qemuValidateDomainDef(const virDomainDef *def,
case VIR_DOMAIN_LAUNCH_SECURITY_SEV: case VIR_DOMAIN_LAUNCH_SECURITY_SEV:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SEV_GUEST)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SEV_GUEST)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("SEV launch security is not supported with " _("SEV launch security is not supported with this QEMU binary"));
"this QEMU binary"));
return -1; return -1;
} }
@ -1734,8 +1721,7 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNetDef *net,
} }
if (net->guestIP.nroutes) { if (net->guestIP.nroutes) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Invalid attempt to set network interface " _("Invalid attempt to set network interface guest-side IP route, not supported by QEMU"));
"guest-side IP route, not supported by QEMU"));
return -1; return -1;
} }
@ -1751,8 +1737,7 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNetDef *net,
if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET)) { if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET)) {
if (hasIPv4) { if (hasIPv4) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Only one IPv4 address per " _("Only one IPv4 address per interface is allowed"));
"interface is allowed"));
return -1; return -1;
} }
hasIPv4 = true; hasIPv4 = true;
@ -1768,8 +1753,7 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNetDef *net,
if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET6)) { if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET6)) {
if (hasIPv6) { if (hasIPv6) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Only one IPv6 address per " _("Only one IPv6 address per interface is allowed"));
"interface is allowed"));
return -1; return -1;
} }
hasIPv6 = true; hasIPv6 = true;
@ -1804,9 +1788,7 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNetDef *net,
} }
} else if (net->guestIP.nroutes || net->guestIP.nips) { } else if (net->guestIP.nroutes || net->guestIP.nips) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Invalid attempt to set network interface " _("Invalid attempt to set network interface guest-side IP route and/or address info, not supported by QEMU"));
"guest-side IP route and/or address info, "
"not supported by QEMU"));
return -1; return -1;
} }
@ -2204,8 +2186,7 @@ qemuValidateDomainRNGDef(const virDomainRNGDef *def,
case VIR_DOMAIN_RNG_BACKEND_RANDOM: case VIR_DOMAIN_RNG_BACKEND_RANDOM:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_RNG_RANDOM)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_RNG_RANDOM)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("this qemu doesn't support the rng-random " _("this qemu doesn't support the rng-random backend"));
"backend"));
return -1; return -1;
} }
break; break;
@ -2213,8 +2194,7 @@ qemuValidateDomainRNGDef(const virDomainRNGDef *def,
case VIR_DOMAIN_RNG_BACKEND_EGD: case VIR_DOMAIN_RNG_BACKEND_EGD:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_RNG_EGD)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_RNG_EGD)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("this qemu doesn't support the rng-egd " _("this qemu doesn't support the rng-egd backend"));
"backend"));
return -1; return -1;
} }
@ -2228,8 +2208,7 @@ qemuValidateDomainRNGDef(const virDomainRNGDef *def,
case VIR_DOMAIN_RNG_BACKEND_BUILTIN: case VIR_DOMAIN_RNG_BACKEND_BUILTIN:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_RNG_BUILTIN)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_RNG_BUILTIN)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("this qemu doesn't support the rng-builtin " _("this qemu doesn't support the rng-builtin backend"));
"backend"));
return -1; return -1;
} }
break; break;
@ -2270,16 +2249,14 @@ qemuValidateDomainRedirdevDef(const virDomainRedirdevDef *dev,
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_USB_REDIR)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_USB_REDIR)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("USB redirection is not supported " _("USB redirection is not supported by this version of QEMU"));
"by this version of QEMU"));
return -1; return -1;
} }
if (def->redirfilter && def->redirfilter->nusbdevs && if (def->redirfilter && def->redirfilter->nusbdevs &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_USB_REDIR_FILTER)) { !virQEMUCapsGet(qemuCaps, QEMU_CAPS_USB_REDIR_FILTER)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("USB redirection filter is not " _("USB redirection filter is not supported by this version of QEMU"));
"supported by this version of QEMU"));
return -1; return -1;
} }
@ -2298,8 +2275,7 @@ qemuValidateDomainWatchdogDef(const virDomainWatchdogDef *dev,
if (def->nwatchdogs && if (def->nwatchdogs &&
def->watchdogs[0]->action != dev->action) { def->watchdogs[0]->action != dev->action) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("watchdogs with different actions are not supported " _("watchdogs with different actions are not supported with this QEMU binary"));
"with this QEMU binary"));
return -1; return -1;
} }
@ -2379,17 +2355,14 @@ qemuValidateDomainMdevDefVFIOPCI(const virDomainHostdevDef *hostdev,
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("VFIO PCI device assignment is not " _("VFIO PCI device assignment is not supported by this version of QEMU"));
"supported by this version of QEMU"));
return -1; return -1;
} }
/* VFIO-PCI does not support boot */ /* VFIO-PCI does not support boot */
if (hostdev->info->bootIndex) { if (hostdev->info->bootIndex) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("booting from assigned devices is not " _("booting from assigned devices is not supported by mediated devices of model vfio-pci"));
"supported by mediated devices of "
"model vfio-pci"));
return -1; return -1;
} }
@ -2399,15 +2372,13 @@ qemuValidateDomainMdevDefVFIOPCI(const virDomainHostdevDef *hostdev,
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VFIO_PCI_DISPLAY)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VFIO_PCI_DISPLAY)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("display property of device vfio-pci is " _("display property of device vfio-pci is not supported by this version of QEMU"));
"not supported by this version of QEMU"));
return -1; return -1;
} }
if (dev->model != VIR_MDEV_MODEL_TYPE_VFIO_PCI) { if (dev->model != VIR_MDEV_MODEL_TYPE_VFIO_PCI) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("<hostdev> attribute 'display' is only supported" _("<hostdev> attribute 'display' is only supported with model='vfio-pci'"));
" with model='vfio-pci'"));
return -1; return -1;
} }
@ -2415,8 +2386,7 @@ qemuValidateDomainMdevDefVFIOPCI(const virDomainHostdevDef *hostdev,
if (dev->display == VIR_TRISTATE_SWITCH_ON) { if (dev->display == VIR_TRISTATE_SWITCH_ON) {
if (def->ngraphics == 0) { if (def->ngraphics == 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("graphics device is needed for attribute value " _("graphics device is needed for attribute value 'display=on' in <hostdev>"));
"'display=on' in <hostdev>"));
return -1; return -1;
} }
} }
@ -2435,17 +2405,14 @@ qemuValidateDomainMdevDefVFIOAP(const virDomainHostdevDef *hostdev,
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_AP)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_AP)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("VFIO AP device assignment is not " _("VFIO AP device assignment is not supported by this version of QEMU"));
"supported by this version of QEMU"));
return -1; return -1;
} }
/* VFIO-AP does not support boot */ /* VFIO-AP does not support boot */
if (hostdev->info->bootIndex) { if (hostdev->info->bootIndex) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("booting from assigned devices is not " _("booting from assigned devices is not supported by mediated devices of model vfio-ap"));
"supported by mediated devices of "
"model vfio-ap"));
return -1; return -1;
} }
@ -2457,8 +2424,7 @@ qemuValidateDomainMdevDefVFIOAP(const virDomainHostdevDef *hostdev,
hdev->source.subsys.u.mdev.model == VIR_MDEV_MODEL_TYPE_VFIO_AP) { hdev->source.subsys.u.mdev.model == VIR_MDEV_MODEL_TYPE_VFIO_AP) {
if (vfioap_found) { if (vfioap_found) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Only one hostdev of model vfio-ap is " _("Only one hostdev of model vfio-ap is supported"));
"supported"));
return -1; return -1;
} }
vfioap_found = true; vfioap_found = true;
@ -2485,8 +2451,7 @@ qemuValidateDomainMdevDef(const virDomainHostdevDef *hostdev,
case VIR_MDEV_MODEL_TYPE_VFIO_CCW: case VIR_MDEV_MODEL_TYPE_VFIO_CCW:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_CCW)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_CCW)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("VFIO CCW device assignment is not " _("VFIO CCW device assignment is not supported by this version of QEMU"));
"supported by this version of QEMU"));
return -1; return -1;
} }
break; break;
@ -2536,16 +2501,14 @@ qemuValidateDomainDeviceDefHostdev(const virDomainHostdevDef *hostdev,
if (backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) { if (backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("VFIO PCI device assignment is not " _("VFIO PCI device assignment is not supported by this version of qemu"));
"supported by this version of qemu"));
return -1; return -1;
} }
} }
if (hostdev->writeFiltering != VIR_TRISTATE_BOOL_ABSENT) { if (hostdev->writeFiltering != VIR_TRISTATE_BOOL_ABSENT) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Write filtering of PCI device configuration " _("Write filtering of PCI device configuration space is not supported by qemu"));
"space is not supported by qemu"));
return -1; return -1;
} }
break; break;
@ -2553,8 +2516,7 @@ qemuValidateDomainDeviceDefHostdev(const virDomainHostdevDef *hostdev,
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
if (hostdev->info->bootIndex) { if (hostdev->info->bootIndex) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("booting from assigned devices is not " _("booting from assigned devices is not supported by vhost SCSI devices"));
"supported by vhost SCSI devices"));
return -1; return -1;
} }
@ -2639,8 +2601,7 @@ qemuValidateDomainDeviceDefVideo(const virDomainVideoDef *video,
if (video->vgamem) { if (video->vgamem) {
if (video->vgamem < 1024) { if (video->vgamem < 1024) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("value for 'vgamem' must be at least 1 MiB " _("value for 'vgamem' must be at least 1 MiB (1024 KiB)"));
"(1024 KiB)"));
return -1; return -1;
} }
@ -2666,9 +2627,8 @@ qemuValidateDomainDeviceDefVideo(const virDomainVideoDef *video,
if (video->type == VIR_DOMAIN_VIDEO_TYPE_VGA || if (video->type == VIR_DOMAIN_VIDEO_TYPE_VGA ||
video->type == VIR_DOMAIN_VIDEO_TYPE_VMVGA) { video->type == VIR_DOMAIN_VIDEO_TYPE_VMVGA) {
if (video->vram && video->vram < 1024) { if (video->vram && video->vram < 1024) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
"%s", _("value for 'vram' must be at least " _("value for 'vram' must be at least 1 MiB (1024 KiB)"));
"1 MiB (1024 KiB)"));
return -1; return -1;
} }
} }
@ -2867,8 +2827,7 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDomainDiskDef *disk,
if (disk->bus == VIR_DOMAIN_DISK_BUS_SCSI && if (disk->bus == VIR_DOMAIN_DISK_BUS_SCSI &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_BLOCK)) { !virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_BLOCK)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("This QEMU doesn't support scsi-block for " _("This QEMU doesn't support scsi-block for lun passthrough"));
"lun passthrough"));
return -1; return -1;
} }
@ -2887,8 +2846,7 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDomainDiskDef *disk,
} }
if (disk->vendor || disk->product) { if (disk->vendor || disk->product) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Setting vendor or product is not supported " _("Setting vendor or product is not supported for lun device"));
"for lun device"));
return -1; return -1;
} }
} }
@ -2960,8 +2918,7 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDomainDiskDef *disk,
case VIR_DOMAIN_DISK_BUS_USB: case VIR_DOMAIN_DISK_BUS_USB:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_STORAGE)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_STORAGE)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("This QEMU doesn't support '-device " _("This QEMU doesn't support '-device usb-storage'"));
"usb-storage'"));
return -1; return -1;
} }
@ -3025,8 +2982,7 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDomainDiskDef *disk,
disk->bus == VIR_DOMAIN_DISK_BUS_SCSI && disk->bus == VIR_DOMAIN_DISK_BUS_SCSI &&
disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) { disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("scsi-block 'lun' devices do not support the " _("scsi-block 'lun' devices do not support the serial property"));
"serial property"));
return -1; return -1;
} }
@ -3056,8 +3012,7 @@ qemuValidateDomainDeviceDefDiskBlkdeviotune(const virDomainDiskDef *disk,
if (disk->blkdeviotune.group_name && if (disk->blkdeviotune.group_name &&
!virDomainBlockIoTuneInfoHasAny(&disk->blkdeviotune)) { !virDomainBlockIoTuneInfoHasAny(&disk->blkdeviotune)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("group_name can be configured only together with " _("group_name can be configured only together with settings"));
"settings"));
return -1; return -1;
} }
@ -3285,8 +3240,7 @@ qemuValidateCheckSCSIControllerModel(virQEMUCaps *qemuCaps,
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC: case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_LSI)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_LSI)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("This QEMU doesn't support " _("This QEMU doesn't support the LSI 53C895A SCSI controller"));
"the LSI 53C895A SCSI controller"));
return false; return false;
} }
break; break;
@ -3295,8 +3249,7 @@ qemuValidateCheckSCSIControllerModel(virQEMUCaps *qemuCaps,
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_NON_TRANSITIONAL: case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_NON_TRANSITIONAL:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_SCSI)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_SCSI)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("This QEMU doesn't support " _("This QEMU doesn't support virtio scsi controller"));
"virtio scsi controller"));
return false; return false;
} }
break; break;
@ -3306,24 +3259,21 @@ qemuValidateCheckSCSIControllerModel(virQEMUCaps *qemuCaps,
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1068: case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1068:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_MPTSAS1068)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_MPTSAS1068)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("This QEMU doesn't support " _("This QEMU doesn't support the LSI SAS1068 (MPT Fusion) controller"));
"the LSI SAS1068 (MPT Fusion) controller"));
return false; return false;
} }
break; break;
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1078: case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1078:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_MEGASAS)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_MEGASAS)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("This QEMU doesn't support " _("This QEMU doesn't support the LSI SAS1078 (MegaRAID) controller"));
"the LSI SAS1078 (MegaRAID) controller"));
return false; return false;
} }
break; break;
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VMPVSCSI: case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VMPVSCSI:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_PVSCSI)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_PVSCSI)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("This QEMU doesn't support " _("This QEMU doesn't support the pvscsi (VMware paravirtual SCSI) controller"));
"the pvscsi (VMware paravirtual SCSI) controller"));
return false; return false;
} }
break; break;
@ -3336,22 +3286,19 @@ qemuValidateCheckSCSIControllerModel(virQEMUCaps *qemuCaps,
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_NCR53C90: case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_NCR53C90:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_NCR53C90)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_NCR53C90)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("This QEMU doesn't support " _("This QEMU doesn't support the NCR53C90 (ESP) controller"));
"the NCR53C90 (ESP) controller"));
} }
return true; return true;
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_DC390: case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_DC390:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_DC390)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_DC390)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("This QEMU doesn't support " _("This QEMU doesn't support the DC390 (ESP) controller"));
"the DC390 (ESP) controller"));
} }
return true; return true;
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_AM53C974: case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_AM53C974:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_AM53C974)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_AM53C974)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("This QEMU doesn't support " _("This QEMU doesn't support the AM53C974 (ESP) controller"));
"the AM53C974 (ESP) controller"));
} }
return true; return true;
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_DEFAULT: case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_DEFAULT:
@ -3401,12 +3348,10 @@ qemuValidateDomainDeviceDefControllerIDE(const virDomainControllerDef *controlle
*/ */
if (qemuDomainHasBuiltinIDE(def)) if (qemuDomainHasBuiltinIDE(def))
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Only a single IDE controller is supported " _("Only a single IDE controller is supported for this machine type"));
"for this machine type"));
else else
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("IDE controllers are unsupported for " _("IDE controllers are unsupported for this QEMU binary or machine type"));
"this QEMU binary or machine type"));
return -1; return -1;
} }
@ -3432,8 +3377,7 @@ qemuValidateCheckSCSIControllerIOThreads(const virDomainControllerDef *controlle
controller->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI && controller->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
controller->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) { controller->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("virtio-scsi IOThreads only available for virtio " _("virtio-scsi IOThreads only available for virtio pci and virtio ccw controllers"));
"pci and virtio ccw controllers"));
return false; return false;
} }
@ -4154,8 +4098,7 @@ qemuValidateDomainDeviceDefSPICEGraphics(const virDomainGraphicsDef *graphics,
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK: case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK:
if (tlsPort > 0 && !cfg->spiceTLS) { if (tlsPort > 0 && !cfg->spiceTLS) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("spice TLS port set in XML configuration, " _("spice TLS port set in XML configuration, but TLS is disabled in qemu.conf"));
"but TLS is disabled in qemu.conf"));
return -1; return -1;
} }
break; break;
@ -4262,8 +4205,7 @@ qemuValidateDomainDeviceDefGraphics(const virDomainGraphicsDef *graphics,
graphics->type != VIR_DOMAIN_GRAPHICS_TYPE_VNC && graphics->type != VIR_DOMAIN_GRAPHICS_TYPE_VNC &&
graphics->type != VIR_DOMAIN_GRAPHICS_TYPE_SPICE) { graphics->type != VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("graphics type 'egl-headless' is only supported " _("graphics type 'egl-headless' is only supported with one of: 'vnc', 'spice' graphics types"));
"with one of: 'vnc', 'spice' graphics types"));
return -1; return -1;
} }
@ -4273,8 +4215,7 @@ qemuValidateDomainDeviceDefGraphics(const virDomainGraphicsDef *graphics,
if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE && if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE &&
graphics->data.spice.gl == VIR_TRISTATE_BOOL_YES) { graphics->data.spice.gl == VIR_TRISTATE_BOOL_YES) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("multiple OpenGL displays are not supported " _("multiple OpenGL displays are not supported by QEMU"));
"by QEMU"));
return -1; return -1;
} }
} }
@ -4291,8 +4232,7 @@ qemuValidateDomainDeviceDefGraphics(const virDomainGraphicsDef *graphics,
if (graphics->data.egl_headless.rendernode && if (graphics->data.egl_headless.rendernode &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_EGL_HEADLESS_RENDERNODE)) { !virQEMUCapsGet(qemuCaps, QEMU_CAPS_EGL_HEADLESS_RENDERNODE)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("This QEMU doesn't support OpenGL rendernode " _("This QEMU doesn't support OpenGL rendernode with egl-headless graphics type"));
"with egl-headless graphics type"));
return -1; return -1;
} }
@ -4555,16 +4495,14 @@ qemuValidateDomainDeviceDefSound(virDomainSoundDef *sound,
case VIR_DOMAIN_SOUND_MODEL_USB: case VIR_DOMAIN_SOUND_MODEL_USB:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_USB_AUDIO)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_USB_AUDIO)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("usb-audio controller is not supported " _("usb-audio controller is not supported by this QEMU binary"));
"by this QEMU binary"));
return -1; return -1;
} }
break; break;
case VIR_DOMAIN_SOUND_MODEL_ICH9: case VIR_DOMAIN_SOUND_MODEL_ICH9:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_ICH9_INTEL_HDA)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_ICH9_INTEL_HDA)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("The ich9-intel-hda audio controller " _("The ich9-intel-hda audio controller is not supported in this QEMU binary"));
"is not supported in this QEMU binary"));
return -1; return -1;
} }
break; break;
@ -4609,8 +4547,7 @@ qemuValidateDomainDeviceDefVsock(virQEMUCaps *qemuCaps)
{ {
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VHOST_VSOCK)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VHOST_VSOCK)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("vsock device is not supported " _("vsock device is not supported with this QEMU binary"));
"with this QEMU binary"));
return -1; return -1;
} }
@ -4716,8 +4653,7 @@ qemuValidateDomainDeviceDefInput(const virDomainInputDef *input,
input->type == VIR_DOMAIN_INPUT_TYPE_KBD && input->type == VIR_DOMAIN_INPUT_TYPE_KBD &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_KBD)) { !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_KBD)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("usb keyboard is not supported by this " _("usb keyboard is not supported by this QEMU binary"));
"QEMU binary"));
return -1; return -1;
} }
@ -4904,36 +4840,31 @@ qemuValidateDomainDeviceDefIOMMU(const virDomainIOMMUDef *iommu,
if (iommu->intremap != VIR_TRISTATE_SWITCH_ABSENT && if (iommu->intremap != VIR_TRISTATE_SWITCH_ABSENT &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_INTREMAP)) { !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_INTREMAP)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("iommu: interrupt remapping is not supported " _("iommu: interrupt remapping is not supported with this QEMU binary"));
"with this QEMU binary"));
return -1; return -1;
} }
if (iommu->caching_mode != VIR_TRISTATE_SWITCH_ABSENT && if (iommu->caching_mode != VIR_TRISTATE_SWITCH_ABSENT &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_CACHING_MODE)) { !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_CACHING_MODE)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("iommu: caching mode is not supported " _("iommu: caching mode is not supported with this QEMU binary"));
"with this QEMU binary"));
return -1; return -1;
} }
if (iommu->eim != VIR_TRISTATE_SWITCH_ABSENT && if (iommu->eim != VIR_TRISTATE_SWITCH_ABSENT &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_EIM)) { !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_EIM)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("iommu: eim is not supported " _("iommu: eim is not supported with this QEMU binary"));
"with this QEMU binary"));
return -1; return -1;
} }
if (iommu->iotlb != VIR_TRISTATE_SWITCH_ABSENT && if (iommu->iotlb != VIR_TRISTATE_SWITCH_ABSENT &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB)) { !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("iommu: device IOTLB is not supported " _("iommu: device IOTLB is not supported with this QEMU binary"));
"with this QEMU binary"));
return -1; return -1;
} }
if (iommu->aw_bits > 0 && if (iommu->aw_bits > 0 &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_AW_BITS)) { !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_AW_BITS)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("iommu: aw_bits is not supported " _("iommu: aw_bits is not supported with this QEMU binary"));
"with this QEMU binary"));
return -1; return -1;
} }
@ -4952,8 +4883,7 @@ qemuValidateDomainDeviceDefNVRAM(virDomainNVRAMDef *nvram,
if (qemuDomainIsPSeries(def)) { if (qemuDomainIsPSeries(def)) {
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_NVRAM)) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_NVRAM)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("nvram device is not supported by " _("nvram device is not supported by this QEMU binary"));
"this QEMU binary"));
return -1; return -1;
} }
} else { } else {
@ -5021,8 +4951,7 @@ qemuValidateDomainDeviceDefMemory(virDomainMemoryDef *mem,
if (mem->target.nvdimm.readonly && if (mem->target.nvdimm.readonly &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_NVDIMM_UNARMED)) { !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_NVDIMM_UNARMED)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("nvdimm readonly property is not available " _("nvdimm readonly property is not available with this QEMU binary"));
"with this QEMU binary"));
return -1; return -1;
} }
break; break;