diff mbox

[1/2] Allow use of pc machine type (accel=xen) for Xen HVM domains.

Message ID 1371472598-20330-2-git-send-email-paul.durrant@citrix.com
State New
Headers show

Commit Message

Paul Durrant June 17, 2013, 12:36 p.m. UTC
Xen HVM domains normally spawn QEMU with a dedicated xenfv machine type. The
initialization code for this machine type can easily be pulled into the
generic pc initialization code and guarded with a test for whether the xen
accelerator options is specified, which is more consistent with the way
other accelerators are used.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 hw/i386/pc_piix.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Igor Mammedov June 18, 2013, 9:43 a.m. UTC | #1
On Mon, 17 Jun 2013 13:36:36 +0100
Paul Durrant <paul.durrant@citrix.com> wrote:

> Xen HVM domains normally spawn QEMU with a dedicated xenfv machine type. The
> initialization code for this machine type can easily be pulled into the
> generic pc initialization code and guarded with a test for whether the xen
> accelerator options is specified, which is more consistent with the way
> other accelerators are used.
> 
> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> ---
>  hw/i386/pc_piix.c |    7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index d618570..6d3f161 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -91,6 +91,10 @@ static void pc_init1(MemoryRegion *system_memory,
>      DeviceState *icc_bridge;
>      FWCfgState *fw_cfg = NULL;
>  
> +    if (xen_hvm_init() != 0) {
> +        hw_error("xen hardware virtual machine initialisation failed");
> +    }
> +
would it work if starting QEMU without xen?

>      icc_bridge = qdev_create(NULL, TYPE_ICC_BRIDGE);
>      object_property_add_child(qdev_get_machine(), "icc-bridge",
>                                OBJECT(icc_bridge), NULL);
> @@ -320,9 +324,6 @@ static void pc_init_isa(QEMUMachineInitArgs *args)
>  #ifdef CONFIG_XEN
>  static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
>  {
> -    if (xen_hvm_init() != 0) {
> -        hw_error("xen hardware virtual machine initialisation failed");
> -    }
>      pc_init_pci(args);
>  }
>  #endif
> -- 
> 1.7.10.4
> 
>
Paul Durrant June 18, 2013, 9:46 a.m. UTC | #2
> -----Original Message-----
> From: Igor Mammedov [mailto:imammedo@redhat.com]
> Sent: 18 June 2013 10:44
> To: Paul Durrant
> Cc: qemu-devel@nongnu.org; xen-devel@lists.xen.org
> Subject: Re: [Qemu-devel] [PATCH 1/2] Allow use of pc machine type
> (accel=xen) for Xen HVM domains.
> 
> On Mon, 17 Jun 2013 13:36:36 +0100
> Paul Durrant <paul.durrant@citrix.com> wrote:
> 
> > Xen HVM domains normally spawn QEMU with a dedicated xenfv machine
> type. The
> > initialization code for this machine type can easily be pulled into the
> > generic pc initialization code and guarded with a test for whether the xen
> > accelerator options is specified, which is more consistent with the way
> > other accelerators are used.
> >
> > Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> > ---
> >  hw/i386/pc_piix.c |    7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> > index d618570..6d3f161 100644
> > --- a/hw/i386/pc_piix.c
> > +++ b/hw/i386/pc_piix.c
> > @@ -91,6 +91,10 @@ static void pc_init1(MemoryRegion
> *system_memory,
> >      DeviceState *icc_bridge;
> >      FWCfgState *fw_cfg = NULL;
> >
> > +    if (xen_hvm_init() != 0) {
> > +        hw_error("xen hardware virtual machine initialisation failed");
> > +    }
> > +
> would it work if starting QEMU without xen?
> 

Yikes, there's supposed to be a xen_enabled() test there too! Must have got lost when I re-based my patches. I'll fix and re-post.

  Paul

> >      icc_bridge = qdev_create(NULL, TYPE_ICC_BRIDGE);
> >      object_property_add_child(qdev_get_machine(), "icc-bridge",
> >                                OBJECT(icc_bridge), NULL);
> > @@ -320,9 +324,6 @@ static void pc_init_isa(QEMUMachineInitArgs *args)
> >  #ifdef CONFIG_XEN
> >  static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
> >  {
> > -    if (xen_hvm_init() != 0) {
> > -        hw_error("xen hardware virtual machine initialisation failed");
> > -    }
> >      pc_init_pci(args);
> >  }
> >  #endif
> > --
> > 1.7.10.4
> >
> >
> 
> 
> --
> Regards,
>   Igor
diff mbox

Patch

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index d618570..6d3f161 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -91,6 +91,10 @@  static void pc_init1(MemoryRegion *system_memory,
     DeviceState *icc_bridge;
     FWCfgState *fw_cfg = NULL;
 
+    if (xen_hvm_init() != 0) {
+        hw_error("xen hardware virtual machine initialisation failed");
+    }
+
     icc_bridge = qdev_create(NULL, TYPE_ICC_BRIDGE);
     object_property_add_child(qdev_get_machine(), "icc-bridge",
                               OBJECT(icc_bridge), NULL);
@@ -320,9 +324,6 @@  static void pc_init_isa(QEMUMachineInitArgs *args)
 #ifdef CONFIG_XEN
 static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
 {
-    if (xen_hvm_init() != 0) {
-        hw_error("xen hardware virtual machine initialisation failed");
-    }
     pc_init_pci(args);
 }
 #endif