All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v9] tools/libxl: Add qxl vga interface support for upstream qemu
@ 2013-02-11 10:58 fantonifabio
  2013-02-15 12:27 ` Stefano Stabellini
  0 siblings, 1 reply; 8+ messages in thread
From: fantonifabio @ 2013-02-11 10:58 UTC (permalink / raw)
  To: xen-devel; +Cc: Zhou Peng, Fabio Fantoni, Ian.Campbell, Stefano.Stabellini

From: Fabio Fantoni <fabio.fantoni@heliman.it>

Usage:
  vga="qxl"

Changes from v8:
- vga=qxl instead of qxl=1 to use it.
- Show an error and exit if vga="qxl" without qemu upstream.
- Other small improvements.

Required patches:
- Improve videoram setting v5
- Added vga parameter for hvm domUs

Signed-off-by: Fabio Fantoni <fabio.fantoni@heliman.it>
Signed-off-by: Zhou Peng <zpengxen@gmail.com>
---
 docs/man/xl.cfg.pod.5       |   10 +++++++++-
 tools/libxl/libxl_create.c  |   17 +++++++++++++++++
 tools/libxl/libxl_dm.c      |   13 +++++++++++++
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |    3 +++
 5 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 9862842..a3b3645 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -984,6 +984,9 @@ the amount of video ram is fixed at 4MB which is sufficient
 for 1024x768 at 32 bpp and videoram option is currently working
 only when using the upstream qemu-xen device-model.
 
+For B<qxl> vga, the default is both default and minimal 128MB.
+If B<videoram> is set less than 128MB, an error will be triggered.
+
 =item B<stdvga=BOOLEAN>
 
 Select a standard VGA card with VBE (VESA BIOS Extensions) as the
@@ -995,9 +998,14 @@ This option is deprecated, use vga="stdvga" instead.
 
 =item B<vga="STRING">
 
-Selects the emulated video card (stdvga|cirrus).
+Selects the emulated video card (stdvga|cirrus|qxl).
 The default is cirrus.
 
+In general, QXL should work with the Spice remote display protocol
+for acceleration, and QXL driver is necessary in guest in this case.
+QXL can also work with the VNC protocol, but it will be like a standard
+VGA without acceleration.
+
 =item B<vnc=BOOLEAN>
 
 Allow access to the display via the VNC protocol.  This enables the
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index cf545ef..67b5e6e 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -197,6 +197,23 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
     case LIBXL_DOMAIN_TYPE_HVM:
         if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
             b_info->shadow_memkb = 0;
+
+        if (b_info->u.hvm.vga.kind == LIBXL_VGA_INTERFACE_TYPE_QXL) {
+            if (b_info->device_model_version ==
+               LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
+                if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT) {
+                    b_info->video_memkb = (128 * 1024);
+                }else if (b_info->video_memkb < (128 * 1024)) {
+                    LOG(ERROR,
+                    "128 Mib videoram is the minimum for qxl default");
+                    return ERROR_INVAL;
+                }
+            } else {
+                LOG(ERROR,"qemu upstream required for qxl vga");
+                return ERROR_INVAL;
+            }
+        }
+
         if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
             b_info->video_memkb = 8 * 1024;
         else if (b_info->video_memkb < 8192){
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index a2c99bd..59fc86a 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -181,6 +181,8 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc,
             break;
         case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
             break;
+        case LIBXL_VGA_INTERFACE_TYPE_QXL:
+            break;
         }
 
         if (b_info->u.hvm.boot) {
@@ -440,6 +442,17 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
                 NULL);
             }
             break;
+        case LIBXL_VGA_INTERFACE_TYPE_QXL:
+            /*QXL have 2 ram regions, ram and vram*/
+            flexarray_vappend(dm_args, "-vga", "qxl", NULL);
+            if (b_info->video_memkb) {
+                flexarray_vappend(dm_args, "-global",
+                libxl__sprintf(gc, "qxl-vga.vram_size_mb=%lu",
+                (b_info->video_memkb/2/1024)), "-global",
+                libxl__sprintf(gc, "qxl-vga.ram_size_mb=%lu",
+                (b_info->video_memkb/2/1024)), NULL);
+            }
+            break;
         }
 
         if (b_info->u.hvm.boot) {
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index acc4bc9..3f90f12 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -130,6 +130,7 @@ libxl_shutdown_reason = Enumeration("shutdown_reason", [
 libxl_vga_interface_type = Enumeration("vga_interface_type", [
     (1, "CIRRUS"),
     (2, "STD"),
+    (3, "QXL"),
     ], init_val = 0)
 
 #
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index f9101ba..b20c185 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1476,6 +1476,9 @@ skip_vfb:
             } else if (!strcmp(buf, "cirrus")) {
                 b_info->u.hvm.vga.kind
                 = LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
+            }else if (!strcmp(buf, "qxl")) {
+                b_info->u.hvm.vga.kind
+                = LIBXL_VGA_INTERFACE_TYPE_QXL;
             } else {
                 fprintf(stderr,
                 "Unknown vga \"%s\" specified\n", buf);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v9] tools/libxl: Add qxl vga interface support for upstream qemu
  2013-02-11 10:58 [PATCH v9] tools/libxl: Add qxl vga interface support for upstream qemu fantonifabio
@ 2013-02-15 12:27 ` Stefano Stabellini
  2013-02-15 13:46   ` Ian Campbell
  0 siblings, 1 reply; 8+ messages in thread
From: Stefano Stabellini @ 2013-02-15 12:27 UTC (permalink / raw)
  To: fantonifabio@tiscali.it
  Cc: Zhou Peng, xen-devel@lists.xensource.com, Ian Campbell,
	Fabio Fantoni, Stefano Stabellini

On Mon, 11 Feb 2013, fantonifabio@tiscali.it wrote:
> From: Fabio Fantoni <fabio.fantoni@heliman.it>
> 
> Usage:
>   vga="qxl"
> 
> Changes from v8:
> - vga=qxl instead of qxl=1 to use it.
> - Show an error and exit if vga="qxl" without qemu upstream.
> - Other small improvements.
> 
> Required patches:
> - Improve videoram setting v5
> - Added vga parameter for hvm domUs
> 
> Signed-off-by: Fabio Fantoni <fabio.fantoni@heliman.it>
> Signed-off-by: Zhou Peng <zpengxen@gmail.com>

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


>  docs/man/xl.cfg.pod.5       |   10 +++++++++-
>  tools/libxl/libxl_create.c  |   17 +++++++++++++++++
>  tools/libxl/libxl_dm.c      |   13 +++++++++++++
>  tools/libxl/libxl_types.idl |    1 +
>  tools/libxl/xl_cmdimpl.c    |    3 +++
>  5 files changed, 43 insertions(+), 1 deletion(-)
> 
> diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
> index 9862842..a3b3645 100644
> --- a/docs/man/xl.cfg.pod.5
> +++ b/docs/man/xl.cfg.pod.5
> @@ -984,6 +984,9 @@ the amount of video ram is fixed at 4MB which is sufficient
>  for 1024x768 at 32 bpp and videoram option is currently working
>  only when using the upstream qemu-xen device-model.
>  
> +For B<qxl> vga, the default is both default and minimal 128MB.
> +If B<videoram> is set less than 128MB, an error will be triggered.
> +
>  =item B<stdvga=BOOLEAN>
>  
>  Select a standard VGA card with VBE (VESA BIOS Extensions) as the
> @@ -995,9 +998,14 @@ This option is deprecated, use vga="stdvga" instead.
>  
>  =item B<vga="STRING">
>  
> -Selects the emulated video card (stdvga|cirrus).
> +Selects the emulated video card (stdvga|cirrus|qxl).
>  The default is cirrus.
>  
> +In general, QXL should work with the Spice remote display protocol
> +for acceleration, and QXL driver is necessary in guest in this case.
> +QXL can also work with the VNC protocol, but it will be like a standard
> +VGA without acceleration.
> +
>  =item B<vnc=BOOLEAN>
>  
>  Allow access to the display via the VNC protocol.  This enables the
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index cf545ef..67b5e6e 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -197,6 +197,23 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
>      case LIBXL_DOMAIN_TYPE_HVM:
>          if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
>              b_info->shadow_memkb = 0;
> +
> +        if (b_info->u.hvm.vga.kind == LIBXL_VGA_INTERFACE_TYPE_QXL) {
> +            if (b_info->device_model_version ==
> +               LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
> +                if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT) {
> +                    b_info->video_memkb = (128 * 1024);
> +                }else if (b_info->video_memkb < (128 * 1024)) {
> +                    LOG(ERROR,
> +                    "128 Mib videoram is the minimum for qxl default");
> +                    return ERROR_INVAL;
> +                }
> +            } else {
> +                LOG(ERROR,"qemu upstream required for qxl vga");
> +                return ERROR_INVAL;
> +            }
> +        }
> +
>          if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
>              b_info->video_memkb = 8 * 1024;
>          else if (b_info->video_memkb < 8192){
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> index a2c99bd..59fc86a 100644
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -181,6 +181,8 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc,
>              break;
>          case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
>              break;
> +        case LIBXL_VGA_INTERFACE_TYPE_QXL:
> +            break;
>          }
>  
>          if (b_info->u.hvm.boot) {
> @@ -440,6 +442,17 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
>                  NULL);
>              }
>              break;
> +        case LIBXL_VGA_INTERFACE_TYPE_QXL:
> +            /*QXL have 2 ram regions, ram and vram*/
> +            flexarray_vappend(dm_args, "-vga", "qxl", NULL);
> +            if (b_info->video_memkb) {
> +                flexarray_vappend(dm_args, "-global",
> +                libxl__sprintf(gc, "qxl-vga.vram_size_mb=%lu",
> +                (b_info->video_memkb/2/1024)), "-global",
> +                libxl__sprintf(gc, "qxl-vga.ram_size_mb=%lu",
> +                (b_info->video_memkb/2/1024)), NULL);
> +            }
> +            break;
>          }
>  
>          if (b_info->u.hvm.boot) {
> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index acc4bc9..3f90f12 100644
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -130,6 +130,7 @@ libxl_shutdown_reason = Enumeration("shutdown_reason", [
>  libxl_vga_interface_type = Enumeration("vga_interface_type", [
>      (1, "CIRRUS"),
>      (2, "STD"),
> +    (3, "QXL"),
>      ], init_val = 0)
>  
>  #
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index f9101ba..b20c185 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -1476,6 +1476,9 @@ skip_vfb:
>              } else if (!strcmp(buf, "cirrus")) {
>                  b_info->u.hvm.vga.kind
>                  = LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
> +            }else if (!strcmp(buf, "qxl")) {
> +                b_info->u.hvm.vga.kind
> +                = LIBXL_VGA_INTERFACE_TYPE_QXL;
>              } else {
>                  fprintf(stderr,
>                  "Unknown vga \"%s\" specified\n", buf);
> -- 
> 1.7.9.5
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v9] tools/libxl: Add qxl vga interface support for upstream qemu
  2013-02-15 12:27 ` Stefano Stabellini
