qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: john cooper <john.cooper@redhat.com>
To: Marc Haber <mh+qemu-devel@zugschlus.de>
Cc: john.cooper@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] virtio block device and sysfs
Date: Mon, 22 Mar 2010 10:22:14 -0400	[thread overview]
Message-ID: <4BA77D16.90001@redhat.com> (raw)
In-Reply-To: <20100322123816.GF30984@torres.zugschlus.de>

Marc Haber wrote:
> Hi,
> 
> 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.
 
>> John attempted this and it was reverted because the implementation  
>> exhausted the PCI config space.
> 
> I don't understand that. Existig hardware devices dump much more of
> their data such as vendor and model type information into the config
> space, how can using a field that real hardware uses exhaust the
> config space?

If you are only consuming 20 bytes in the config space
currently there shouldn't be a problem -- that's exactly
where I had started with this work.  The issue was
rather of emulating an ATA_IDENTIFY interface where qemu
was cobbling together the content of the user data to be
ultimately passed to the guest's application.

That data structure by convention consumes a legacy 512
byte disk sector which overflowed the expectation of a
256 byte limit on PCI config space.  The rationale was
to have qemu package up the data so the virtio driver
could simply treat it as opaque.   Note the motivation for
reuse of the ATA_IDENTIFY interface was that of leveraging
existing tools such as hdparm(8) (and its windows
counterpart) which already speak that convention.  So
there was a reason we wound up in this unhappy place.

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.

-john
  
-- 
john.cooper@redhat.com

  reply	other threads:[~2010-03-22 14:29 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-06 22:42 [Qemu-devel] virtio block device and sysfs Marc Haber
2010-03-09  1:17 ` jvrao
2010-03-09  8:21   ` Marc Haber
2010-03-09 20:04     ` jvrao
2010-03-09 20:06       ` jvrao
2010-03-09 21:15       ` Marc Haber
2010-03-09 21:34 ` Anthony Liguori
2010-03-21 16:16   ` Jamie Lokier
2010-03-22  6:26     ` john cooper
2010-03-22 12:42       ` Marc Haber
2010-03-22 14:59         ` john cooper
2010-03-25  5:30           ` john cooper
2010-06-29 18:15           ` Marc Haber
2010-06-29 18:03             ` john cooper
2010-06-29 20:20               ` Marc Haber
2010-06-29 18:33             ` Ryan Harper
2010-06-29 18:36               ` Marc Haber
2010-06-29 18:36               ` Marc Haber
2010-06-30  7:01               ` Markus Armbruster
2010-09-13  8:55               ` Marc Haber
2010-09-13 14:34                 ` Ryan Harper
2010-09-14  7:43                   ` Marc Haber
2011-03-10 12:14                     ` Marc Haber
2010-03-22 12:38   ` Marc Haber
2010-03-22 14:22     ` john cooper [this message]
2010-03-22 16:24       ` Jamie Lokier
2010-03-22 16:33         ` john cooper
2010-04-22 20:30       ` Marc Haber
2010-04-22 20:48         ` john cooper
2010-03-22 15:14     ` Paul Brook
2010-04-22 20:33       ` Marc Haber
2010-03-22 14:46   ` [Qemu-devel] " Michael S. Tsirkin
2010-03-22 14:52     ` Anthony Liguori
2010-03-20 18:32 ` [Qemu-devel] " Richard W.M. Jones

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=4BA77D16.90001@redhat.com \
    --to=john.cooper@redhat.com \
    --cc=mh+qemu-devel@zugschlus.de \
    --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).