]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/shared/discover-image.h
tree-wide: hook up image dissection policy logic everywhere
[thirdparty/systemd.git] / src / shared / discover-image.h
index a266d4abdb9fa360e8854a3facb606dae03f2f92..c423132a62b3855cc17b89f2f2bfa5d855b9bfb7 100644 (file)
@@ -7,7 +7,8 @@
 #include "sd-id128.h"
 
 #include "hashmap.h"
-#include "lockfile-util.h"
+#include "image-policy.h"
+#include "lock-util.h"
 #include "macro.h"
 #include "path-util.h"
 #include "string-util.h"
@@ -34,6 +35,7 @@ typedef struct Image {
         unsigned n_ref;
 
         ImageType type;
+        ImageClass class;
         char *name;
         char *path;
         bool read_only;
@@ -50,6 +52,7 @@ typedef struct Image {
         sd_id128_t machine_id;
         char **machine_info;
         char **os_release;
+        char **extension_release;
 
         bool metadata_valid:1;
         bool discoverable:1;  /* true if we know for sure that image_find() would find the image given just the short name */
@@ -75,14 +78,15 @@ int image_read_only(Image *i, bool b);
 const char* image_type_to_string(ImageType t) _const_;
 ImageType image_type_from_string(const char *s) _pure_;
 
-bool image_name_is_valid(const char *s) _pure_;
+const char* image_class_to_string(ImageClass cl) _const_;
+ImageClass image_class_from_string(const char *s) _pure_;
 
 int image_path_lock(const char *path, int operation, LockFile *global, LockFile *local);
 int image_name_lock(const char *name, int operation, LockFile *ret);
 
 int image_set_limit(Image *i, uint64_t referenced_max);
 
-int image_read_metadata(Image *i);
+int image_read_metadata(Image *i, const ImagePolicy *image_policy);
 
 bool image_in_search_path(ImageClass class, const char *root, const char *image);