path: root/discover/device-handler.h
diff options
authorSamuel Mendoza-Jonas <>2015-05-13 16:45:42 +1000
committerSamuel Mendoza-Jonas <>2015-08-06 14:08:20 +1000
commitd2f71341c8077c649c00f75c1f6c3f590c1b2576 (patch)
tree35c4a2efa2d31c24e30c59eb04f32ac6a302cc24 /discover/device-handler.h
parentfa5c9dfa37957d45b13424ade53d477f0b123102 (diff)
discover: Keep track of available ramdisk devices
Store information on available ramdisk devices when they are recognised by udev, and add functions to 'reserve' and 'release' these devices. This will be used to associate device-mapper snapshots with a backing ramdisk in a following patch. Signed-off-by: Samuel Mendoza-Jonas <>
Diffstat (limited to 'discover/device-handler.h')
1 files changed, 14 insertions, 0 deletions
diff --git a/discover/device-handler.h b/discover/device-handler.h
index b592c46..5877733 100644
--- a/discover/device-handler.h
+++ b/discover/device-handler.h
@@ -26,6 +26,7 @@ struct discover_device {
char *mount_path;
const char *device_path;
+ struct ramdisk_device *ramdisk;
bool mounted;
bool mounted_rw;
bool unmount;
@@ -59,6 +60,14 @@ struct discover_context {
void *test_data;
+struct ramdisk_device {
+ const char *path;
+ char *snapshot;
+ char *origin;
+ char *base;
+ unsigned int sectors;
struct device_handler *device_handler_init(struct discover_server *server,
struct waitset *waitset, int dry_run);
@@ -72,6 +81,11 @@ struct discover_device *discover_device_create(struct device_handler *handler,
const char *id);
void device_handler_add_device(struct device_handler *handler,
struct discover_device *device);
+void device_handler_add_ramdisk(struct device_handler *handler,
+ const char *path);
+struct ramdisk_device *device_handler_get_ramdisk(
+ struct device_handler *handler);
+void device_handler_release_ramdisk(struct discover_device *device);
int device_handler_discover(struct device_handler *handler,
struct discover_device *dev);
int device_handler_dhcp(struct device_handler *handler,
OpenPOWER on IntegriCloud