From ab5d49d46c4f11baae232e04cacd514de1d86fe9 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 22 Jan 2019 12:14:39 +0100 Subject: [PATCH] qemu: process: Handle all failure values for dimms in qemuProcessHandleAcpiOstInfo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hanlde all the possible failure codes as per ACPI standard documented in the function header. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1660410 Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- src/qemu/qemu_process.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 08e3156c37..8120201eb6 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1403,14 +1403,20 @@ qemuProcessHandleAcpiOstInfo(qemuMonitorPtr mon ATTRIBUTE_UNUSED, "slotType='%s' slot='%s' source=%u status=%u", NULLSTR(alias), vm, vm->def->name, slotType, slot, source, status); - /* handle memory unplug failure */ - if (STREQ(slotType, "DIMM") && alias && status == 1) { - qemuDomainSignalDeviceRemoval(vm, alias, - QEMU_DOMAIN_UNPLUGGING_DEVICE_STATUS_GUEST_REJECTED); + if (!alias) + goto cleanup; + + if (STREQ(slotType, "DIMM")) { + if ((source == 0x003 || source == 0x103) && + (status == 0x01 || (status >= 0x80 && status <= 0x83))) { + qemuDomainSignalDeviceRemoval(vm, alias, + QEMU_DOMAIN_UNPLUGGING_DEVICE_STATUS_GUEST_REJECTED); - event = virDomainEventDeviceRemovalFailedNewFromObj(vm, alias); + event = virDomainEventDeviceRemovalFailedNewFromObj(vm, alias); + } } + cleanup: virObjectUnlock(vm); virObjectEventStateQueue(driver->domainEventState, event); -- GitLab