From dd29b5c30cd2a13f8c12376a8de84cb090c338bf Mon Sep 17 00:00:00 2001 From: Paul Durrant Date: Wed, 24 Jun 2020 13:18:41 +0100 Subject: xen: cleanup unrealized flash devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The generic pc_machine_initfn() calls pc_system_flash_create() which creates 'system.flash0' and 'system.flash1' devices. These devices are then realized by pc_system_flash_map() which is called from pc_system_firmware_init() which itself is called via pc_memory_init(). The latter however is not called when xen_enable() is true and hence the following assertion fails: qemu-system-i386: hw/core/qdev.c:439: qdev_assert_realized_properly: Assertion `dev->realized' failed These flash devices are unneeded when using Xen so this patch avoids the assertion by simply removing them using pc_system_flash_cleanup_unused(). Reported-by: Jason Andryuk Fixes: ebc29e1beab0 ("pc: Support firmware configuration with -blockdev") Signed-off-by: Paul Durrant Tested-by: Jason Andryuk Reviewed-by: Anthony PERARD Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200624121841.17971-3-paul@xen.org> Fixes: dfe8c79c4468 ("qdev: Assert onboard devices all get realized properly") Signed-off-by: Anthony PERARD --- include/hw/i386/pc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index a802e69..3d7ed3a 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -186,6 +186,7 @@ ISADevice *pc_find_fdc0(void); /* pc_sysfw.c */ void pc_system_flash_create(PCMachineState *pcms); +void pc_system_flash_cleanup_unused(PCMachineState *pcms); void pc_system_firmware_init(PCMachineState *pcms, MemoryRegion *rom_memory); /* acpi-build.c */ -- cgit v1.1