From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmfIJ-0006kn-TR for qemu-devel@nongnu.org; Fri, 07 Nov 2014 03:53:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XmfID-0006ZW-3D for qemu-devel@nongnu.org; Fri, 07 Nov 2014 03:53:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmfIC-0006ZQ-T0 for qemu-devel@nongnu.org; Fri, 07 Nov 2014 03:53:17 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sA78rGpB009171 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 7 Nov 2014 03:53:16 -0500 Message-ID: <545C8879.7010303@redhat.com> Date: Fri, 07 Nov 2014 09:53:13 +0100 From: Eric Blake MIME-Version: 1.0 References: <1415335285-1579-1-git-send-email-akong@redhat.com> <1415335285-1579-2-git-send-email-akong@redhat.com> In-Reply-To: <1415335285-1579-2-git-send-email-akong@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="95Gav6u5QAf6apjtUgQpSM38mpOA40mDO" Subject: Re: [Qemu-devel] [PATCH for-2.2 2/2] QMP/input-send-event: make console parameter optional List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amos Kong , qemu-devel@nongnu.org Cc: mtosatti@redhat.com, kraxel@redhat.com, armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --95Gav6u5QAf6apjtUgQpSM38mpOA40mDO Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/07/2014 05:41 AM, Amos Kong wrote: > The 'QemuConsole' is the input source for handler, we share some > input handlers to process the input events from different QemuConsole. >=20 > Normally we only have one set of keyboard, mouse, usbtablet, etc. > The devices have different mask, it's fine to just checking mask to > insure that the handler has the ability to process the event. >=20 > I saw we try to bind console to handler in usb/dev-hid.c, but display > always isn't available at that time. >=20 > If we have multiseat setup (as Gerd said), we only have 'problem' in > this case. Actually event from different devices have the same effect > for system, it's fine to always use the first available handler > without caring about the console. >=20 > For send-key command, we just pass a NULL for console parameter in > calling qemu_input_event_send_key(NULL, ..), but 'input-send-event' > needs to care more devices. >=20 > Conclusion: > Generally assigning the special console is meanless, and we can't s/meanless/meaningless/ > directly remove the QMP parameter for compatibility. >=20 > So we can make the parameter optional. The parameter might be useful > for some special condition: we have multiple devices without binding > console and they all have the ability(mask) to process events, and > we don't want to use the first one. >=20 > Cc: Gerd Hoffmann > Cc: Markus Armbruster > Cc: Marcelo Tosatti > Signed-off-by: Amos Kong > --- > qapi-schema.json | 4 ++-- > qmp-commands.hx | 4 ++-- > ui/input.c | 15 +++++++++------ > 3 files changed, 13 insertions(+), 10 deletions(-) >=20 > diff --git a/qapi-schema.json b/qapi-schema.json > index a1573d8..367fb8e 100644 > --- a/qapi-schema.json > +++ b/qapi-schema.json > @@ -3249,7 +3249,7 @@ > # > # Send input event(s) to guest. > # > -# @console: Which console to send event(s) to. > +# @console: #optional console to send event(s) to. Might be worth mentioning that the default is the first available console. The change is safe from back-compat perspective. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --95Gav6u5QAf6apjtUgQpSM38mpOA40mDO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJUXIh5AAoJEKeha0olJ0NqC6sIAKdBswz5EPCWJn/4ugo2fMRr 3sk6V2aJVqym4xJ9jpbHPFJP/4Kq4v24zouJf3yP1GYd5gqcAZeL7UHF6sB3txLa TAHNIKuuntrpPOf0GTBdW4TcxDG2/KLNsPd+VxAPFBlc+ZW+Qyvcs450rvNQhU/f +be0k9HFV6ebLoNC/sMLHBmPmAG2CoIbpt2Me8zp4UfC8jnqwb86ewFs3Dpr/JWm aoF6fkk/QpRbXUp4/i20KXHIGofLf9BX84qQmISn3lqFgPgWJGEMPU/JJz/fRDj8 R0FGQxGPWGgKrJ2TEeRm/cDyKPGELt11g8nUU8KerzQwbTLGJ/Zj8CqT3u9XJZ0= =OmNw -----END PGP SIGNATURE----- --95Gav6u5QAf6apjtUgQpSM38mpOA40mDO--