xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v14] libxl: Add qxl vga interface support for upstream qemu
@ 2013-09-23 15:17 Fabio Fantoni
  2013-09-25 12:20 ` Ian Campbell
  0 siblings, 1 reply; 5+ messages in thread
From: Fabio Fantoni @ 2013-09-23 15:17 UTC (permalink / raw)
  To: xen-devel; +Cc: Zhou Peng, Fabio Fantoni, Ian.Campbell

Usage:
  vga="qxl"

Changes from v13:
- refresh
- update qemu parameters (from -vga to -device)

NOTE:
Seems needed other changes/fixes on xen side before
have it full working.
After latest Jan Beulich patches doesn't show any other
visible xen errors (at least I can't see them).

Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
Signed-off-by: Zhou Peng <zpengxen@gmail.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 docs/man/xl.cfg.pod.5       |   10 +++++++++-
 tools/libxl/libxl_create.c  |   16 ++++++++++++++++
 tools/libxl/libxl_dm.c      |    9 +++++++++
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |    2 ++
 5 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 769767b..576d055 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1018,6 +1018,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
@@ -1029,9 +1032,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 7567238..07ec4db 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -213,6 +213,22 @@ 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) {
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 43c3bec..51beb7c 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -200,6 +200,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) {
@@ -496,6 +498,13 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
                     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, "-device", 
+                GCSPRINTF("qxl-vga,vram_size_mb=%"PRIu64",ram_size_mb=%"PRIu64,
+                (b_info->video_memkb/2/1024), (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 049dbb5..90dad32 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -136,6 +136,7 @@ libxl_shutdown_reason = Enumeration("shutdown_reason", [
 libxl_vga_interface_type = Enumeration("vga_interface_type", [
     (1, "CIRRUS"),
     (2, "STD"),
+    (3, "QXL"),
     ], init_val = 1)
 
 libxl_vendor_device = Enumeration("vendor_device", [
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 3d7eaad..4bed428 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1462,6 +1462,8 @@ skip_vfb:
                 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;
+            } 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);
                 exit(1);
-- 
1.7.9.5

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

* Re: [PATCH v14] libxl: Add qxl vga interface support for upstream qemu
  2013-09-23 15:17 [PATCH v14] libxl: Add qxl vga interface support for upstream qemu Fabio Fantoni
@ 2013-09-25 12:20 ` Ian Campbell
  2013-09-25 12:49   ` Fabio Fantoni
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Campbell @ 2013-09-25 12:20 UTC (permalink / raw)
  To: Fabio Fantoni; +Cc: Zhou Peng, xen-devel

On Mon, 2013-09-23 at 17:17 +0200, Fabio Fantoni wrote:
> Usage:
>   vga="qxl"
> 
> Changes from v13:
> - refresh
> - update qemu parameters (from -vga to -device)
> 
> NOTE:
> Seems needed other changes/fixes on xen side before
> have it full working.

IIRC last time we applied this we reverted for the release because the
Xen side was broken, so I don't think we can take this yet. Please
resend once the Xen side stuff has been figured out.

Ian.

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

* Re: [PATCH v14] libxl: Add qxl vga interface support for upstream qemu
  2013-09-25 12:20 ` Ian Campbell
@ 2013-09-25 12:49   ` Fabio Fantoni
  2013-09-26  7:52     ` Dario Faggioli
  0 siblings, 1 reply; 5+ messages in thread
From: Fabio Fantoni @ 2013-09-25 12:49 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Zhou Peng, xen-devel

Il 25/09/2013 14:20, Ian Campbell ha scritto:
> On Mon, 2013-09-23 at 17:17 +0200, Fabio Fantoni wrote:
>> Usage:
>>    vga="qxl"
>>
>> Changes from v13:
>> - refresh
>> - update qemu parameters (from -vga to -device)
>>
>> NOTE:
>> Seems needed other changes/fixes on xen side before
>> have it full working.
> IIRC last time we applied this we reverted for the release because the
> Xen side was broken, so I don't think we can take this yet. Please
> resend once the Xen side stuff has been figured out.
>
> Ian.
>

Yes, I know, I posted it only if someone want use it for fast testing.
Now I'm trying to found the exact problem basing of Gerd Hoffmann reply.
I'll post when I'll found all details but seem problem of xen static 
memory mapping, probably the problem is not only with qxl but probably 
also vgas and pci/vgas passthrough can have similar problems in some cases.
I have a small question about qemu debug, based on the commit 
8e4610ec55751c3d1a4f515ba4041ca6faa16d15 should be enabled and also on 
build logs seem ok but on qemu log of domUs seem not enabled, I need to 
add something else on domU start that I not see?
Thanks for any reply and sorry for my bad english.

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

* Re: [PATCH v14] libxl: Add qxl vga interface support for upstream qemu
  2013-09-25 12:49   ` Fabio Fantoni
@ 2013-09-26  7:52     ` Dario Faggioli
  2013-09-26  8:20       ` Fabio Fantoni
  0 siblings, 1 reply; 5+ messages in thread
From: Dario Faggioli @ 2013-09-26  7:52 UTC (permalink / raw)
  To: Fabio Fantoni; +Cc: Zhou Peng, xen-devel, Ian Campbell


[-- Attachment #1.1: Type: text/plain, Size: 611 bytes --]

On mer, 2013-09-25 at 14:49 +0200, Fabio Fantoni wrote:
> Yes, I know, I posted it only if someone want use it for fast testing.
>
Right. Do you have a git repo/branch somewhere where one can find
everything that is needed for such quick testing? Asking because it
would probably make it easier to do so by quite a bit...

Regards,
Dario

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH v14] libxl: Add qxl vga interface support for upstream qemu
  2013-09-26  7:52     ` Dario Faggioli
@ 2013-09-26  8:20       ` Fabio Fantoni
  0 siblings, 0 replies; 5+ messages in thread
From: Fabio Fantoni @ 2013-09-26  8:20 UTC (permalink / raw)
  To: Dario Faggioli; +Cc: Zhou Peng, xen-devel, Ian Campbell

Il 26/09/2013 09:52, Dario Faggioli ha scritto:
> On mer, 2013-09-25 at 14:49 +0200, Fabio Fantoni wrote:
>> Yes, I know, I posted it only if someone want use it for fast testing.
>>
> Right. Do you have a git repo/branch somewhere where one can find
> everything that is needed for such quick testing? Asking because it
> would probably make it easier to do so by quite a bit...

Yes, I did it yesterday on github:
https://github.com/Fantu/Xen/commits/m2r-next
For other details about my test builds see the link below (it's a build 
of some days ago).
http://lists.xen.org/archives/html/xen-devel/2013-09/msg00944.html
I'm going to post a new report when I finish the tests.

For now I have some difficulties to find the exact changes to do on xen 
to solve the problem, but I'm trying to follow Gerd Hoffmann advices:
http://lists.xen.org/archives/html/xen-devel/2013-09/msg02458.html

Any help or advice is really welcome.

>
> Regards,
> Dario
>

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

end of thread, other threads:[~2013-09-26  8:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-23 15:17 [PATCH v14] libxl: Add qxl vga interface support for upstream qemu Fabio Fantoni
2013-09-25 12:20 ` Ian Campbell
2013-09-25 12:49   ` Fabio Fantoni
2013-09-26  7:52     ` Dario Faggioli
2013-09-26  8:20       ` Fabio Fantoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).