From: Eric Blake <eblake@redhat.com>
To: "Marc-André Lureau" <mlureau@redhat.com>
Cc: marcandre lureau <marcandre.lureau@redhat.com>,
qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
Michael Roth <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] tests: add file-write-read test
Date: Tue, 24 Nov 2015 11:44:20 -0700 [thread overview]
Message-ID: <5654B004.1080504@redhat.com> (raw)
In-Reply-To: <1709209797.16598918.1448387931887.JavaMail.zimbra@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1454 bytes --]
On 11/24/2015 10:58 AM, Marc-André Lureau wrote:
>>> + cmd = 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 integers
>> for the whence argument.
>>
>> Our whole guest-file-* API is lousy.
>
> 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).
--
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 --]
next prev parent reply other threads:[~2015-11-24 18:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-24 16:34 [Qemu-devel] [PATCH 1/2] qga: flush implicitely when needed marcandre.lureau
2015-11-24 16:34 ` [Qemu-devel] [PATCH 2/2] tests: add file-write-read test marcandre.lureau
2015-11-24 17:29 ` Eric Blake
2015-11-24 17:58 ` Marc-André Lureau
2015-11-24 18:44 ` Eric Blake [this message]
2015-11-24 17:15 ` [Qemu-devel] [PATCH 1/2] qga: flush implicitely when needed Eric Blake
2015-11-24 17:52 ` Marc-André Lureau
2015-11-24 19:08 ` 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=5654B004.1080504@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=marcandre.lureau@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).