Hi Jason,
Thanks for sharing.
Yesterday I added some hard code in libxl__build_device_model_args_new()
and it worked. :)
I think your method is much more flexible, I will have a try at it.
Regards,
Trigger
My draft patch:
diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index 9a8ddbe188..74961d0218 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -1346,7 +1346,7 @@ static int
libxl__build_device_model_args_new(libxl__gc *gc,
* Ensure that by default no display backend is created. Further
* options given below might then enable more.
*/
- flexarray_append_pair(dm_args, "-display", "none");
+ flexarray_append_pair(dm_args, "-display", "sdl,gl=on");
if (sdl && !is_stubdom) {
flexarray_append(dm_args, "-sdl");
@@ -1449,9 +1449,9 @@ static int
libxl__build_device_model_args_new(libxl__gc *gc,
libxl__sizekb_to_mb(b_info->video_memkb)));
break;
case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
- flexarray_append_pair(dm_args, "-device",
- GCSPRINTF("cirrus-vga,vgamem_mb=%d",
- libxl__sizekb_to_mb(b_info->video_memkb)));
+ flexarray_append_pair(dm_args, "-device", "virtio-vga-gl");
+ flexarray_append_pair(dm_args, "-vga", "none");
+ printf("Delete cirrus-vga, and add sdl display and
virtio-vga-gl!\n");
break;
case LIBXL_VGA_INTERFACE_TYPE_NONE:
break;
On Tue, Mar 8, 2022 at 10:19 AM Jason Andryuk <[email protected]> wrote:
> On Sun, Mar 6, 2022 at 7:47 PM Trigger Huang <[email protected]>
> wrote:
> >
> > Hi Alex,
> >
> > Thanks for the response.
> >
> > Actually my target is trying to enable virglrenderer on Xen based Qemu.
> Before, I have successfully enabled it on KVM based Qemu by the Qemu
> command line. Such as 'qemu-system-x86_64 -device virtio-vga-gl xxxxxxx'
> > If change to use xl, I don't know how to set this kind of special
> option(-device virtio-vga-gl ) to qemu after I checked the xl's arguments.
> Or do you have any idea? :)
>
> You can use device_model_args in your xl.cfg:
>
> device_model_args=[ "ARG", "ARG", ...]
> Pass additional arbitrary options on the device-model command
> line.
> Each element in the list is passed as an option to the device-
> model.
>
> Regards,
> Jason
>