mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-18 10:35:20 +00:00
conf: add panic model 'pvpanic'
This patch introduces optional device pvpanic-pci, validates its address and generates command line. Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
741624a1a6
commit
46ef87e10e
@ -859,6 +859,7 @@ VIR_ENUM_IMPL(virDomainPanicModel,
|
||||
"pseries",
|
||||
"hyperv",
|
||||
"s390",
|
||||
"pvpanic",
|
||||
);
|
||||
|
||||
VIR_ENUM_IMPL(virDomainVideoBackend,
|
||||
|
@ -2676,6 +2676,7 @@ typedef enum {
|
||||
VIR_DOMAIN_PANIC_MODEL_PSERIES,
|
||||
VIR_DOMAIN_PANIC_MODEL_HYPERV,
|
||||
VIR_DOMAIN_PANIC_MODEL_S390,
|
||||
VIR_DOMAIN_PANIC_MODEL_PVPANIC,
|
||||
|
||||
VIR_DOMAIN_PANIC_MODEL_LAST
|
||||
} virDomainPanicModel;
|
||||
|
@ -8289,6 +8289,7 @@
|
||||
<value>pseries</value>
|
||||
<value>hyperv</value>
|
||||
<value>s390</value>
|
||||
<value>pvpanic</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
|
@ -9557,6 +9557,23 @@ qemuBuildPanicCommandLine(virCommand *cmd,
|
||||
break;
|
||||
}
|
||||
|
||||
case VIR_DOMAIN_PANIC_MODEL_PVPANIC: {
|
||||
g_autoptr(virJSONValue) props = NULL;
|
||||
|
||||
if (virJSONValueObjectAdd(&props,
|
||||
"s:driver", "pvpanic-pci",
|
||||
NULL) < 0)
|
||||
return -1;
|
||||
|
||||
if (qemuBuildDeviceAddressProps(props, def, &def->panics[i]->info) < 0)
|
||||
return -1;
|
||||
|
||||
if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCaps) < 0)
|
||||
return -1;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case VIR_DOMAIN_PANIC_MODEL_S390:
|
||||
case VIR_DOMAIN_PANIC_MODEL_HYPERV:
|
||||
case VIR_DOMAIN_PANIC_MODEL_PSERIES:
|
||||
|
@ -1146,6 +1146,20 @@ qemuValidateDomainDefPanic(const virDomainDef *def,
|
||||
}
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_PANIC_MODEL_PVPANIC:
|
||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PANIC_PCI)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("the QEMU binary does not support the PCI pvpanic device"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (def->panics[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("pvpanic is supported only with PCI address type"));
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
|
||||
/* default model value was changed before in post parse */
|
||||
case VIR_DOMAIN_PANIC_MODEL_DEFAULT:
|
||||
case VIR_DOMAIN_PANIC_MODEL_LAST:
|
||||
|
Loading…
x
Reference in New Issue
Block a user