@ 2013-02-15 13:46   ` Ian Campbell
  2013-02-16 12:40     ` Fabio Fantoni
  0 siblings, 1 reply; 8+ messages in thread
From: Ian Campbell @ 2013-02-15 13:46 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: Zhou Peng, xen-devel@lists.xensource.com, Fabio Fantoni,
	fantonifabio@tiscali.it

On Fri, 2013-02-15 at 12:27 +0000, Stefano Stabellini wrote:
> On Mon, 11 Feb 2013, fantonifabio@tiscali.it wrote:
> > From: Fabio Fantoni <fabio.fantoni@heliman.it>
> > 
> > Usage:
> >   vga="qxl"
> > 
> > Changes from v8:
> > - vga=qxl instead of qxl=1 to use it.
> > - Show an error and exit if vga="qxl" without qemu upstream.
> > - Other small improvements.
> > 
> > Required patches:
> > - Improve videoram setting v5
> > - Added vga parameter for hvm domUs
> > 
> > Signed-off-by: Fabio Fantoni <fabio.fantoni@heliman.it>
> > Signed-off-by: Zhou Peng <zpengxen@gmail.com>
> 
> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Applied thanks

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v9] tools/libxl: Add qxl vga interface support for upstream qemu
  2013-02-15 13:46   ` Ian Campbell
@ 2013-02-16 12:40     ` Fabio Fantoni
  2013-02-16 13:20       ` Ian Campbell
  0 siblings, 1 reply; 8+ messages in thread
From: Fabio Fantoni @ 2013-02-16 12:40 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Zhou Peng, fantonifabio@tiscali.it, xen-devel@lists.xensource.com,
	Stefano Stabellini

Il 15/02/2013 14:46, Ian Campbell ha scritto:
> On Fri, 2013-02-15 at 12:27 +0000, Stefano Stabellini wrote:
>> On Mon, 11 Feb 2013, fantonifabio@tiscali.it wrote:
>>> From: Fabio Fantoni <fabio.fantoni@heliman.it>
>>>
>>> Usage:
>>>    vga="qxl"
>>>
>>> Changes from v8:
>>> - vga=qxl instead of qxl=1 to use it.
>>> - Show an error and exit if vga="qxl" without qemu upstream.
>>> - Other small improvements.
>>>
>>> Required patches:
>>> - Improve videoram setting v5
>>> - Added vga parameter for hvm domUs
>>>
>>> Signed-off-by: Fabio Fantoni <fabio.fantoni@heliman.it>
>>> Signed-off-by: Zhou Peng <zpengxen@gmail.com>
>> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Applied thanks
>
>
I do not see this patch in the staging branch, there are problems of 
code style?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v9] tools/libxl: Add qxl vga interface support for upstream qemu
  2013-02-16 12:40     ` Fabio Fantoni
