[libvirt] [PATCH 08/10 V2] send-key: Implementing the remote protocol

Matthias Bolte matthias.bolte at googlemail.com
Tue Jun 14 09:32:50 UTC 2011


2011/6/14 Daniel P. Berrange <berrange at redhat.com>:
> On Tue, Jun 14, 2011 at 11:21:39AM +0200, Matthias Bolte wrote:
>> 2011/6/14 Daniel P. Berrange <berrange at redhat.com>:
>> > On Tue, Jun 07, 2011 at 05:11:15PM +0800, Lai Jiangshan wrote:
>> >> Signed-off-by: Lai Jiangshan <laijs at cn.fujitsu.com>
>> >> ---
>> >>  src/remote/remote_driver.c   |    1 +
>> >>  src/remote/remote_protocol.x |   16 +++++++++++++++-
>> >>  src/remote_protocol-structs  |   11 +++++++++++
>> >>  3 files changed, 27 insertions(+), 1 deletions(-)
>> >>
>> >> diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
>> >> index 8335a1a..f08a609 100644
>> >> --- a/src/remote/remote_driver.c
>> >> +++ b/src/remote/remote_driver.c
>> >> @@ -6337,6 +6337,7 @@ static virDriver remote_driver = {
>> >>      .domainMigratePerform3 = remoteDomainMigratePerform3, /* 0.9.2 */
>> >>      .domainMigrateFinish3 = remoteDomainMigrateFinish3, /* 0.9.2 */
>> >>      .domainMigrateConfirm3 = remoteDomainMigrateConfirm3, /* 0.9.2 */
>> >> +    .domainSendKey = remoteDomainSendKey, /* 0.9.3 */
>> >>  };
>> >>
>> >>  static virNetworkDriver network_driver = {
>> >> diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
>> >> index c9b8cff..2126325 100644
>> >> --- a/src/remote/remote_protocol.x
>> >> +++ b/src/remote/remote_protocol.x
>> >> @@ -191,6 +191,11 @@ const REMOTE_SECRET_UUID_LIST_MAX = 16384;
>> >>   */
>> >>  const REMOTE_CPU_BASELINE_MAX = 256;
>> >>
>> >> +/*
>> >> + * Max number of sending keycodes.
>> >> + */
>> >> +const REMOTE_SEND_KEY_MAX = 16;
>> >
>> > Should call this  REMOTE_DOMAIN_SEND_KEY_MAX really
>> >
>>
>> And I still wonder why we go with such a low limit here that is not
>> documented anywhere. If an applications tries to send 17 key strokes
>> in one call it'll just fail with an RPC error.
>
> Perhaps it can be raised, but really this API is only for doing things
> like sending magic key combinations like Ctrl-Alt-Delete,  Ctrl+F12 etc.
>
> It isn't suitable for sending large volumes of text, for the same
> reason we don't want todo that via GTK-VNC:
>
>  http://mail.gnome.org/archives/gtk-vnc-list/2010-December/msg00004.html
>
>  "Another fairly serious problem is that if you paste a few kilobytes
>   of data then you're pushing the keyboard input stack incredibly hard.
>   These interfaces are designed for human typing speeds and even a few
>   kilobytes will drive Thunderbird (say) to distraction.   Tens of
>   kilobytes will probably lock you out for longer than you're prepared
>   to wait."
>
> Of course '16' is no where near kilobytes, so perhaps we can raise it
> a little, but I don't think we should give application developers the
> idea that this is useful for sending large data volumes.
>
> Regards,
> Daniel

Okay, I'm fine with that. But then we should also state this in the
documentation of virDomainSendKey (patch 7/10) that this is only meant
for a few key stokes at a time.

-- 
Matthias Bolte
http://photron.blogspot.com




More information about the libvir-list mailing list