Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O533P-0001L0-5Y for qemu-devel@nongnu.org; Thu, 22 Apr 2010 16:31:19 -0400 Received: from [140.186.70.92] (port=48769 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O533N-0001Ir-KC for qemu-devel@nongnu.org; Thu, 22 Apr 2010 16:31:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O533L-0002iL-VC for qemu-devel@nongnu.org; Thu, 22 Apr 2010 16:31:17 -0400 Received: from torres.zugschlus.de ([85.214.68.41]:35825) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O533L-0002fj-OF for qemu-devel@nongnu.org; Thu, 22 Apr 2010 16:31:15 -0400 Date: Thu, 22 Apr 2010 22:30:55 +0200 From: Marc Haber Subject: Re: [Qemu-devel] virtio block device and sysfs Message-ID: <20100422203055.GF5321@torres.zugschlus.de> References: <20100306224234.GA1145@torres.zugschlus.de> <4B96BECF.2000505@codemonkey.ws> <20100322123816.GF30984@torres.zugschlus.de> <4BA77D16.90001@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4BA77D16.90001@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: john cooper Cc: qemu-devel@nongnu.org Hi, On Mon, Mar 22, 2010 at 10:22:14AM -0400, john cooper wrote: > Marc Haber wrote: > > On Tue, Mar 09, 2010 at 03:34:07PM -0600, Anthony Liguori wrote: > >> On 03/06/2010 04:42 PM, Marc Haber wrote: > >>> My goal is to have a possibility to give a "speaking" name to any > >>> block device handed into a guest instance by the host. That name > >>> should be visible inside the guest, just as a LV is visible with its > >>> name in the system running the LVM. > >>> > >>> For example I would like to say on the qemu or kvm command line > >>> '-drive file=some-file,label=some-label,if=virtio', and have the > >>> string "some-label" show up somewhere in /sys/block in the guest, much > >>> as /sys/block/sda/device/model shows the hardware vendor and type for > >>> a standard SATA disk. The guest could then handle the information > >>> passed into it by the host with udev rules, allowing fstab constructs > >>> like "mount /dev/virtio/block/by-label/some-label as /usr" > >>> > >> You probably would just want to plumb ,serial=X into the virtio-blk > >> config space and have the driver use it. Then you can do > >> /dev/block/by-id/XXXXX > > > > It the serial "number" can be alphanumeric, that would be great to have. > > It is simply a string of 20 characters, which AFAICT has > its roots in the ATA S/N convention along with many other > puzzling present day evils. That would be enough for my purposes, but more would be acceptable as well. > All that said, I like the alternate choice of adding a > special virtio request far better. It is actually simpler > (and more maintainable IMO) than going through the > gyrations of stuffing the S/N data through PCI config > space. Whatever is more easily implemented ;) How would a Windows installation see the label then? Has my wish made its way on the official wishlist and/or roadmap? Greetings Marc -- ----------------------------------------------------------------------------- Marc Haber | "I don't trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 3221 2323190