When using QEMU for Xen PV guest, QEMU abort with:
xen-common.c:118:xen_init: Object 0x7f2b8325dcb0 is not an instance of type 
generic-pc-machine

This is because the machine 'xenpv' also use accel=xen.

This fix 021746c131cdfeab9d82ff918795a9f18d20d7ae

Signed-off-by: Anthony PERARD <anthony.per...@citrix.com>
---
CC: Wei Liu <wei.l...@citrix.com>
CC: Eduardo Habkost <ehabk...@redhat.com>
---
 xen-common.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen-common.c b/xen-common.c
index bacf962..22683b0 100644
--- a/xen-common.c
+++ b/xen-common.c
@@ -115,10 +115,12 @@ static void xen_change_state_handler(void *opaque, int 
running,
 
 static int xen_init(MachineState *ms)
 {
-    PCMachineState *pcms = PC_MACHINE(ms);
+    if (object_dynamic_cast(OBJECT(ms), TYPE_PC_MACHINE)) {
+        PCMachineState *pcms = PC_MACHINE(ms);
 
-    /* Disable ACPI build because Xen handles it */
-    pcms->acpi_build_enabled = false;
+        /* Disable ACPI build because Xen handles it */
+        pcms->acpi_build_enabled = false;
+    }
 
     xen_xc = xc_interface_open(0, 0, 0);
     if (xen_xc == NULL) {
-- 
Anthony PERARD


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to