[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] libxl: stat the path for all non-qdisk backends (including unknown)



commit 3ed6d71247b6ef3c701654824f5b4c961eacfd61
Author:     Ian Campbell <ian.campbell@xxxxxxxxxx>
AuthorDate: Fri Apr 26 12:41:43 2013 +0100
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Fri Apr 26 15:59:41 2013 +0100

    libxl: stat the path for all non-qdisk backends (including unknown)
    
    The commit a8a1f236a296 "libxl: Only call stat() when adding a disk if we
    expect a device to exist." changed things to only stat the file when the phy
    backend was explicitly requested. This broke the case where we are probing 
and
    would normally be able to decide on the phy option.
    
    Since the intention of that commit was to allow for backends with no 
explicit
    file in dom0 (i.e. network remote backend such as ceph) the lowest impact 
fix
    appears to be to make that explicit. It turns out that tap disk can also
    potentially handle such paths.
    
    The only backend which requires a local file/device is PHY but we need to
    handle UNKNOWN too in order for subsequent probing to work. Note that it is
    not possible to autoprobe the backend if the path is not a local object, so 
we
    don't need to worry about autoprobing ceph etc.
    
    This should probably be revisited to rationalize the probing.
    
    Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
    Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 tools/libxl/libxl_device.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index eb60fd5..a826ece 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -236,7 +236,8 @@ int libxl__device_disk_set_backend(libxl__gc *gc, 
libxl_device_disk *disk) {
             return ERROR_INVAL;
         }
         memset(&a.stab, 0, sizeof(a.stab));
-    } else if (disk->backend == LIBXL_DISK_BACKEND_PHY &&
+    } else if ((disk->backend == LIBXL_DISK_BACKEND_UNKNOWN ||
+                disk->backend == LIBXL_DISK_BACKEND_PHY) &&
                disk->backend_domid == LIBXL_TOOLSTACK_DOMID &&
                !disk->script) {
         if (stat(disk->pdev_path, &a.stab)) {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.