From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsX03-0006C3-VA for qemu-devel@nongnu.org; Thu, 05 Jun 2014 08:42:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WsWzw-0001nE-PS for qemu-devel@nongnu.org; Thu, 05 Jun 2014 08:42:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62462) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsWzw-0001n1-H0 for qemu-devel@nongnu.org; Thu, 05 Jun 2014 08:42:24 -0400 Message-ID: <539065AC.4060705@redhat.com> Date: Thu, 05 Jun 2014 06:42:20 -0600 From: Eric Blake MIME-Version: 1.0 References: <1401289056-28171-1-git-send-email-imammedo@redhat.com> <1401289056-28171-3-git-send-email-imammedo@redhat.com> <5388A168.7040301@redhat.com> <20140530173942.10601b7e@thinkpad> <5388A754.6090806@redhat.com> <20140605121010.15e93695@nial.usersys.redhat.com> In-Reply-To: <20140605121010.15e93695@nial.usersys.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="eNTWGeT9JLtNUL4MgnTB6H4lRkvp8U0rd" Subject: Re: [Qemu-devel] [RFC 2/5] acpi: introduce TYPE_ACPI_DEVICE_IF interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: vasilis.liaskovitis@profitbricks.com, mst@redhat.com, pkrempa@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --eNTWGeT9JLtNUL4MgnTB6H4lRkvp8U0rd Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/05/2014 04:10 AM, Igor Mammedov wrote: >> And my question in 4/5 remains - should 'source' and/or 'status' be >> defined as an enum rather than an open-coded int? > Using enum for 'source' event, might be possible if we restrict ourselv= es > to a limit set of supported values and ignore the rest of > unknown/not implemented values. It might be not a good idea to lose > events because QEMU doesn't know about them. > Also from maintainability PoV it would add a bunch of mapping code > from 'int' into our enum, which would essentially prevent > new source events be exposed to users until QEMU adds support for > them. >=20 > For 'status' code it'd add a lot more mapping code to translate its > known values into enum since it's changing depending on 'source'. > Especially if it comes to expanding range of known values in > table 6-160 of ACPI5.0 spec. >=20 > I think it would be better to expose raw values the guest reported > via _OST and let management to pick-up ones it's interested in and > allow it to handle not implemented ones as it wishes rather than > hiding them at QEMU level. Fair enough - if qemu is just doing passthrough, and is not doing any particular change in behavior based on particular values being passed through, then exposing raw status codes is the only scalable approach (new codes are equally uninteresting to qemu, and passthrough handles a raw value better than qemu trying to interpret and name all values being passed through). But probably worth documenting this rationale in the commit message, so we can remember why we chose to go this way. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --eNTWGeT9JLtNUL4MgnTB6H4lRkvp8U0rd 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/ iQEcBAEBCAAGBQJTkGWsAAoJEKeha0olJ0NqqOQH/A4mReo4I2ae+EKI1LfsMgit 7k9wzU3Rbi5zrtvKWOvlVi/JY1S+V1VOsjJwVqyxjGBZq7euK6IMPNtokZtPN2Hg DEPfRL02pXBWLYdYabVwraJVU8G6LO1yYNPbV3Vrz52ZRAL1Jri+5vuO1g6Vm3r3 O9idLYLq6ByDwquOZamJZPRGBK2SAm98WjEV3ltMaML760Do2Ohdf78jbIP08g3l oc3j0zAcRtRbZknQ0a//a6kloMVEl9SDYKMOFFXFHDY3CZMOsuZEXONoRGAj3DAk Itv/FRu9KHor5hDrmSsQoRcjW75cm0JAr9xrv+ZkfF90jk28TtV3fh8B3YrJm9w= =dXAJ -----END PGP SIGNATURE----- --eNTWGeT9JLtNUL4MgnTB6H4lRkvp8U0rd--