@ 2013-02-16 13:20       ` Ian Campbell
  2013-02-19 18:26         ` Ian Jackson
  2013-02-20 10:59         ` [PATCH v11] tools/libxl: Add qxl vga interface support for upstream qemu fantonifabio
  0 siblings, 2 replies; 8+ messages in thread
From: Ian Campbell @ 2013-02-16 13:20 UTC (permalink / raw)
  To: Fabio Fantoni
  Cc: Zhou Peng, fantonifabio@tiscali.it, xen-devel@lists.xensource.com,
	Stefano Stabellini

On Sat, 2013-02-16 at 12:40 +0000, Fabio Fantoni wrote:
> Il 15/02/2013 14:46, Ian Campbell ha scritto:
> > On Fri, 2013-02-15 at 12:27 +0000, Stefano Stabellini wrote:
> >> On Mon, 11 Feb 2013, fantonifabio@tiscali.it wrote:
> >>> From: Fabio Fantoni <fabio.fantoni@heliman.it>
> >>>
> >>> Usage:
> >>>    vga="qxl"
> >>>
> >>> Changes from v8:
> >>> - vga=qxl instead of qxl=1 to use it.
> >>> - Show an error and exit if vga="qxl" without qemu upstream.
> >>> - Other small improvements.
> >>>
> >>> Required patches:
> >>> - Improve videoram setting v5
> >>> - Added vga parameter for hvm domUs
> >>>
> >>> Signed-off-by: Fabio Fantoni <fabio.fantoni@heliman.it>
> >>> Signed-off-by: Zhou Peng <zpengxen@gmail.com>
> >> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > Applied thanks
> >
> >
> I do not see this patch in the staging branch, there are problems of 
> code style?

I think I just managed to miss actually applying this one in among all
the other stuff I applied on Friday. I'll take another look next week.

Ian.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v9] tools/libxl: Add qxl vga interface support for upstream qemu
  2013-02-16 13:20       ` Ian Campbell
