From: Anthony Liguori <anthony@codemonkey.ws>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1.0] 9pfs: improve portability to older systems
Date: Mon, 28 Nov 2011 16:36:18 -0600 [thread overview]
Message-ID: <4ED40CE2.70903@codemonkey.ws> (raw)
In-Reply-To: <8762ibl5xg.fsf@linux.vnet.ibm.com>
On 11/23/2011 12:16 AM, Aneesh Kumar K.V wrote:
> On Mon, 21 Nov 2011 09:29:11 +0100, Paolo Bonzini<pbonzini@redhat.com> wrote:
>> Small requirements on "new" features have percolated to virtio-9p-local.c.
>> In particular, the utimensat wrapper actually only supports dirfd = AT_FDCWD
>> and flags = AT_SYMLINK_NOFOLLOW in the fallback code. Remove the arguments
>> so that virtio-9p-local.c will not use AT_* constants.
>>
>> At the same time, fail local_ioc_getversion if the ioctl is not supported
>> by the host.
>>
>> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
Hrm, I may have messed this up. My mailbox processing script seems to have
found Aneesh's patch instead of Paolo's.
Can ya'll take a look at 2507718baf311ea78156c6777d38410a9f89ce89 and tell me if
I need to revert it?
Regards,
Anthony Liguori
>> ---
>> hw/9pfs/virtio-9p-local.c | 7 +++++--
>> oslib-posix.c | 5 ++---
>> qemu-os-posix.h | 3 +--
>> 3 files changed, 8 insertions(+), 7 deletions(-)
>>
>> diff --git a/hw/9pfs/virtio-9p-local.c b/hw/9pfs/virtio-9p-local.c
>> index 7f1c089..cbd07e8 100644
>> --- a/hw/9pfs/virtio-9p-local.c
>> +++ b/hw/9pfs/virtio-9p-local.c
>> @@ -583,8 +583,7 @@ static int local_utimensat(FsContext *s, V9fsPath *fs_path,
>> char buffer[PATH_MAX];
>> char *path = fs_path->data;
>>
>> - return qemu_utimensat(AT_FDCWD, rpath(s, path, buffer), buf,
>> - AT_SYMLINK_NOFOLLOW);
>> + return qemu_utimens(rpath(s, path, buffer), buf);
>> }
>>
>> static int local_remove(FsContext *ctx, const char *path)
>> @@ -694,6 +693,7 @@ static int local_ioc_getversion(FsContext *ctx, V9fsPath *path,
>> mode_t st_mode, uint64_t *st_gen)
>> {
>> int err;
>> +#ifdef FS_IOC_GETVERSION
>> V9fsFidOpenState fid_open;
>>
>> /*
>> @@ -709,6 +709,9 @@ static int local_ioc_getversion(FsContext *ctx, V9fsPath *path,
>> }
>> err = ioctl(fid_open.fd, FS_IOC_GETVERSION, st_gen);
>> local_close(ctx,&fid_open);
>> +#else
>> + err = -ENOTTY;
>> +#endif
>> return err;
>
>
> I guess we can also make sure we don't call local_ioc_getversion at
> all.
>
> diff --git a/hw/9pfs/virtio-9p-local.c b/hw/9pfs/virtio-9p-local.c
> index 0da3bdd..1c349af 100644
> --- a/hw/9pfs/virtio-9p-local.c
> +++ b/hw/9pfs/virtio-9p-local.c
> @@ -714,10 +714,14 @@ static int local_ioc_getversion(FsContext *ctx, V9fsPath *path,
>
> static int local_init(FsContext *ctx)
> {
> - int err;
> + int err = 0;
> struct statfs stbuf;
>
> ctx->export_flags |= V9FS_PATHNAME_FSCONTEXT;
> +#ifdef FS_IOC_GETVERSION
> + /*
> + * use ioc_getversion only if the iocl is definied
> + */
> err = statfs(ctx->fs_root,&stbuf);
> if (!err) {
> switch (stbuf.f_type) {
> @@ -729,6 +733,7 @@ static int local_init(FsContext *ctx)
> break;
> }
> }
> +#endif
> return err;
> }
>
>
>
> We would also require same changes for virtio-9p-handle.c right ?
>
> -aneesh
>
>
>
next prev parent reply other threads:[~2011-11-28 22:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-21 8:29 [Qemu-devel] [PATCH 1.0] 9pfs: improve portability to older systems Paolo Bonzini
2011-11-21 21:01 ` Anthony Liguori
2011-11-22 7:36 ` Paolo Bonzini
2011-11-23 6:16 ` Aneesh Kumar K.V
2011-11-23 7:24 ` Paolo Bonzini
2011-11-23 15:11 ` Aneesh Kumar K.V
2011-11-23 15:23 ` Paolo Bonzini
2011-11-28 22:36 ` Anthony Liguori [this message]
2011-11-29 8:45 ` Paolo Bonzini
2011-11-30 21:27 ` Erik Rull
2011-12-01 9:03 ` Paolo Bonzini
2011-12-03 11:35 ` Erik Rull
2011-12-03 11:35 ` Erik Rull
2011-11-29 9:43 ` Aneesh Kumar K.V
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=4ED40CE2.70903@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=pbonzini@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).