From d170c0ae55daf41c34497b51a5e84f50b76a42b6 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Thu, 14 Mar 2013 15:55:55 +0800 Subject: [PATCH] discover: Add struct resource Introduce a new type, struct resource, for handling resources such as kernels and initrds. This allows the parsers to better describe resources that are required for booting. Firstly, we enforce all resources to be URLs, rather than local paths. Also, resources allow us to describe files devices that have not-yet been hotplugged. Signed-off-by: Jeremy Kerr --- discover/Makefile.am | 1 + discover/resource.h | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 discover/resource.h diff --git a/discover/Makefile.am b/discover/Makefile.am index 0e20835..a858855 100644 --- a/discover/Makefile.am +++ b/discover/Makefile.am @@ -54,6 +54,7 @@ pb_discover_SOURCES = \ params.h \ pb-discover.c \ pb-discover.h \ + resource.h \ udev.c \ udev.h \ user-event.c \ diff --git a/discover/resource.h b/discover/resource.h new file mode 100644 index 0000000..b7e1a46 --- /dev/null +++ b/discover/resource.h @@ -0,0 +1,23 @@ +#ifndef RESOURCE_H +#define RESOURCE_H + +#include + +struct pb_url; + +/** + * Data for local/remote resources. Resources may be "unresolved", in that + * they refer to a device that is not yet present. Unresolved resources + * simply contain parser-specific data (generally a device string parsed from + * the config file), and may be resolved by the parser once new devices appear. + */ +struct resource { + bool resolved; + union { + struct pb_url *url; + void *info; + }; +}; + +#endif /* RESOURCE_H */ + -- 2.39.2