@ 2013-02-19 18:26         ` Ian Jackson
  2013-02-20 15:46           ` [PATCH v11] tools/libxl: Add qxl vga interface support for upstream qemu [and 1 more messages] Ian Jackson
  2013-02-20 10:59         ` [PATCH v11] tools/libxl: Add qxl vga interface support for upstream qemu fantonifabio
  1 sibling, 1 reply; 8+ messages in thread
From: Ian Jackson @ 2013-02-19 18:26 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Zhou Peng, Fabio Fantoni, xen-devel@lists.xensource.com,
	Stefano Stabellini, fantonifabio@tiscali.it

Ian Campbell writes ("Re: [Xen-devel] [PATCH v9] tools/libxl: Add qxl vga interface support for upstream qemu"):
> On Sat, 2013-02-16 at 12:40 +0000, Fabio Fantoni wrote:
> > I do not see this patch in the staging branch, there are problems of 
> > code style?
> 
> I think I just managed to miss actually applying this one in among all
> the other stuff I applied on Friday. I'll take another look next week.

I see this has an ack from Stefano, but I have made some comments on
the coding style so I think we want a resend with those changes.

Fabio, would you please transfer the ack from Stefano's email into
your resend ?

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v11] tools/libxl: Add qxl vga interface support for upstream qemu
@ 2013-02-20 10:59         ` fantonifabio
  0 siblings, 0 replies; 8+ messages in thread
