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

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