From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8sgy-0004LN-Vj for qemu-devel@nongnu.org; Wed, 28 Sep 2011 07:52:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8sgx-0006FP-Jr for qemu-devel@nongnu.org; Wed, 28 Sep 2011 07:52:48 -0400 Received: from e23smtp01.au.ibm.com ([202.81.31.143]:46186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8sgx-0006AA-2v for qemu-devel@nongnu.org; Wed, 28 Sep 2011 07:52:47 -0400 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [202.81.31.246]) by e23smtp01.au.ibm.com (8.14.4/8.13.1) with ESMTP id p8SBoZuF008837 for ; Wed, 28 Sep 2011 21:50:35 +1000 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p8SBo5Lv1884310 for ; Wed, 28 Sep 2011 21:50:06 +1000 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p8SBq8HD002885 for ; Wed, 28 Sep 2011 21:52:08 +1000 Message-ID: <4E830A66.50605@linux.vnet.ibm.com> Date: Wed, 28 Sep 2011 17:22:06 +0530 From: Harsh Bora MIME-Version: 1.0 References: <20110922174233.GD31504@redhat.com> In-Reply-To: <20110922174233.GD31504@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] VirtIO 9p mount_tag (bogus?) limit of 32 bytes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, "Aneesh Kumar K. V" On 09/22/2011 11:12 PM, Daniel P. Berrange wrote: > I've noticed that if you use a virtio 9p filesystem with a mount_tag > property value that is longer than 32 bytes, it gets silently truncated. > > In virtio-9p-device.c > > len = strlen(conf->tag); > if (len> MAX_TAG_LEN) { > len = MAX_TAG_LEN; I think its better to return here with a failure message saying mount_tag too long. IIUC, The 32 byte limit has been kept because of understanding that mount_tag is a device name in guest (and not a path location). Aneesh, any inputs ? - Harsh > } > > > The header virtio-9p.h contains > > > /* from Linux's linux/virtio_9p.h */ > > /* The ID for virtio console */ > #define VIRTIO_ID_9P 9 > #define MAX_REQ 128 > #define MAX_TAG_LEN 32 > > > The Linux kernel's virtio_9p.h, however, does not have any MAX_TAG_LEN > constant and AFAICT the code in Linux's net/9p/trans_virtio.c is not > placing any 32 byte length restriction on the mount tag. > > So is this QEMU length limit legacy code that can be removed ? > > If using the mount_tag to specify the desired guest mount location path, > then 32 bytes is really quite limiting - a good 255 bytes is much more > desirable. > > Finally, regardless of what limit is imposed, it would be better to > return an error if the user attempts to specify an excessively long > mount tag, rather than truncate it breaking the guest app relying on > the full tag. > > Regards, > Daniel