qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] VirtIO 9p mount_tag (bogus?) limit of 32 bytes
Date: Thu, 22 Sep 2011 18:42:33 +0100	[thread overview]
Message-ID: <20110922174233.GD31504@redhat.com> (raw)

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	other threads:[~2011-09-22 17:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-22 17:42 Daniel P. Berrange [this message]
2011-09-28 11:52 ` [Qemu-devel] VirtIO 9p mount_tag (bogus?) limit of 32 bytes Harsh Bora
2011-09-28 15:18   ` Daniel P. Berrange
2011-09-29 15:22     ` Aneesh Kumar K.V
2011-09-29 15:45       ` Daniel P. Berrange
  -- strict thread matches above, loose matches on Subject: below --
2012-02-16 12:20 C Anthony Risinger
2012-02-16 20:54 ` Paul Brook
2012-02-18 17:38 ` Aneesh Kumar K.V
2012-02-22  3:58   ` C Anthony Risinger
2012-02-23 18:08     ` Aneesh Kumar K.V
2012-03-07 16:29     ` M. Mohan Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110922174233.GD31504@redhat.com \
    --to=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).