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

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