spapr: Allow memory unplug to always succeed
commit1e8b5b1aa16b7d73ba8ba52c95d0b52329d5c9d0
authorGreg Kurz <groug@kaod.org>
Mon, 14 Dec 2020 10:05:50 +0000 (14 11:05 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 6 Jan 2021 00:09:59 +0000 (6 11:09 +1100)
tree635d0e1e6cd542f1b65b394e4a4af3c1669e8fbc
parent776e887f088a93c0c45b2fb98dbb737a6e7cf0ed
spapr: Allow memory unplug to always succeed

It is currently impossible to hot-unplug a memory device between
machine reset and CAS.

(qemu) device_del dimm1
Error: Memory hot unplug not supported for this guest

This limitation was introduced in order to provide an explicit
error path for older guests that didn't support hot-plug event
sources (and thus memory hot-unplug).

The linux kernel has been supporting these since 4.11. All recent
enough guests are thus capable of handling the removal of a memory
device at all time, including during early boot.

Lift the limitation for the latest machine type. This means that
trying to unplug memory from a guest that doesn't support it will
likely just do nothing and the memory will only get removed at
next reboot. Such older guests can still get the existing behavior
by using an older machine type.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <160794035064.23292.17560963281911312439.stgit@bahia.lan>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr.c
hw/ppc/spapr_events.c
include/hw/ppc/spapr.h