xen: Fix xenpv machine initialisation
PATCH v2 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. Moving the code to xen_hvm_init() fix the issue.
This fix 021746c131cdfeab9d82ff918795a9f18d20d7ae.
---
CC: Wei Liu <[email protected]>
CC: Eduardo Habkost <[email protected]>
--- xen-common.c | 6 ------ xen-hvm.c | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-)
xen-common.c +0 -6
@@ -9,7 +9,6 @@*/ #include "qemu/osdep.h" -#include "hw/i386/pc.h" #include "hw/xen/xen_backend.h" #include "qmp-commands.h" #include "sysemu/char.h"
@@ -115,11 +114,6 @@ static void xen_change_state_handler(void *opaque, int running,static int xen_init (MachineState *ms) { -PCMachineState *pcms =PC_MACHINE (ms); - -/* Disable ACPI build because Xen handles it */ - pcms->acpi_build_enabled = false; - xen_xc =xc_interface_open (0 ,0 ,0 );if (xen_xc ==NULL ) {xen_pv_printf (NULL ,0 ,"can't open xen interface\n" );
xen-hvm.c +4 -0
@@ -1316,6 +1316,10 @@ void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory) }xen_be_register_common ();xen_read_physmap (state); + +/* Disable ACPI build because Xen handles it */ + pcms->acpi_build_enabled = false; +return ; err:
Signature · 1 line
Anthony PERARD
Quoted 9 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. Moving the code to
xen_hvm_init()fix the issue.This fix
021746c131cdfeab9d82ff918795a9f18d20d7ae.Signed-off-by Anthony PERARD <[email protected]>
Quoted 50 lines
---
CC: Wei Liu <[email protected]>
CC: Eduardo Habkost <[email protected]>--- xen-common.c | 6 ------ xen-hvm.c | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-)xen-common.c +0
-6@@ -9,7 +9,6 @@*/ #include "qemu/osdep.h" -#include "hw/i386/pc.h" #include "hw/xen/xen_backend.h" #include "qmp-commands.h" #include "sysemu/char.h" @@ -115,11 +114,6 @@ static void xen_change_state_handler(void *opaque, int running,static int xen_init (MachineState *ms) { -PCMachineState *pcms =PC_MACHINE (ms); - -/* Disable ACPI build because Xen handles it */ - pcms->acpi_build_enabled = false; - xen_xc =xc_interface_open (0 ,0 ,0 );if (xen_xc ==NULL ) {xen_pv_printf (NULL ,0 ,"can't open xen interface\n" );xen-hvm.c +4
-0@@ -1316,6 +1316,10 @@ void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory) }xen_be_register_common ();xen_read_physmap (state); + +/* Disable ACPI build because Xen handles it */ + pcms->acpi_build_enabled = false; +return ; err:Signature · 1 line
Anthony PERARD
Signature · 6 lines
Eduardo _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 9 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. Moving the code to
xen_hvm_init()fix the issue.This fix
021746c131cdfeab9d82ff918795a9f18d20d7ae.Signed-off-by Anthony PERARD <[email protected]>
Quoted 50 lines
---
CC: Wei Liu <[email protected]>
CC: Eduardo Habkost <[email protected]>--- xen-common.c | 6 ------ xen-hvm.c | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-)xen-common.c +0
-6@@ -9,7 +9,6 @@*/ #include "qemu/osdep.h" -#include "hw/i386/pc.h" #include "hw/xen/xen_backend.h" #include "qmp-commands.h" #include "sysemu/char.h" @@ -115,11 +114,6 @@ static void xen_change_state_handler(void *opaque, int running,static int xen_init (MachineState *ms) { -PCMachineState *pcms =PC_MACHINE (ms); - -/* Disable ACPI build because Xen handles it */ - pcms->acpi_build_enabled = false; - xen_xc =xc_interface_open (0 ,0 ,0 );if (xen_xc ==NULL ) {xen_pv_printf (NULL ,0 ,"can't open xen interface\n" );xen-hvm.c +4
-0@@ -1316,6 +1316,10 @@ void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory) }xen_be_register_common ();xen_read_physmap (state); + +/* Disable ACPI build because Xen handles it */ + pcms->acpi_build_enabled = false; +return ; err:Signature · 1 line
Anthony PERARD
Signature · 1 line
Eduardo
Quoted 9 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. Moving the code to
xen_hvm_init()fix the issue.This fix
021746c131cdfeab9d82ff918795a9f18d20d7ae.Signed-off-by Anthony PERARD <[email protected]>
Quoted 49 lines
CC Wei Liu <[email protected]>CC Eduardo Habkost <[email protected]>--- xen-common.c | 6 ------ xen-hvm.c | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-)xen-common.c +0
-6@@ -9,7 +9,6 @@*/ #include "qemu/osdep.h" -#include "hw/i386/pc.h" #include "hw/xen/xen_backend.h" #include "qmp-commands.h" #include "sysemu/char.h" @@ -115,11 +114,6 @@ static void xen_change_state_handler(void *opaque, int running,static int xen_init (MachineState *ms) { -PCMachineState *pcms =PC_MACHINE (ms); - -/* Disable ACPI build because Xen handles it */ - pcms->acpi_build_enabled = false; - xen_xc =xc_interface_open (0 ,0 ,0 );if (xen_xc ==NULL ) {xen_pv_printf (NULL ,0 ,"can't open xen interface\n" );xen-hvm.c +4
-0@@ -1316,6 +1316,10 @@ void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory) }xen_be_register_common ();xen_read_physmap (state); + +/* Disable ACPI build because Xen handles it */ + pcms->acpi_build_enabled = false; +return ; err:Signature · 1 line
Anthony PERARD
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 9 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. Moving the code to
xen_hvm_init()fix the issue.This fix
021746c131cdfeab9d82ff918795a9f18d20d7ae.Signed-off-by Anthony PERARD <[email protected]>
Quoted 49 lines
CC Wei Liu <[email protected]>CC Eduardo Habkost <[email protected]>--- xen-common.c | 6 ------ xen-hvm.c | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-)xen-common.c +0
-6@@ -9,7 +9,6 @@*/ #include "qemu/osdep.h" -#include "hw/i386/pc.h" #include "hw/xen/xen_backend.h" #include "qmp-commands.h" #include "sysemu/char.h" @@ -115,11 +114,6 @@ static void xen_change_state_handler(void *opaque, int running,static int xen_init (MachineState *ms) { -PCMachineState *pcms =PC_MACHINE (ms); - -/* Disable ACPI build because Xen handles it */ - pcms->acpi_build_enabled = false; - xen_xc =xc_interface_open (0 ,0 ,0 );if (xen_xc ==NULL ) {xen_pv_printf (NULL ,0 ,"can't open xen interface\n" );xen-hvm.c +4
-0@@ -1316,6 +1316,10 @@ void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory) }xen_be_register_common ();xen_read_physmap (state); + +/* Disable ACPI build because Xen handles it */ + pcms->acpi_build_enabled = false; +return ; err:Signature · 1 line
Anthony PERARD