All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ryan Harper <ryanh@us.ibm.com>
To: john cooper <john.cooper@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
	Marc Haber <mh+qemu-devel@zugschlus.de>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 0/4] Add virtio disk identification support
Date: Fri, 28 May 2010 08:16:29 -0500	[thread overview]
Message-ID: <20100528131629.GD29645@us.ibm.com> (raw)
In-Reply-To: <4BAAF541.4090605@redhat.com>

* john cooper <john.cooper@redhat.com> [2010-03-25 00:45]:
> This series adds the minimal support to qemu and virtio_blk
> to support passing of a virtio_blk serial id string from qemu
> through the guest driver and to the guest userland.
> 
> This is derived in part from a patch set posted by Rusty some
> time ago, but has been minimized to remove support for prior
> versions which attempted to provide the same functionality via
> pci config/io space.  This version rather uses a virtio request
> as proposed in Rusty's example.
> 
> Also removed is the packaging of the serial/id string within
> the glorious bag of bits returned by the ATA_IDENTIFY command.
> Here we transfer only the 20 bytes of serial/id string from
> qemu to the guest userland.  In the proposed interface, this
> is made available by an ioctl() into the virtio_blk driver
> however other interfaces (eg: /sys) have also been proposed.
> A code snippet is attached below as an example of ioctl usage.
> 
> The resulting code is quite minimal and I believe it addresses
> all concerns raised in prior versions.
> 
> -john
> 
> 
> 
> #include <stdio.h>
> #include <strings.h>
> #include <sys/types.h>
> #include <fcntl.h>
> #include <linux/hdreg.h>
> 
> #define IOCTL_CMD	'VBID'
> 
> main()
> {
> 	int fd, rv;
> 	char buf[512];
> 
> 	bzero(buf, sizeof (buf));
> 	if ((fd = open("/dev/vda", O_RDONLY)) < 0)
> 		perror("open");
> 	else if (ioctl(fd, IOCTL_CMD, buf) < 0)
> 		perror("ioctl");
> 	else
> 		printf("[%s]\n", buf);
> }

Would we want to patch up blkid command to use this so distro stacks can
extract the serial and build the typical /dev/disk/by-id/ links ?


-- 
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
ryanh@us.ibm.com

  reply	other threads:[~2010-05-28 13:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-25  5:31 [Qemu-devel] [PATCH 0/4] Add virtio disk identification support john cooper
2010-05-28 13:16 ` Ryan Harper [this message]
2010-06-02  1:46 ` Ryan Harper
2010-06-02  2:56   ` john cooper
2010-06-03  8:22     ` john cooper
  -- strict thread matches above, loose matches on Subject: below --
2010-07-02  5:50 john cooper
2010-07-02  6:39 ` Markus Armbruster
2010-07-02  6:27   ` john cooper

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=20100528131629.GD29645@us.ibm.com \
    --to=ryanh@us.ibm.com \
    --cc=john.cooper@redhat.com \
    --cc=mh+qemu-devel@zugschlus.de \
    --cc=qemu-devel@nongnu.org \
    --cc=rusty@rustcorp.com.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.