xen: Fix xenpv machine initialisation
PATCH 1/1 xen: Fix xenpv machine initialisation
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
---
CC: Wei Liu <[email protected]>
CC: Eduardo Habkost <[email protected]>
--- xen-common.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
xen-common.c +5 -3
@@ -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 ) {
Signature · 1 line
Anthony PERARD
Quoted 8 lines · Anthony PERARD
When using QEMU for Xen PV guest, QEMU abort with:
xen-common.c:118:xen_init: Object0x7f2b8325dcb0is not an instance of type generic-pc-machineThis is because the machine 'xenpv' also use accel=xen.
This fix
021746c131cdfeab9d82ff918795a9f18d20d7aeSigned-off-by Anthony PERARD <[email protected]>
What about moving the acpi_build_enabled initialization to xen_hvm_init?
Quoted 29 lines
CC Wei Liu <[email protected]>CC Eduardo Habkost <[email protected]>--- xen-common.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)xen-common.c +5
-3@@ -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 ) {Signature · 1 line
Anthony PERARD
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 4 lines · Stefano Stabellini
Quoted 3 lines · Anthony PERARD
When using QEMU for Xen PV guest, QEMU abort with:
xen-common.c:118:xen_init: Object0x7f2b8325dcb0is not an instance of type generic-pc-machine
Quoted 8 lines
Quoted 5 lines
This is because the machine 'xenpv' also use accel=xen.
This fix
021746c131cdfeab9d82ff918795a9f18d20d7aeSigned-off-by Anthony PERARD <[email protected]>What about moving the
acpi_build_enabledinitialization toxen_hvm_init?
Yes, that would be better, I'll do that.
Thanks.
Signature · 6 lines
Anthony PERARD _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 4 lines · Stefano Stabellini
Quoted 3 lines · Anthony PERARD
When using QEMU for Xen PV guest, QEMU abort with:
xen-common.c:118:xen_init: Object0x7f2b8325dcb0is not an instance of type generic-pc-machine
Quoted 8 lines
Quoted 5 lines
This is because the machine 'xenpv' also use accel=xen.
This fix
021746c131cdfeab9d82ff918795a9f18d20d7aeSigned-off-by Anthony PERARD <[email protected]>What about moving the
acpi_build_enabledinitialization toxen_hvm_init?
Yes, that would be better, I'll do that.
Thanks.
Signature · 1 line
Anthony PERARD