qemu-e2k/hw/i386
Thomas Huth ae909496e9 hw/i386/pc: Fix crash when hot-plugging nvdimm on older machine types
QEMU currently crashes when you try to hot-plug an "nvdimm" device
on older machine types:

$ qemu-system-x86_64 -monitor stdio -M pc-1.1
QEMU 3.1.92 monitor - type 'help' for more information
(qemu) device_add nvdimm,id=nvdimmn1
qemu-system-x86_64: /home/thuth/devel/qemu/util/error.c:57: error_setv:
 Assertion `*errp == ((void *)0)' failed.
Aborted (core dumped)

The call to hotplug_handler_pre_plug() in pc_memory_pre_plug() has been
added recently before the check whether nvdimm is enabled. It should
be done after the check. And while we're at it, also check the errp
after the hotplug_handler_pre_plug(), otherwise errors are silently
ignored here.

Fixes: 9040e6dfa8
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20190407092314.11066-1-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-04-09 18:34:21 +02:00
..
kvm ioapic: use TYPE_FOO MACRO than constant string 2019-01-09 11:33:47 +01:00
xen trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
Kconfig virtio-vga: only enable for specific boards 2019-03-21 17:42:18 +01:00
Makefile.objs i386: express dependencies with Kconfig 2019-03-07 21:45:53 +01:00
acpi-build.c machine: Move nvdimms state into struct MachineState 2019-03-11 10:44:25 -03:00
acpi-build.h Use scripts/clean-includes to drop redundant qemu/typedefs.h 2016-03-22 22:20:16 +01:00
amd_iommu.c update copyright notice 2019-03-11 16:33:49 +01:00
amd_iommu.h update copyright notice 2019-03-11 16:33:49 +01:00
intel_iommu.c intel_iommu: Drop extended root field 2019-04-02 11:49:14 -04:00
intel_iommu_internal.h intel_iommu: Drop extended root field 2019-04-02 11:49:14 -04:00
kvmvapic.c target: Do not include "exec/exec-all.h" if it is not necessary 2018-06-01 14:15:10 +02:00
multiboot.c elf: Add optional function ptr to load_elf() to parse ELF notes 2019-02-05 16:50:16 +01:00
multiboot.h refer to FWCfgState explicitly 2013-06-02 18:14:02 +03:00
pc.c hw/i386/pc: Fix crash when hot-plugging nvdimm on older machine types 2019-04-09 18:34:21 +02:00
pc_piix.c machine: Move nvdimms state into struct MachineState 2019-03-11 10:44:25 -03:00
pc_q35.c machine: Move nvdimms state into struct MachineState 2019-03-11 10:44:25 -03:00
pc_sysfw.c pc: Support firmware configuration with -blockdev 2019-03-11 22:54:26 +01:00
trace-events intel_iommu: Drop extended root field 2019-04-02 11:49:14 -04:00
vmmouse.c hw/input/i8042: Extract declarations from i386/pc.h into input/i8042.h 2018-03-12 16:12:48 +01:00
vmport.c hw/input/i8042: Extract declarations from i386/pc.h into input/i8042.h 2018-03-12 16:12:48 +01:00
x86-iommu.c x86-iommu: turn on IR by default if proper 2018-12-20 13:25:11 -05:00