|
|
357786 |
From d3f4feea8023be7c0c3db09e4ea1a24a34f8c4a9 Mon Sep 17 00:00:00 2001
|
|
|
357786 |
From: Igor Mammedov <imammedo@redhat.com>
|
|
|
357786 |
Date: Wed, 31 Jan 2018 10:44:31 +0100
|
|
|
357786 |
Subject: spapr: disable memory hotplug
|
|
|
357786 |
|
|
|
357786 |
RH-Author: Igor Mammedov <imammedo@redhat.com>
|
|
|
357786 |
Message-id: <1517395471-44118-1-git-send-email-imammedo@redhat.com>
|
|
|
357786 |
Patchwork-id: 78748
|
|
|
357786 |
O-Subject: [RHV7.5 qemu-kvm-ma PATCH v3] spapr: disable memory hotplug
|
|
|
357786 |
Bugzilla: 1535952
|
|
|
357786 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
357786 |
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
|
|
|
357786 |
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
|
|
357786 |
|
|
|
357786 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1535952
|
|
|
357786 |
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=15146188
|
|
|
357786 |
Upstream: RHEL-only
|
|
|
357786 |
|
|
|
357786 |
Disable memory hotplug for qemu-kvm-ma variant of QEMU where
|
|
|
357786 |
shouldn't be supported.
|
|
|
357786 |
Use CONFIG_RHV to switch feature off only for qemu-kvm-ma and
|
|
|
357786 |
not to affect RHEV variant built from the same source code.
|
|
|
357786 |
|
|
|
357786 |
PS:
|
|
|
357786 |
Disable only (un)plug entry points from device_add/del and
|
|
|
357786 |
leave the rest of hotplug hw intact so that -ma machine
|
|
|
357786 |
could be migrated to -rhev.
|
|
|
357786 |
Note: backward migration would be broken if source -rhev
|
|
|
357786 |
machine used pc-dimm devices (either with -device/device_add)
|
|
|
357786 |
|
|
|
357786 |
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
|
|
|
357786 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
357786 |
(cherry picked from commit bf05b668e4248781d24cfba88bfb9647ca6ca14e)
|
|
|
357786 |
(cherry picked from commit dd0871512012fbbe343361bd3ff6fa21545c41d5)
|
|
|
357786 |
(cherry picked from commit d42b9faa86dfd70e4ba6b8f2bf108d0e21a1a65d)
|
|
|
357786 |
---
|
|
|
357786 |
hw/ppc/spapr.c | 8 ++++++++
|
|
|
357786 |
1 file changed, 8 insertions(+)
|
|
|
357786 |
|
|
|
357786 |
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
|
|
|
357786 |
index f71a62e..360a258 100644
|
|
|
357786 |
--- a/hw/ppc/spapr.c
|
|
|
357786 |
+++ b/hw/ppc/spapr.c
|
|
|
357786 |
@@ -3070,6 +3070,9 @@ out:
|
|
|
357786 |
static void spapr_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
|
|
|
357786 |
Error **errp)
|
|
|
357786 |
{
|
|
|
357786 |
+#if !defined(CONFIG_RHV)
|
|
|
357786 |
+ error_setg(errp, "Memory hotplug not supported for this machine");
|
|
|
357786 |
+#else
|
|
|
357786 |
PCDIMMDevice *dimm = PC_DIMM(dev);
|
|
|
357786 |
PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm);
|
|
|
357786 |
MemoryRegion *mr;
|
|
|
357786 |
@@ -3097,6 +3100,7 @@ static void spapr_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
|
|
|
357786 |
|
|
|
357786 |
out:
|
|
|
357786 |
g_free(mem_dev);
|
|
|
357786 |
+#endif
|
|
|
357786 |
}
|
|
|
357786 |
|
|
|
357786 |
struct sPAPRDIMMState {
|
|
|
357786 |
@@ -3210,6 +3214,9 @@ void spapr_lmb_release(DeviceState *dev)
|
|
|
357786 |
static void spapr_memory_unplug_request(HotplugHandler *hotplug_dev,
|
|
|
357786 |
DeviceState *dev, Error **errp)
|
|
|
357786 |
{
|
|
|
357786 |
+#if !defined(CONFIG_RHV)
|
|
|
357786 |
+ error_setg(errp, "Memory hot unplug not supported for this machine");
|
|
|
357786 |
+#else
|
|
|
357786 |
sPAPRMachineState *spapr = SPAPR_MACHINE(hotplug_dev);
|
|
|
357786 |
Error *local_err = NULL;
|
|
|
357786 |
PCDIMMDevice *dimm = PC_DIMM(dev);
|
|
|
357786 |
@@ -3264,6 +3271,7 @@ static void spapr_memory_unplug_request(HotplugHandler *hotplug_dev,
|
|
|
357786 |
nr_lmbs, spapr_drc_index(drc));
|
|
|
357786 |
out:
|
|
|
357786 |
error_propagate(errp, local_err);
|
|
|
357786 |
+#endif
|
|
|
357786 |
}
|
|
|
357786 |
|
|
|
357786 |
static void *spapr_populate_hotplug_cpu_dt(CPUState *cs, int *fdt_offset,
|
|
|
357786 |
--
|
|
|
357786 |
1.8.3.1
|
|
|
357786 |
|