Stefano Stabellini
2011-Jun-24 16:29 UTC
[Xen-devel] [PATCH] libxl: add a vkbd device to HVM guests by default
PV on HVM drivers can connect to the vkbd device to receive mouse and keyboard events from Qemu. The advantage over USB is that vkbd doesn''t require frequent wakeups in Qemu. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> diff -r f17956fd6976 tools/libxl/libxl_create.c --- a/tools/libxl/libxl_create.c Fri Jun 17 16:10:48 2011 +0000 +++ b/tools/libxl/libxl_create.c Fri Jun 24 16:19:29 2011 +0000 @@ -469,6 +469,7 @@ static int do_domain_create(libxl__gc *g } if (d_config->c_info.hvm) { libxl_device_console console; + libxl_device_vkb vkb; ret = init_console_info(&console, 0); if ( ret ) @@ -476,6 +477,11 @@ static int do_domain_create(libxl__gc *g libxl__device_console_add(gc, domid, &console, &state); libxl_device_console_destroy(&console); + + memset(&vkb, 0x00, sizeof(vkb)); + libxl_device_vkb_add(ctx, domid, &vkb); + libxl_device_vkb_destroy(&vkb); + dm_info->domid = domid; ret = libxl__create_device_model(gc, dm_info, d_config->disks, d_config->num_disks, _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Campbell
2011-Jun-27 09:44 UTC
Re: [Xen-devel] [PATCH] libxl: add a vkbd device to HVM guests by default
On Fri, 2011-06-24 at 17:29 +0100, Stefano Stabellini wrote:> PV on HVM drivers can connect to the vkbd device to receive mouse and > keyboard events from Qemu. The advantage over USB is that vkbd doesn''t > require frequent wakeups in Qemu.Do we need an unplug protocol in order to stop these frequent wakeups? Do frontends/guests generally cope with two keyboards correctly? (whatever correctly means, I guess it''s not obvious once you have a vfb as well as emulated VGA).> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> > > diff -r f17956fd6976 tools/libxl/libxl_create.c > --- a/tools/libxl/libxl_create.c Fri Jun 17 16:10:48 2011 +0000 > +++ b/tools/libxl/libxl_create.c Fri Jun 24 16:19:29 2011 +0000 > @@ -469,6 +469,7 @@ static int do_domain_create(libxl__gc *g > } > if (d_config->c_info.hvm) { > libxl_device_console console; > + libxl_device_vkb vkb; > > ret = init_console_info(&console, 0); > if ( ret ) > @@ -476,6 +477,11 @@ static int do_domain_create(libxl__gc *g > libxl__device_console_add(gc, domid, &console, &state); > libxl_device_console_destroy(&console); > > + > + memset(&vkb, 0x00, sizeof(vkb)); > + libxl_device_vkb_add(ctx, domid, &vkb); > + libxl_device_vkb_destroy(&vkb); > + > dm_info->domid = domid; > ret = libxl__create_device_model(gc, dm_info, > d_config->disks, d_config->num_disks, > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Campbell
2011-Jun-27 12:14 UTC
Re: [Xen-devel] [PATCH] libxl: add a vkbd device to HVM guests by default
On Mon, 2011-06-27 at 13:14 +0100, Stefano Stabellini wrote:> On Mon, 27 Jun 2011, Ian Campbell wrote: > > On Fri, 2011-06-24 at 17:29 +0100, Stefano Stabellini wrote: > > > PV on HVM drivers can connect to the vkbd device to receive mouse and > > > keyboard events from Qemu. The advantage over USB is that vkbd doesn''t > > > require frequent wakeups in Qemu. > > > > Do we need an unplug protocol in order to stop these frequent wakeups? > > No, we just need to disable USB. The only reason to have USB is to have > USB tablet support (absolute mouse coordinates).That means users need to be aware that they have the appropriate frontends and manually edit their guest config?> > Do frontends/guests generally cope with two keyboards correctly? > > (whatever correctly means, I guess it''s not obvious once you have a vfb > > as well as emulated VGA). > > Yes, without any problems. Having multiple vfbs would be more > complicated but it is not part of this series.OK Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefano Stabellini
2011-Jun-27 12:14 UTC
Re: [Xen-devel] [PATCH] libxl: add a vkbd device to HVM guests by default
On Mon, 27 Jun 2011, Ian Campbell wrote:> On Fri, 2011-06-24 at 17:29 +0100, Stefano Stabellini wrote: > > PV on HVM drivers can connect to the vkbd device to receive mouse and > > keyboard events from Qemu. The advantage over USB is that vkbd doesn''t > > require frequent wakeups in Qemu. > > Do we need an unplug protocol in order to stop these frequent wakeups?No, we just need to disable USB. The only reason to have USB is to have USB tablet support (absolute mouse coordinates).> Do frontends/guests generally cope with two keyboards correctly? > (whatever correctly means, I guess it''s not obvious once you have a vfb > as well as emulated VGA).Yes, without any problems. Having multiple vfbs would be more complicated but it is not part of this series. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefano Stabellini
2011-Jun-27 13:20 UTC
Re: [Xen-devel] [PATCH] libxl: add a vkbd device to HVM guests by default
On Mon, 27 Jun 2011, Ian Campbell wrote:> On Mon, 2011-06-27 at 13:14 +0100, Stefano Stabellini wrote: > > On Mon, 27 Jun 2011, Ian Campbell wrote: > > > On Fri, 2011-06-24 at 17:29 +0100, Stefano Stabellini wrote: > > > > PV on HVM drivers can connect to the vkbd device to receive mouse and > > > > keyboard events from Qemu. The advantage over USB is that vkbd doesn''t > > > > require frequent wakeups in Qemu. > > > > > > Do we need an unplug protocol in order to stop these frequent wakeups? > > > > No, we just need to disable USB. The only reason to have USB is to have > > USB tablet support (absolute mouse coordinates). > > That means users need to be aware that they have the appropriate > frontends and manually edit their guest config?Consider that usb is already off by default, users need to add usb=1 to the config file in order to enable it. Also even with usb=0 everything will keep working as expected, only the "mouse experience" will be worse. So I don''t see this as a particular problem either way, maybe we should just add a note to the 4.2 xen release about the PV mouse and keyboard protocol and why it is a good idea to disable usb. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel