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

[Xen-devel] [PATCH 16 of 29 RFC] libxl: introduce libxl__device_hotplug_path



# HG changeset patch
# User Roger Pau Monne <roger.pau@xxxxxxxxxxxxx>
# Date 1328178086 -3600
# Node ID 88e1905ef078040a1d943ae08186373e2f4d3857
# Parent  a7ef1bfa694bf581310e0242616a480e1c5e61b7
libxl: introduce libxl__device_hotplug_path

Get xenstore hotplug path from a given libxl__device. Used in the same
way as libxl__device_frontend_path or libxl__device_backend_path.

Signed-off-by: Roger Pau Monne <roger.pau@xxxxxxxxxxxxx>

diff -r a7ef1bfa694b -r 88e1905ef078 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c        Sat Jan 14 19:04:48 2012 +0100
+++ b/tools/libxl/libxl_device.c        Thu Feb 02 11:21:26 2012 +0100
@@ -40,6 +40,14 @@ char *libxl__device_backend_path(libxl__
                           device->domid, device->devid);
 }
 
+char *libxl__device_hotplug_path(libxl__gc *gc, libxl__device *device)
+{
+    return libxl__sprintf(gc, "/hotplug/%u/%u/%s/%u", device->backend_domid,
+                          device->domid,
+                          libxl__device_kind_to_string(device->backend_kind),
+                          device->devid);
+}
+
 int libxl__parse_backend_path(libxl__gc *gc,
                               const char *path,
                               libxl__device *dev)
diff -r a7ef1bfa694b -r 88e1905ef078 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h      Sat Jan 14 19:04:48 2012 +0100
+++ b/tools/libxl/libxl_internal.h      Thu Feb 02 11:21:26 2012 +0100
@@ -301,6 +301,7 @@ typedef struct {
                              char **bents, char **fents);
 _hidden char *libxl__device_backend_path(libxl__gc *gc, libxl__device *device);
 _hidden char *libxl__device_frontend_path(libxl__gc *gc, libxl__device 
*device);
+_hidden char *libxl__device_hotplug_path(libxl__gc *gc, libxl__device *device);
 _hidden int libxl__parse_backend_path(libxl__gc *gc, const char *path,
                                       libxl__device *dev);
 _hidden int libxl__device_remove(libxl__gc *gc, libxl__device *dev);

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


 


Rackspace

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