From: fantonifabio @ 2013-02-20 10:59 UTC (permalink / raw)
  To: xen-devel
  Cc: Zhou Peng, Fabio Fantoni, Ian.Jackson, Ian.Campbell,
	Stefano.Stabellini

From: Fabio Fantoni <fabio.fantoni@heliman.it>

Usage:
  vga="qxl"

Changes from v10:
- Some coding style fixes

Signed-off-by: Fabio Fantoni <fabio.fantoni@heliman.it>
Signed-off-by: Zhou Peng <zpengxen@gmail.com>
---
 docs/man/xl.cfg.pod.5       |   10 +++++++++-
 tools/libxl/libxl_create.c  |   19 +++++++++++++++++--
 tools/libxl/libxl_dm.c      |   18 +++++++++++++++---
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |   11 +++++------
 5 files changed, 47 insertions(+), 12 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 9c5def4..25523c9 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1003,6 +1003,9 @@ the amount of video ram is fixed at 4MB which is sufficient
 for 1024x768 at 32 bpp and videoram option is currently working
 only when using the upstream qemu-xen device-model.
 
+For B<qxl> vga, the default is both default and minimal 128MB.
+If B<videoram> is set less than 128MB, an error will be triggered.
+
 =item B<stdvga=BOOLEAN>
 
 Select a standard VGA card with VBE (VESA BIOS Extensions) as the
@@ -1014,9 +1017,14 @@ This option is deprecated, use vga="stdvga" instead.
 
 =item B<vga="STRING">
 
-Selects the emulated video card (stdvga|cirrus).
+Selects the emulated video card (stdvga|cirrus|qxl).
 The default is cirrus.
 
+In general, QXL should work with the Spice remote display protocol
+for acceleration, and QXL driver is necessary in guest in this case.
+QXL can also work with the VNC protocol, but it will be like a standard
+VGA without acceleration.
+
 =item B<vnc=BOOLEAN>
 
 Allow access to the display via the VNC protocol.  This enables the
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index fa81f88..efeebf2 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -198,14 +198,29 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
         if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
             b_info->shadow_memkb = 0;
 
+        if (b_info->u.hvm.vga.kind == LIBXL_VGA_INTERFACE_TYPE_QXL) {
+            if (b_info->device_model_version ==
+               LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
+                if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT) {
+                    b_info->video_memkb = (128 * 1024);
+                } else if (b_info->video_memkb < (128 * 1024)) {
+                    LOG(ERROR,
+                        "128 Mib videoram is the minimum for qxl default");
+                    return ERROR_INVAL;
+                }
+            } else {
+                LOG(ERROR,"qemu upstream required for qxl vga");
+                return ERROR_INVAL;
+            }
+        }
+
         if (b_info->u.hvm.vga.kind == LIBXL_VGA_INTERFACE_TYPE_STD &&
             b_info->device_model_version ==
             LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
                 if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
                     b_info->video_memkb = 16 * 1024;
                 else if (b_info->video_memkb < (16 * 1024) ){
-                    LOG(ERROR,
-                    "videoram must be at least 16 mb with stdvga");
+                    LOG(ERROR, "videoram must be at least 16 mb with stdvga");
                     return ERROR_INVAL;
                 }
         } else if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index a2c99bd..c4ca11e 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -181,6 +181,8 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc,
             break;
         case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
             break;
