From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6nIF-0000c6-Sw for qemu-devel@nongnu.org; Thu, 22 Sep 2011 13:42:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6nIE-0000Ca-HB for qemu-devel@nongnu.org; Thu, 22 Sep 2011 13:42:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6nIE-0000AD-9Q for qemu-devel@nongnu.org; Thu, 22 Sep 2011 13:42:38 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8MHgbbJ004670 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 22 Sep 2011 13:42:37 -0400 Received: from redhat.com (dhcp-1-193.fab.redhat.com [10.33.1.193]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p8MHgXpE030237 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Thu, 22 Sep 2011 13:42:36 -0400 Date: Thu, 22 Sep 2011 18:42:33 +0100 From: "Daniel P. Berrange" Message-ID: <20110922174233.GD31504@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Subject: [Qemu-devel] VirtIO 9p mount_tag (bogus?) limit of 32 bytes Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 :|