From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1IZp-0006RR-7S for qemu-devel@nongnu.org; Tue, 24 Nov 2015 13:44:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1IZm-00016J-22 for qemu-devel@nongnu.org; Tue, 24 Nov 2015 13:44:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1IZl-000165-Tp for qemu-devel@nongnu.org; Tue, 24 Nov 2015 13:44:26 -0500 References: <1448382858-28616-1-git-send-email-marcandre.lureau@redhat.com> <1448382858-28616-2-git-send-email-marcandre.lureau@redhat.com> <56549E87.4060200@redhat.com> <1709209797.16598918.1448387931887.JavaMail.zimbra@redhat.com> From: Eric Blake Message-ID: <5654B004.1080504@redhat.com> Date: Tue, 24 Nov 2015 11:44:20 -0700 MIME-Version: 1.0 In-Reply-To: <1709209797.16598918.1448387931887.JavaMail.zimbra@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="442vqWhLitb2en8lhTsg42Xh69jrwoVlq" Subject: Re: [Qemu-devel] [PATCH 2/2] tests: add file-write-read test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= Cc: marcandre lureau , qemu-devel@nongnu.org, Markus Armbruster , Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --442vqWhLitb2en8lhTsg42Xh69jrwoVlq Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/24/2015 10:58 AM, Marc-Andr=C3=A9 Lureau wrote: >>> + cmd =3D g_strdup_printf("{'execute': 'guest-file-seek'," >>> + " 'arguments': { 'handle': %" PRId64 ", " >>> + " 'offset': %d, 'whence': %d } }", >>> + id, 0, SEEK_SET); >> >> EWWWW. We seriously released this interface as taking an integer for >> whence? SEEK_SET is not required to be the same value on every >> platform. Which is a severe problem if the guest and the host are on >> different OS with different choices of values for the constants (if >> SEEK_CUR on my host is 1, but 1 maps to SEEK_END on my guest OS, what >> behavior am I going to get?). >> >> It would be worth a patch to qga to document the actual integer values= >> that we have hard-coded (0 for set, 1 for cur, 2 for end; even if that= >> differs from the guest's local definition of the SEEK_ constants), >> and/or to fix the interface to take symbolic names rather than integer= s >> for the whence argument. >> >> Our whole guest-file-* API is lousy. >=20 > Are you going to send a patch for this? Sure, now that you've asked. For 2.5, it will just be documentation and mapping integers to the correct constants (any magic of using a qapi alternate type to support symbolic names would be 2.6 territory). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --442vqWhLitb2en8lhTsg42Xh69jrwoVlq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWVLAEAAoJEKeha0olJ0NqUagH/RUfTBDJm3GLaYimyp4ce+JI w8ZwWAnB1Zx9w0/1G7cuSURjrKAgC5bB5M0VyRcWX+h8fNRD8x1V2YuqlqMG9YDP Qt3IilmQGiMutdemgX9Dum3hydLhd6dNvoGkqNk7hwfau8VrTkgcVrAJVQ7WfOGE ZPWz211HodEGf7yWoEYhmY2Xyuofh8XOor/oSTy2NaqtXEyLOswuIIcvnyZGuvI/ MN6cFcjEtaMfsqaahDwSAll1WlFXGUzlE1DdUrdNUrxeDA2c9rGvIsqavwd8VyK5 fdZx3RatStO0+g+A98GvX9b+64SaPyqDeTjKQ65ACviFyixgfAK1usXdfRa74kE= =xbZx -----END PGP SIGNATURE----- --442vqWhLitb2en8lhTsg42Xh69jrwoVlq--