qemu: domain: Extract panic device def post parse code
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
9647a95c37
commit
43afdc3e3f
@ -5765,6 +5765,23 @@ qemuDomainDeviceVideoDefPostParse(virDomainVideoDefPtr video,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int
|
||||||
|
qemuDomainDevicePanicDefPostParse(virDomainPanicDefPtr panic,
|
||||||
|
const virDomainDef *def)
|
||||||
|
{
|
||||||
|
if (panic->model == VIR_DOMAIN_PANIC_MODEL_DEFAULT) {
|
||||||
|
if (qemuDomainIsPSeries(def))
|
||||||
|
panic->model = VIR_DOMAIN_PANIC_MODEL_PSERIES;
|
||||||
|
else if (ARCH_IS_S390(def->os.arch))
|
||||||
|
panic->model = VIR_DOMAIN_PANIC_MODEL_S390;
|
||||||
|
else
|
||||||
|
panic->model = VIR_DOMAIN_PANIC_MODEL_ISA;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
|
qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
|
||||||
const virDomainDef *def,
|
const virDomainDef *def,
|
||||||
@ -5794,14 +5811,8 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (dev->type == VIR_DOMAIN_DEVICE_PANIC &&
|
if (dev->type == VIR_DOMAIN_DEVICE_PANIC &&
|
||||||
dev->data.panic->model == VIR_DOMAIN_PANIC_MODEL_DEFAULT) {
|
qemuDomainDevicePanicDefPostParse(dev->data.panic, def) < 0)
|
||||||
if (qemuDomainIsPSeries(def))
|
goto cleanup;
|
||||||
dev->data.panic->model = VIR_DOMAIN_PANIC_MODEL_PSERIES;
|
|
||||||
else if (ARCH_IS_S390(def->os.arch))
|
|
||||||
dev->data.panic->model = VIR_DOMAIN_PANIC_MODEL_S390;
|
|
||||||
else
|
|
||||||
dev->data.panic->model = VIR_DOMAIN_PANIC_MODEL_ISA;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dev->type == VIR_DOMAIN_DEVICE_CONTROLLER &&
|
if (dev->type == VIR_DOMAIN_DEVICE_CONTROLLER &&
|
||||||
qemuDomainControllerDefPostParse(dev->data.controller, def,
|
qemuDomainControllerDefPostParse(dev->data.controller, def,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user