From 98859ffa6a197e4ef394f9fde1bd41aeaeb023c9 Mon Sep 17 00:00:00 2001 From: Roger Pau Monne Date: Thu, 21 May 2015 16:10:26 +0200 Subject: [PATCH RFC 3/5] libxl/FreeBSD: write blkback "path" node MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FreeBSD blkback doesn't use the physical-device xenstore node because it can handle both block devices and raw files directly. Instead introduce a new xenstore blkback node that is used by hotplug scripts to write the path to the block device or raw image. Signed-off-by: Roger Pau Monné Cc: Ian Jackson Cc: Ian Campbell Cc: Wei Liu --- tools/libxl/libxl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 8c47cff..a5a8999 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -2477,7 +2477,13 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid, if (!libxl__device_physdisk_major_minor(dev, &major, &minor)) flexarray_append_pair(back, "physical-device", libxl__sprintf(gc, "%x:%x", major, minor)); -#endif /* __linux__ || __NetBSD__ */ +#elif defined(__FreeBSD__) + /* + * FreeBSD blkback supports raw image files, so we + * cannot reuse the physical-device node. + */ + flexarray_append_pair(back, "path", dev); +#endif } assert(device->backend_kind == LIBXL__DEVICE_KIND_VBD); -- 1.9.5 (Apple Git-50.3)