qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: john cooper <john.cooper@redhat.com>
To: Ryan Harper <ryanh@us.ibm.com>
Cc: john.cooper@redhat.com, Anthony Liguori <aliguori@us.ibm.com>,
	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: Tue, 01 Jun 2010 22:56:06 -0400	[thread overview]
Message-ID: <4C05C846.7040306@redhat.com> (raw)
In-Reply-To: <20100602014652.GA16406@us.ibm.com>

Ryan Harper wrote:
> I've applied the qemu and kernel side of this patch series and tested
> this out using the sample code below.  I've also reworked this example
> into a virtioblk_id tool to work with udev to generate /dev/disk/by-id
> links; I'll be submitting a patch set to linux-hotplug with these
> changes, (and update for path_id) and some udev rules to
> persistent-storage script to autogenerate by-id and by-path symlinks for
> virtio-blk devices.

Sorry I didn't respond to you earlier.  Actually the
guest visible interface below was only intended as an
example while waiting for (what I misinterpreted as
Marc's intention to create) a /sys interface.

I'm all for putting this issue to rest, but if we're
going to live with an ioctl interface retrieving the
id string, let's make it a little more friendly from
the user's perspective.  I have a slightly modified
version which basically implements the same interface
but expects the sizeof the entire array to be preset
in the first element.  Otherwise the user has no
way of informing the driver of the destination's size,
nor a way for the driver to indicate when the data
won't fit in the area specified by the user.

I should still have the patch on a test machine which
ATM is unaccessible, but will have at first thing tomorrow.
Let's hold off until then so we can address this nit
and avoid yet another hiccup in nailing down this
interface.

Thanks,

-john

> I've also got a patch to apply ontop of the qemu patches to generate a
> default serial number if one isn't specified (like we do for ide
> devices).
> 
> Anthony, is this series in your queue yet?
> 
> Acked-by: Ryan Harper <ryanh@us.ibm.com>
> 
>>
>>
>> #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);
>> }
>>
>> -- 
>> john.cooper@redhat.com
>>
> 


-- 
john.cooper@redhat.com

  reply	other threads:[~2010-06-02  3:09 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
2010-06-02  1:46 ` Ryan Harper
2010-06-02  2:56   ` john cooper [this message]
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=4C05C846.7040306@redhat.com \
    --to=john.cooper@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=mh+qemu-devel@zugschlus.de \
    --cc=qemu-devel@nongnu.org \
    --cc=rusty@rustcorp.com.au \
    --cc=ryanh@us.ibm.com \
    /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).