* Re: [Qemu-devel] [PATCH v2] xen: Fix xenpv machine initialisation
2016-11-08 14:07 [Qemu-devel] [PATCH v2] xen: Fix xenpv machine initialisation Anthony PERARD
@ 2016-11-08 14:30 ` Eduardo Habkost
2016-11-08 14:30 ` Eduardo Habkost
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Eduardo Habkost @ 2016-11-08 14:30 UTC (permalink / raw)
To: Anthony PERARD; +Cc: qemu-devel, xen-devel, Wei Liu, Stefano Stabellini
On Tue, Nov 08, 2016 at 02:07:22PM +0000, Anthony PERARD wrote:
> 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.
>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> CC: Wei Liu <wei.liu2@citrix.com>
> CC: Eduardo Habkost <ehabkost@redhat.com>
> ---
> xen-common.c | 6 ------
> xen-hvm.c | 4 ++++
> 2 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/xen-common.c b/xen-common.c
> index bacf962..9099760 100644
> --- a/xen-common.c
> +++ b/xen-common.c
> @@ -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");
> diff --git a/xen-hvm.c b/xen-hvm.c
> index 2f348ed..150c7e7 100644
> --- a/xen-hvm.c
> +++ b/xen-hvm.c
> @@ -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:
> --
> Anthony PERARD
>
--
Eduardo
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v2] xen: Fix xenpv machine initialisation
2016-11-08 14:07 [Qemu-devel] [PATCH v2] xen: Fix xenpv machine initialisation Anthony PERARD
2016-11-08 14:30 ` Eduardo Habkost
@ 2016-11-08 14:30 ` Eduardo Habkost
2016-11-08 19:30 ` [Qemu-devel] " Stefano Stabellini
2016-11-08 19:30 ` Stefano Stabellini
3 siblings, 0 replies; 5+ messages in thread
From: Eduardo Habkost @ 2016-11-08 14:30 UTC (permalink / raw)
To: Anthony PERARD; +Cc: Stefano Stabellini, Wei Liu, qemu-devel, xen-devel
On Tue, Nov 08, 2016 at 02:07:22PM +0000, Anthony PERARD wrote:
> 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.
>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> CC: Wei Liu <wei.liu2@citrix.com>
> CC: Eduardo Habkost <ehabkost@redhat.com>
> ---
> xen-common.c | 6 ------
> xen-hvm.c | 4 ++++
> 2 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/xen-common.c b/xen-common.c
> index bacf962..9099760 100644
> --- a/xen-common.c
> +++ b/xen-common.c
> @@ -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");
> diff --git a/xen-hvm.c b/xen-hvm.c
> index 2f348ed..150c7e7 100644
> --- a/xen-hvm.c
> +++ b/xen-hvm.c
> @@ -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:
> --
> Anthony PERARD
>
--
Eduardo
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Qemu-devel] [PATCH v2] xen: Fix xenpv machine initialisation
2016-11-08 14:07 [Qemu-devel] [PATCH v2] xen: Fix xenpv machine initialisation Anthony PERARD
2016-11-08 14:30 ` Eduardo Habkost
2016-11-08 14:30 ` Eduardo Habkost
@ 2016-11-08 19:30 ` Stefano Stabellini
2016-11-08 19:30 ` Stefano Stabellini
3 siblings, 0 replies; 5+ messages in thread
From: Stefano Stabellini @ 2016-11-08 19:30 UTC (permalink / raw)
To: Anthony PERARD
Cc: qemu-devel, xen-devel, Wei Liu, Eduardo Habkost,
Stefano Stabellini
On Tue, 8 Nov 2016, Anthony PERARD wrote:
> 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.
>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> CC: Wei Liu <wei.liu2@citrix.com>
> CC: Eduardo Habkost <ehabkost@redhat.com>
> ---
> xen-common.c | 6 ------
> xen-hvm.c | 4 ++++
> 2 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/xen-common.c b/xen-common.c
> index bacf962..9099760 100644
> --- a/xen-common.c
> +++ b/xen-common.c
> @@ -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");
> diff --git a/xen-hvm.c b/xen-hvm.c
> index 2f348ed..150c7e7 100644
> --- a/xen-hvm.c
> +++ b/xen-hvm.c
> @@ -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:
> --
> Anthony PERARD
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v2] xen: Fix xenpv machine initialisation
2016-11-08 14:07 [Qemu-devel] [PATCH v2] xen: Fix xenpv machine initialisation Anthony PERARD
` (2 preceding siblings ...)
2016-11-08 19:30 ` [Qemu-devel] " Stefano Stabellini
@ 2016-11-08 19:30 ` Stefano Stabellini
3 siblings, 0 replies; 5+ messages in thread
From: Stefano Stabellini @ 2016-11-08 19:30 UTC (permalink / raw)
To: Anthony PERARD
Cc: Stefano Stabellini, Wei Liu, qemu-devel, Eduardo Habkost,
xen-devel
On Tue, 8 Nov 2016, Anthony PERARD wrote:
> 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.
>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> CC: Wei Liu <wei.liu2@citrix.com>
> CC: Eduardo Habkost <ehabkost@redhat.com>
> ---
> xen-common.c | 6 ------
> xen-hvm.c | 4 ++++
> 2 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/xen-common.c b/xen-common.c
> index bacf962..9099760 100644
> --- a/xen-common.c
> +++ b/xen-common.c
> @@ -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");
> diff --git a/xen-hvm.c b/xen-hvm.c
> index 2f348ed..150c7e7 100644
> --- a/xen-hvm.c
> +++ b/xen-hvm.c
> @@ -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:
> --
> Anthony PERARD
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread