All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: mlureau@redhat.com, armbru@redhat.com, mdroth@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH for-2.5] qga: Better mapping of SEEK_* in guest-file-seek
Date: Tue, 24 Nov 2015 12:09:07 -0700	[thread overview]
Message-ID: <5654B5D3.60809@redhat.com> (raw)
In-Reply-To: <1448391424-32360-1-git-send-email-eblake@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1644 bytes --]

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.
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
>  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 = g_strdup_printf("{'execute': 'guest-file-seek',"
                           " 'arguments': { 'handle': %" PRId64 ", "
                           " 'offset': %d, 'whence': %d } }",
-                          id, 6, SEEK_SET);
+                          id, 6, 0);
     ret = qmp_fd(fixture->fd, cmd);
     qmp_assert_no_error(ret);
     val = qdict_get_qdict(ret, "return");


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2015-11-24 19:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24 18:57 [Qemu-devel] [PATCH for-2.5] qga: Better mapping of SEEK_* in guest-file-seek Eric Blake
2015-11-24 19:09 ` Eric Blake [this message]
2015-11-24 20:01   ` Marc-André Lureau
2015-11-25  8:11   ` Markus Armbruster
2015-11-25 14:06     ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5654B5D3.60809@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mlureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.