From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NnBqD-0000KG-1Z for qemu-devel@nongnu.org; Thu, 04 Mar 2010 09:15:53 -0500 Received: from [199.232.76.173] (port=49795 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NnBqC-0000Jq-MZ for qemu-devel@nongnu.org; Thu, 04 Mar 2010 09:15:52 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NnBqB-0003WD-O4 for qemu-devel@nongnu.org; Thu, 04 Mar 2010 09:15:52 -0500 Received: from e23smtp04.au.ibm.com ([202.81.31.146]:58326) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NnBqB-0003Vx-1t for qemu-devel@nongnu.org; Thu, 04 Mar 2010 09:15:51 -0500 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [202.81.31.247]) by e23smtp04.au.ibm.com (8.14.3/8.13.1) with ESMTP id o24EC60J026122 for ; Fri, 5 Mar 2010 01:12:06 +1100 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o24EA75I1671256 for ; Fri, 5 Mar 2010 01:10:07 +1100 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o24EFjvj018905 for ; Fri, 5 Mar 2010 01:15:46 +1100 From: "Aneesh Kumar K. V" Subject: Re: [Qemu-devel] [PATCH 04/17] virtio-9p: Implement P9_TSTAT In-Reply-To: References: <1267642874-15001-1-git-send-email-aliguori@us.ibm.com> <1267642874-15001-6-git-send-email-aliguori@us.ibm.com> Date: Thu, 04 Mar 2010 19:45:40 +0530 Message-ID: <87vddcjhpv.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc , Anthony Liguori Cc: qemu-devel@nongnu.org, Gautham R Shenoy On Wed, 3 Mar 2010 23:35:36 +0300 (MSK), malc wrote: > On Wed, 3 Mar 2010, Anthony Liguori wrote: > > > This get the mount to work on the guest > > > > [kiran@linux.vnet.ibm.com: malloc to qemu_malloc conversion] > > > > Signed-off-by: Anthony Liguori > > Signed-off-by: Gautham R Shenoy > > Signed-off-by: Aneesh Kumar K.V > > --- > > 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? > Updated the patch -aneesh