From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nufnf-0007Jf-Ba for qemu-devel@nongnu.org; Thu, 25 Mar 2010 01:40:11 -0400 Received: from [140.186.70.92] (port=47174 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nufnc-0007IF-Iw for qemu-devel@nongnu.org; Thu, 25 Mar 2010 01:40:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nufnb-0000pX-3x for qemu-devel@nongnu.org; Thu, 25 Mar 2010 01:40:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48882) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nufna-0000pO-T3 for qemu-devel@nongnu.org; Thu, 25 Mar 2010 01:40:07 -0400 Message-ID: <4BAAF541.4090605@redhat.com> Date: Thu, 25 Mar 2010 01:31:45 -0400 From: john cooper MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH 0/4] Add virtio disk identification support List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: john.cooper@redhat.com, Rusty Russell , Marc Haber 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 #include #include #include #include #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