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 6 of 7] libxl: handle the tail end of a tap device us

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 6 of 7] libxl: handle the tail end of a tap device using the phy backend handling code
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Thu, 07 Apr 2011 10:52:32 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Thu, 07 Apr 2011 03:01:54 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1302169946@xxxxxxxxxxxxxxxxxxxxx>
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>
References: <patchbomb.1302169946@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.6.4
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1302167211 -3600
# Node ID 40b0954cb5d9bdd0b943963afb79914ba5cb08c9
# Parent  ec3b25b5aa8095c5fe070173af888f032f6c2c5e
libxl: handle the tail end of a tap device using the phy backend handling code

We are literally creating a phy backend on top of a blktap2 created
device anyway so we might as well reuse the code and make this
explicit.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r ec3b25b5aa80 -r 40b0954cb5d9 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Thu Apr 07 10:06:51 2011 +0100
+++ b/tools/libxl/libxl.c       Thu Apr 07 10:06:51 2011 +0100
@@ -1000,7 +1000,7 @@ int libxl_device_disk_add(libxl_ctx *ctx
     switch (disk->backend) {
         case DISK_BACKEND_PHY:
             dev = disk->pdev_path;
-
+    do_backend_phy:
             libxl__device_physdisk_major_minor(dev, &major, &minor);
             flexarray_append(back, "physical-device");
             flexarray_append(back, libxl__sprintf(&gc, "%x:%x", major, minor));
@@ -1021,17 +1021,11 @@ int libxl_device_disk_add(libxl_ctx *ctx
                 libxl__device_disk_string_of_format(disk->format),
                 disk->pdev_path));
 
-            flexarray_append(back, "params");
-            flexarray_append(back, dev);
-
             backend_type = "phy";
 
-            libxl__device_physdisk_major_minor(dev, &major, &minor);
-            flexarray_append(back, "physical-device");
-            flexarray_append(back, libxl__sprintf(&gc, "%x:%x", major, minor));
-
-            device.backend_kind = DEVICE_VBD;
-            break;
+            /* now create a phy device to export the device to the guest */
+            goto do_backend_phy;
+
         case DISK_BACKEND_QDISK:
             flexarray_append(back, "params");
             flexarray_append(back, libxl__sprintf(&gc, "%s:%s",

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