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 <pkrempa@xxxxxxxxxx> --- 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 6533106cdd..993f0e7bd2 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); -- 2.20.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list