From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1Ixm-0003B3-I5 for qemu-devel@nongnu.org; Tue, 24 Nov 2015 14:09:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1Ixh-0007Cc-Ih for qemu-devel@nongnu.org; Tue, 24 Nov 2015 14:09:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1Ixh-0007CX-DL for qemu-devel@nongnu.org; Tue, 24 Nov 2015 14:09:09 -0500 References: <1448391424-32360-1-git-send-email-eblake@redhat.com> From: Eric Blake Message-ID: <5654B5D3.60809@redhat.com> Date: Tue, 24 Nov 2015 12:09:07 -0700 MIME-Version: 1.0 In-Reply-To: <1448391424-32360-1-git-send-email-eblake@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1XJxmR0pK2wQkBK8idNi445TQlvXmSEnT" Subject: Re: [Qemu-devel] [PATCH for-2.5] qga: Better mapping of SEEK_* in guest-file-seek List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mlureau@redhat.com, armbru@redhat.com, mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1XJxmR0pK2wQkBK8idNi445TQlvXmSEnT Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/24/2015 11:57 AM, Eric Blake wrote: > Exposing OS-specific SEEK_ constants in our qapi was a mistake > (if the host has SEEK_CUR as 1, but the guest has it as 2, then > the semantics are unclear what should happen); if we had a time > machine, we would instead expose only a symbolic enum. It's too > late to change the fact that we have an integer in qapi, but we > can at least document what mapping we want to enforce for all > qga clients (and luckily, it happens to be the mapping that both > Linux and Windows use), then fix the code to match that mapping. > It also helps us filter out unsupported SEEK_DATA and SEEK_HOLE. >=20 > Signed-off-by: Eric Blake > --- > qga/commands-posix.c | 19 ++++++++++++++++++- > qga/commands-win32.c | 20 +++++++++++++++++++- > qga/qapi-schema.json | 4 ++-- > 3 files changed, 39 insertions(+), 4 deletions(-) Hmm, we probably ought to squash in: diff --git i/tests/test-qga.c w/tests/test-qga.c index 6473846..642dcb5 100644 --- i/tests/test-qga.c +++ w/tests/test-qga.c @@ -457,7 +457,7 @@ static void test_qga_file_ops(gconstpointer fix) cmd =3D g_strdup_printf("{'execute': 'guest-file-seek'," " 'arguments': { 'handle': %" PRId64 ", " " 'offset': %d, 'whence': %d } }", - id, 6, SEEK_SET); + id, 6, 0); ret =3D qmp_fd(fixture->fd, cmd); qmp_assert_no_error(ret); val =3D qdict_get_qdict(ret, "return"); --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --1XJxmR0pK2wQkBK8idNi445TQlvXmSEnT 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/ iQEcBAEBCAAGBQJWVLXUAAoJEKeha0olJ0NqMiwH/0FEImCOQPb7nH6s4IRTYmvx 8QiGIJd4LeFX04cjxKjJR04opuFDobC66mPG5PR7RfvYEZopZpmB3iuRqJd9jXUS oLvUhEgbXMSrEnLj+kHJ0suxByDnmVqDuyH7ODbQl34gK4ijnGpUGQq+gptkiaa3 +ZypX5cZh4idKlYlKuGDv8wzckCoEUwx/5WXdgZTcG1nIehSj7isusky3UHkRqYy U/Sepn+DDLd4MwMy1Tzc5x7Y3hAdBuxAnnKPeWazBATll9mU8WKMuA3dgPh0ELww XrbYagTKswaztTpAEXe/R2xvOzdBF+12yjxRYIPt9cLFVCfYePfGSXxEqJ6PLzo= =oVA6 -----END PGP SIGNATURE----- --1XJxmR0pK2wQkBK8idNi445TQlvXmSEnT--