[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] VirtIO 9p mount_tag (bogus?) limit of 32 bytes

From: Harsh Bora
Subject: Re: [Qemu-devel] VirtIO 9p mount_tag (bogus?) limit of 32 bytes
Date: Wed, 28 Sep 2011 17:22:06 +0530
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20110831 Thunderbird/3.1.13

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

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]