Blame SOURCES/0034-spapr-disable-memory-hotplug.patch

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