+        case LIBXL_VGA_INTERFACE_TYPE_QXL:
+            break;
         }
 
         if (b_info->u.hvm.boot) {
@@ -435,9 +437,19 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
             flexarray_vappend(dm_args, "-vga", "cirrus", NULL);
             if (b_info->video_memkb) {
                 flexarray_vappend(dm_args, "-global",
-                libxl__sprintf(gc, "vga.vram_size_mb=%d",
-                libxl__sizekb_to_mb(b_info->video_memkb)),
-                NULL);
+                    GCSPRINTF("vga.vram_size_mb=%d",
+                    libxl__sizekb_to_mb(b_info->video_memkb)), NULL);
+            }
+            break;
+        case LIBXL_VGA_INTERFACE_TYPE_QXL:
+            /* QXL have 2 ram regions, ram and vram */
+            flexarray_vappend(dm_args, "-vga", "qxl", NULL);
+            if (b_info->video_memkb) {
+                flexarray_vappend(dm_args, "-global",
+                    GCSPRINTF("qxl-vga.vram_size_mb=%lu",
+                    (b_info->video_memkb/2/1024)), "-global",
+                    GCSPRINTF("qxl-vga.ram_size_mb=%lu",
+                    (b_info->video_memkb/2/1024)), NULL);
             }
             break;
         }
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 89a8030..5b080ed 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -130,6 +130,7 @@ libxl_shutdown_reason = Enumeration("shutdown_reason", [
 libxl_vga_interface_type = Enumeration("vga_interface_type", [
     (1, "CIRRUS"),
     (2, "STD"),
+    (3, "QXL"),
     ], init_val = 0)
 
 #
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 003b129..a98705e 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1476,14 +1476,13 @@ skip_vfb:
     if (c_info->type == LIBXL_DOMAIN_TYPE_HVM) {
         if (!xlu_cfg_get_string (config, "vga", &buf, 0)) {
             if (!strcmp(buf, "stdvga")) {
-                b_info->u.hvm.vga.kind
-                = LIBXL_VGA_INTERFACE_TYPE_STD;
+                b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_STD;
             } else if (!strcmp(buf, "cirrus")) {
-                b_info->u.hvm.vga.kind
-                = LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
+                b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
+            } else if (!strcmp(buf, "qxl")) {
+                b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_QXL;
             } else {
-                fprintf(stderr,
-                "Unknown vga \"%s\" specified\n", buf);
+                fprintf(stderr, "Unknown vga \"%s\" specified\n", buf);
                 exit(1);
             }
         } else if (!xlu_cfg_get_long(config, "stdvga", &l, 0))
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v11] tools/libxl: Add qxl vga interface support for upstream qemu [and 1 more messages]
  2013-02-19 18:26         ` Ian Jackson
@ 2013-02-20 15:46           ` Ian Jackson
  0 siblings, 0 replies; 8+ messages in thread
From: Ian Jackson @ 2013-02-20 15:46 UTC (permalink / raw)
  To: fantonifabio@tiscali.it
  Cc: Zhou Peng, xen-devel@lists.xensource.com, Ian Campbell,
	Fabio Fantoni, Stefano Stabellini

fantonifabio@tiscali.it writes ("[PATCH v11] tools/libxl: Add qxl vga interface support for upstream qemu"):
> From: Fabio Fantoni <fabio.fantoni@heliman.it>
> 
> Usage:
>   vga="qxl"

Applied, thanks.

Ian Jackson writes ("Re: [Xen-devel] [PATCH v9] tools/libxl: Add qxl vga interface support for upstream qemu"):
> Fabio, would you please transfer the ack from Stefano's email into
> your resend ?

You didn't do this but I added it myself.

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-02-20 15:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-11 10:58 [PATCH v9] tools/libxl: Add qxl vga interface support for upstream qemu fantonifabio
2013-02-15 12:27 ` Stefano Stabellini
2013-02-15 13:46   ` Ian Campbell
2013-02-16 12:40     ` Fabio Fantoni
2013-02-16 13:20       ` Ian Campbell
2013-02-19 18:26         ` Ian Jackson
2013-02-20 15:46           ` [PATCH v11] tools/libxl: Add qxl vga interface support for upstream qemu [and 1 more messages] Ian Jackson
2013-02-20 10:59         ` [PATCH v11] tools/libxl: Add qxl vga interface support for upstream qemu fantonifabio

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.