From c696816dcc081732333613a69b5eae382db5366cc539c19e1ca1f00019206f71 Mon Sep 17 00:00:00 2001 From: Bruce Rogers Date: Mon, 29 Jan 2018 23:38:40 +0000 Subject: [PATCH] Accepting request 570792 from home:bfrogers:branches:Virtualization Fix machine inconsistency with -no-acpi and nvdimm (bsc#1077823) OBS-URL: https://build.opensuse.org/request/show/570792 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=388 --- ...-pc-fail-memory-hot-plug-unplug-with.patch | 61 +++++++++++++++++++ qemu-linux-user.changes | 7 +++ qemu-linux-user.spec | 2 + qemu-testsuite.changes | 7 +++ qemu-testsuite.spec | 2 + qemu.changes | 7 +++ qemu.spec | 2 + 7 files changed, 88 insertions(+) create mode 100644 0045-pc-fail-memory-hot-plug-unplug-with.patch diff --git a/0045-pc-fail-memory-hot-plug-unplug-with.patch b/0045-pc-fail-memory-hot-plug-unplug-with.patch new file mode 100644 index 00000000..f019d3b4 --- /dev/null +++ b/0045-pc-fail-memory-hot-plug-unplug-with.patch @@ -0,0 +1,61 @@ +From aaac044c06d93bd90ffa35eb091ec10c67f3ef7e Mon Sep 17 00:00:00 2001 +From: Haozhong Zhang +Date: Fri, 22 Dec 2017 09:51:20 +0800 +Subject: [PATCH] pc: fail memory hot-plug/unplug with -no-acpi and Q35 machine + type + +When -no-acpi option is used with Q35 machine type, no guest ACPI is +built, but the ACPI device is still created, so only checking the +presence of ACPI device before memory plug/unplug is not enough in +such cases. Check whether ACPI is disabled globally in addition and +fail memory plug/unplug if it's disabled. + +Signed-off-by: Haozhong Zhang +Message-Id: <20171222015120.31730-1-haozhong.zhang@intel.com> +Reviewed-by: Igor Mammedov +Signed-off-by: Paolo Bonzini +(cherry picked from commit 8cd91acec8dfea6065272ca828405333f564a612) +[BR: BSC#1077823] +Signed-off-by: Bruce Rogers +--- + hw/i386/pc.c | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) + +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index 186545d2a4..e7faf92143 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -1694,9 +1694,14 @@ static void pc_dimm_plug(HotplugHandler *hotplug_dev, + align = memory_region_get_alignment(mr); + } + +- if (!pcms->acpi_dev) { ++ /* ++ * When -no-acpi is used with Q35 machine type, no ACPI is built, ++ * but pcms->acpi_dev is still created. Check !acpi_enabled in ++ * addition to cover this case. ++ */ ++ if (!pcms->acpi_dev || !acpi_enabled) { + error_setg(&local_err, +- "memory hotplug is not enabled: missing acpi device"); ++ "memory hotplug is not enabled: missing acpi device or acpi disabled"); + goto out; + } + +@@ -1728,9 +1733,14 @@ static void pc_dimm_unplug_request(HotplugHandler *hotplug_dev, + Error *local_err = NULL; + PCMachineState *pcms = PC_MACHINE(hotplug_dev); + +- if (!pcms->acpi_dev) { ++ /* ++ * When -no-acpi is used with Q35 machine type, no ACPI is built, ++ * but pcms->acpi_dev is still created. Check !acpi_enabled in ++ * addition to cover this case. ++ */ ++ if (!pcms->acpi_dev || !acpi_enabled) { + error_setg(&local_err, +- "memory hotplug is not enabled: missing acpi device"); ++ "memory hotplug is not enabled: missing acpi device or acpi disabled"); + goto out; + } + diff --git a/qemu-linux-user.changes b/qemu-linux-user.changes index 82f2efdf..fdf745b4 100644 --- a/qemu-linux-user.changes +++ b/qemu-linux-user.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Jan 29 21:51:20 UTC 2018 - brogers@suse.com + +- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.11 +* Patches added: + 0045-pc-fail-memory-hot-plug-unplug-with.patch + ------------------------------------------------------------------- Thu Jan 25 22:52:09 UTC 2018 - brogers@suse.com diff --git a/qemu-linux-user.spec b/qemu-linux-user.spec index 0be08c25..a044fdca 100644 --- a/qemu-linux-user.spec +++ b/qemu-linux-user.spec @@ -70,6 +70,7 @@ Patch0041: 0041-scripts-ensure-signrom-treats-data-.patch Patch0042: 0042-configure-allow-use-of-python-3.patch Patch0043: 0043-input-add-missing-JIS-keys-to-virti.patch Patch0044: 0044-Make-installed-scripts-explicitly-p.patch +Patch0045: 0045-pc-fail-memory-hot-plug-unplug-with.patch # Please do not add QEMU patches manually here. # Run update_git.sh to regenerate this queue. Source400: update_git.sh @@ -143,6 +144,7 @@ syscall layer occurs on the native hardware and operating system. %patch0042 -p1 %patch0043 -p1 %patch0044 -p1 +%patch0045 -p1 %build ./configure \ diff --git a/qemu-testsuite.changes b/qemu-testsuite.changes index 183030ae..833ca87a 100644 --- a/qemu-testsuite.changes +++ b/qemu-testsuite.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Jan 29 21:51:17 UTC 2018 - brogers@suse.com + +- Fix machine inconsistency with -no-acpi and nvdimm (bsc#1077823) + 0045-pc-fail-memory-hot-plug-unplug-with.patch +- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.11 + ------------------------------------------------------------------- Fri Jan 26 11:49:03 UTC 2018 - brogers@suse.com diff --git a/qemu-testsuite.spec b/qemu-testsuite.spec index 5ecde0c8..95d2201a 100644 --- a/qemu-testsuite.spec +++ b/qemu-testsuite.spec @@ -174,6 +174,7 @@ Patch0041: 0041-scripts-ensure-signrom-treats-data-.patch Patch0042: 0042-configure-allow-use-of-python-3.patch Patch0043: 0043-input-add-missing-JIS-keys-to-virti.patch Patch0044: 0044-Make-installed-scripts-explicitly-p.patch +Patch0045: 0045-pc-fail-memory-hot-plug-unplug-with.patch # Please do not add QEMU patches manually here. # Run update_git.sh to regenerate this queue. @@ -814,6 +815,7 @@ This package provides a service file for starting and stopping KSM. %patch0042 -p1 %patch0043 -p1 %patch0044 -p1 +%patch0045 -p1 %if 0%{?suse_version} > 1320 %patch1000 -p1 diff --git a/qemu.changes b/qemu.changes index 183030ae..833ca87a 100644 --- a/qemu.changes +++ b/qemu.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Jan 29 21:51:17 UTC 2018 - brogers@suse.com + +- Fix machine inconsistency with -no-acpi and nvdimm (bsc#1077823) + 0045-pc-fail-memory-hot-plug-unplug-with.patch +- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.11 + ------------------------------------------------------------------- Fri Jan 26 11:49:03 UTC 2018 - brogers@suse.com diff --git a/qemu.spec b/qemu.spec index e5f1bad6..919619f1 100644 --- a/qemu.spec +++ b/qemu.spec @@ -174,6 +174,7 @@ Patch0041: 0041-scripts-ensure-signrom-treats-data-.patch Patch0042: 0042-configure-allow-use-of-python-3.patch Patch0043: 0043-input-add-missing-JIS-keys-to-virti.patch Patch0044: 0044-Make-installed-scripts-explicitly-p.patch +Patch0045: 0045-pc-fail-memory-hot-plug-unplug-with.patch # Please do not add QEMU patches manually here. # Run update_git.sh to regenerate this queue. @@ -814,6 +815,7 @@ This package provides a service file for starting and stopping KSM. %patch0042 -p1 %patch0043 -p1 %patch0044 -p1 +%patch0045 -p1 %if 0%{?suse_version} > 1320 %patch1000 -p1