From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0BIg-0008K9-G7 for qemu-devel@nongnu.org; Thu, 26 Jun 2014 11:09:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0BIZ-0000SC-Sq for qemu-devel@nongnu.org; Thu, 26 Jun 2014 11:09:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26399) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0BIZ-0000Rv-L9 for qemu-devel@nongnu.org; Thu, 26 Jun 2014 11:09:15 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5QF9FF4021315 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 26 Jun 2014 11:09:15 -0400 Message-ID: <53AC379A.2090902@redhat.com> Date: Thu, 26 Jun 2014 09:09:14 -0600 From: Eric Blake MIME-Version: 1.0 References: <1403781075-30989-1-git-send-email-lersek@redhat.com> <1403781075-30989-3-git-send-email-lersek@redhat.com> <53AC0D67.7040402@redhat.com> <53AC2268.2000503@redhat.com> In-Reply-To: <53AC2268.2000503@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GPwkhncJSsU4RlnT0DtGWx1kTrFsGdBih" Subject: Re: [Qemu-devel] [PATCH for-2.1 v2 2/2] char: report frontend open/closed state in 'query-chardev' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek , qemu-devel@nongnu.org, mprivozn@redhat.com, kraxel@redhat.com, amit.shah@redhat.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --GPwkhncJSsU4RlnT0DtGWx1kTrFsGdBih Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/26/2014 07:38 AM, Laszlo Ersek wrote: >>> ## >>> -{ 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'}= } >>> +{ 'type': 'ChardevInfo', 'data': {'label': 'str', >>> + 'filename': 'str', >>> + 'frontend-open': 'bool'} } >> >> Hmm; I wonder if this should instead be >> 'frontend-status':'VirtioSerialPortStatus', to reuse the type from pat= ch >> 1/2. That way, if we ever add a third state, then both the event and >> the poll will be reusing the same enum values to report that state. >=20 > I expected this remark :) >=20 > The difference is rooted in the fact that the event approaches the > virtio-serial port status from the frontend (ie. guest) side, while the= > query approaches the same from the backend (ie. host, chardev) side. >=20 > If I wanted to bring those in future-proof sync, then I would have to > change the underlying, generic chardev machinery -- namely, the fe_open= > field, and everything that operates on it. >=20 > I actually considered the other direction too: rather than introducing > status:VirtioSerialPortStatus, just add open:bool (which was your > original suggestion in your v1 review). I decided against it because th= e > current list of enum constants (connected, disconnected) expresses just= > the same, and it'll be a *tiny* bit easier to extend, should that > necessity arise. >=20 > Sounds acceptible? :) If not, then I'm OK to replace > status:VirtioSerialPortStatus with open:bool in the first patch. If we ever add another state in the future, then both places would be touched at the same time to figure out how to support that new state. So I agree with your counter-proposal of just simplifying things to use open:bool in the first patch; it also has the benefit of less code (no need to add an enum). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --GPwkhncJSsU4RlnT0DtGWx1kTrFsGdBih 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 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTrDeaAAoJEKeha0olJ0Nq6/kIAI3F7W9TTevLCVwhnz9/oe65 oV1D+qXueyguv7PNCvPwQa7bbLline+SYe1XS18ZKUXTAaQKLVxnhGfrbZU1AHOx rslHAZyvWxyvIjtWyz7jtMfNI7lXq9qf807+N8JK32cu5ZLaVWVVgjk3zPTzlxGZ nfiizeuiNh2Tsp4MIhOKwuijNcfqwEB2PVCYavsP6sZyVxo9/U+3TxaMO8LFdk/x rUxyz6T2NOk4JJbD8v8VJQ3qBnPXwMAHpPfuQdkKpJUnz+AsDLmSJP/6UHHVoOSp FYpQ8oQOkAFL0vfyjcnS6Sg9lact1iay71w8K5c+PlMWFlZ5Oclz/ZzwWfhC2Aw= =FVr7 -----END PGP SIGNATURE----- --GPwkhncJSsU4RlnT0DtGWx1kTrFsGdBih--