[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 04/17] virtio-9p: Implement P9_TSTAT
From: |
malc |
Subject: |
Re: [Qemu-devel] [PATCH 04/17] virtio-9p: Implement P9_TSTAT |
Date: |
Wed, 3 Mar 2010 23:35:36 +0300 (MSK) |
User-agent: |
Alpine 2.00 (LNX 1167 2008-08-23) |
On Wed, 3 Mar 2010, Anthony Liguori wrote:
> This get the mount to work on the guest
>
> address@hidden: malloc to qemu_malloc conversion]
>
> Signed-off-by: Anthony Liguori <address@hidden>
> Signed-off-by: Gautham R Shenoy <address@hidden>
> Signed-off-by: Aneesh Kumar K.V <address@hidden>
> ---
> hw/virtio-9p-local.c | 7 ++
> hw/virtio-9p.c | 169
> +++++++++++++++++++++++++++++++++++++++++++++++++-
> 2 files changed, 174 insertions(+), 2 deletions(-)
>
> diff --git a/hw/virtio-9p-local.c b/hw/virtio-9p-local.c
> index 204437c..9752f76 100644
> --- a/hw/virtio-9p-local.c
> +++ b/hw/virtio-9p-local.c
> @@ -72,9 +72,16 @@ static int local_setuid(void *opaque, uid_t uid)
> return 0;
> }
>
> +static ssize_t local_readlink(void *opaque, const char *path,
> + char *buf, size_t bufsz)
> +{
> + return readlink(rpath(path), buf, bufsz);
> +}
> +
> static V9fsPosixFileOperations ops = {
> .lstat = local_lstat,
> .setuid = local_setuid,
> + .readlink = local_readlink,
> };
>
> V9fsPosixFileOperations *virtio_9p_init_local(const char *path)
> diff --git a/hw/virtio-9p.c b/hw/virtio-9p.c
> index c63ac80..10bcd89 100644
> --- a/hw/virtio-9p.c
> +++ b/hw/virtio-9p.c
> @@ -102,6 +102,21 @@ static int posix_setuid(V9fsState *s, uid_t uid)
> return s->ops->setuid(s->ops->opaque, uid);
> }
>
> +static ssize_t posix_readlink(V9fsState *s, V9fsString *path, V9fsString
> *buf)
> +{
> + ssize_t len;
> +
> + buf->data = qemu_malloc(1024);
> +
> + len = s->ops->readlink(s->ops->opaque, path->data, buf->data, 1024 - 1);
> + if (len > -1) {
> + buf->size = len;
> + buf->data[len] = 0;
> + }
> +
> + return len;
> +}
> +
> static void v9fs_string_free(V9fsString *str)
> {
> free(str->data);
Should be qemu_free, no?
[..snip..]
--
mailto:address@hidden
- [Qemu-devel] [PATCH 00/17][RFC] virtio-9p: paravirtual filesystem passthrough, Anthony Liguori, 2010/03/03
- [Qemu-devel] [PATCH 10/17] virtio-9p: Implement P9_TCREATE, Anthony Liguori, 2010/03/03
- [Qemu-devel] [PATCH 04/17] virtio-9p: Implement P9_TSTAT, Anthony Liguori, 2010/03/03
- Re: [Qemu-devel] [PATCH 04/17] virtio-9p: Implement P9_TSTAT,
malc <=
- Re: [Qemu-devel] [PATCH 04/17] virtio-9p: Implement P9_TSTAT, Aneesh Kumar K. V, 2010/03/04
- Re: [Qemu-devel] [PATCH 04/17] virtio-9p: Implement P9_TSTAT, jvrao, 2010/03/08
- Re: [Qemu-devel] [PATCH 04/17] virtio-9p: Implement P9_TSTAT, Paul Brook, 2010/03/09
- Re: [Qemu-devel] [PATCH 04/17] virtio-9p: Implement P9_TSTAT, jvrao, 2010/03/09
- Re: [Qemu-devel] [PATCH 04/17] virtio-9p: Implement P9_TSTAT, Paul Brook, 2010/03/11
- Re: [Qemu-devel] [PATCH 04/17] virtio-9p: Implement P9_TSTAT, Aneesh Kumar K. V, 2010/03/10
[Qemu-devel] [PATCH 02/17] vrtio-9p: Implement P9_TVERSION for 9P, Anthony Liguori, 2010/03/03
[Qemu-devel] [PATCH 08/17] virtio-9p: Implement P9_TCLUNK, Anthony Liguori, 2010/03/03