From 11a63a1660453269ddd1893c15d0a98133b33ca7 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Thu, 5 Sep 2013 15:11:31 +0100 Subject: libxl, hotplug/Linux: default to phy backend for raw format file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modify libxl to allow raw format file to use phy backend. For the hotplug script part, learn from NetBSD's block hotplug script -- test the path and determine the actual type of file (block device or regular file) then use the actual type to determine which branch to run. With these changes, plus the current ordering of backend preference (phy > qdisk > tap), we will use phy backend for raw format file by default. Signed-off-by: Wei Liu Cc: Stefano Stabellini Acked-by: Roger Pau Monné Acked-by: Ian Jackson --- tools/libxl/libxl_linux.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools/libxl') diff --git a/tools/libxl/libxl_linux.c b/tools/libxl/libxl_linux.c index 37815eb650..3cfa6dacc6 100644 --- a/tools/libxl/libxl_linux.c +++ b/tools/libxl/libxl_linux.c @@ -19,11 +19,11 @@ int libxl__try_phy_backend(mode_t st_mode) { - if (!S_ISBLK(st_mode)) { - return 0; + if (S_ISBLK(st_mode) || S_ISREG(st_mode)) { + return 1; } - return 1; + return 0; } #define EXT_SHIFT 28 -- cgit v1.2.3