WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] libxl: virtio-blk-pci support for FV domain

To: Xen Devel <Xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] libxl: virtio-blk-pci support for FV domain
From: Takeshi HASEGAWA <hasegaw@xxxxxxxxx>
Date: Sun, 8 May 2011 12:48:40 +0900
Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>, Wei Liu <liuw@xxxxxxxxx>
Delivery-date: Sat, 07 May 2011 20:49:35 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to:cc :content-type; bh=MAIJrg2eaSey/gxiGmG0dwGErJdUVdfnP2CEQaxJxfg=; b=OqdoLvmy/bW6APV3L76UGuWYBsI8l68hysEJ9bCAqookCaJ0wUbASsF/5eAAkUpJsP OgKHnPc2d7y09AjSI7vwUnORr9e506P6TVxpd21SUq5YdhHu9BEsJIE5Ywiao3eqXfgL 3AvbB4iu6Tm5jWuJb2ewV0cjMSGwJtellj3RM=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=o18kUcFxsg0as/qVDaFO7t6m+QdfM2lj5CPOkgW0L9ZMyILiaXEvB0hQ2r808YMJd3 f+6PXAxU00kCU8o5oltoS5qzP6r10BoljzzkvVvp7QUh0c6PTXPAFgJrveROPCOho7zg 1b8xn2zPR5vC2bGUSd19jMDBE75djTymVTnVk=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
I am working to support virtio-blk-pci device on Xen FV domain.
This patch adds virtio-blk-pci support to libxl.

New vbd type (252 << 8) is added.
I borrow 252 from major number of linux virtio-blk frontend (vd).
virtio-blk-pci does not use this type right now, but it should
also work with Wei Liu's work.


I have already seen virtio device on HVM domain with upstream-qemu,
but there looks some issues when I/O occurs.
(fdisk works, but qemu dies during mkfs)
I am going to look into the problem.

Any suggestions are welcome!

Thanks,
Takeshi


Signed-off-by: Takeshi HASEGAWA <hasegaw@xxxxxxxxx>

diff -r 4b0692880dfa docs/misc/vbd-interface.txt
--- a/docs/misc/vbd-interface.txt       Thu May 05 17:40:34 2011 +0100
+++ b/docs/misc/vbd-interface.txt       Sun May 08 12:46:00 2011 +0900
@@ -73,6 +73,7 @@

     1 << 28 | disk << 8 | partition      xvd, disks or partitions 16 onwards
    202 << 8 | disk << 4 | partition      xvd, disks and partitions up to 15
+   252 << 8 | disk << 4 | partition      vd, disks and partitions up to 15
      8 << 8 | disk << 4 | partition      sd, disks and partitions up to 15
      3 << 8 | disk << 6 | partition      hd, disks 0..1, partitions 0..63
     22 << 8 | (disk-2) << 6 | partition  hd, disks 2..3, partitions 0..63
diff -r 4b0692880dfa tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c        Thu May 05 17:40:34 2011 +0100
+++ b/tools/libxl/libxl_device.c        Sun May 08 12:46:00 2011 +0900
@@ -238,6 +238,13 @@
         if (pdisk) *pdisk = disk;
         if (ppartition) *ppartition = partition;
         return (8 << 8) | (disk << 4) | partition;
+    }
+    if (device_virtdisk_matches(virtpath, "vd",
+                                &disk, 15,
+                                &partition, 15)) {
+        if (pdisk) *pdisk = disk;
+        if (ppartition) *ppartition = partition;
+        return (252 << 8) | (disk << 4) | partition;
     }
     return -1;
 }
diff -r 4b0692880dfa tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c    Thu May 05 17:40:34 2011 +0100
+++ b/tools/libxl/libxl_dm.c    Sun May 08 12:46:00 2011 +0900
@@ -418,6 +418,10 @@
                 if (strncmp(disks[i].vdev, "sd", 2) == 0)
                     drive = libxl__sprintf
                         (gc, "file=%s,if=scsi,bus=0,unit=%d,format=%s",
+                         disks[i].pdev_path, disk, format);
+                else if (strncmp(disks[i].vdev, "vd", 2) == 0)
+                    drive = libxl__sprintf
+                        (gc, "file=%s,if=virtio,bus=0,unit=%d,format=%s",
                          disks[i].pdev_path, disk, format);
                 else if (disk < 4)
                     drive = libxl__sprintf

-- 
Takeshi HASEGAWA <hasegaw@xxxxxxxxx>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel