qemu-devel
[Top][All Lists]
Advanced

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

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


From: Daniel P. Berrange
Subject: [Qemu-devel] VirtIO 9p mount_tag (bogus?) limit of 32 bytes
Date: Thu, 22 Sep 2011 18:42:33 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

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;
    }


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
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|



reply via email to

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