From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NtNpb-0004wl-8i for qemu-devel@nongnu.org; Sun, 21 Mar 2010 12:16:51 -0400 Received: from [199.232.76.173] (port=54898 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NtNpa-0004wZ-Fe for qemu-devel@nongnu.org; Sun, 21 Mar 2010 12:16:50 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NtNpZ-0006Qt-3I for qemu-devel@nongnu.org; Sun, 21 Mar 2010 12:16:50 -0400 Received: from mail2.shareable.org ([80.68.89.115]:57116) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NtNpY-0006Qp-Q3 for qemu-devel@nongnu.org; Sun, 21 Mar 2010 12:16:48 -0400 Date: Sun, 21 Mar 2010 16:16:38 +0000 From: Jamie Lokier Subject: Re: [Qemu-devel] virtio block device and sysfs Message-ID: <20100321161638.GA4174@shareable.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B96BECF.2000505@codemonkey.ws> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: john cooper , Marc Haber , qemu-devel@nongnu.org Anthony Liguori wrote: > On 03/06/2010 04:42 PM, Marc Haber wrote: > >Hi, > > > >I am looking to get in touch with somebody who knows more about the > >connection between host configuration, qemu, kvm, and the virtio block > >device driver guest side than I know. > > > >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 Sounds good to me. This is looking a bit similar to the user-specified names in virtio-serial. Is it worth looking for a generic, common mechanism to pass user-specified names to all virtio device types? -- Jamie