summaryrefslogtreecommitdiff
path: root/src/machine
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-04-05 15:39:43 +0200
committerLennart Poettering <lennart@poettering.net>2018-05-24 17:01:57 +0200
commit5ef46e5f6598d74acbfe963d4feb8dca4e9486b4 (patch)
tree683837dcfba3b8109cb01b9d3c120e1060ba1389 /src/machine
parent3e36211be0b60e239792e6a4efb4a1e75365a3a8 (diff)
downloadsystemd-5ef46e5f6598d74acbfe963d4feb8dca4e9486b4.tar.gz
machine-image: introduce two different classes of images
This distuingishes two different classes of images, one for the purpose of npsawn-like containers, i.e. "machines", and one for portable services. This distinction is mostly about search paths. We look for machine images in /var/lib/machines and for portable images in /var/lib/portables.
Diffstat (limited to 'src/machine')
-rw-r--r--src/machine/image-dbus.c4
-rw-r--r--src/machine/machined-dbus.c24
2 files changed, 14 insertions, 14 deletions
diff --git a/src/machine/image-dbus.c b/src/machine/image-dbus.c
index 0ee2247167..ae5aa30a90 100644
--- a/src/machine/image-dbus.c
+++ b/src/machine/image-dbus.c
@@ -435,7 +435,7 @@ int image_object_find(sd_bus *bus, const char *path, const char *interface, void
if (r < 0)
return r;
- r = image_find(e, &image);
+ r = image_find(IMAGE_MACHINE, e, &image);
if (r <= 0)
return r;
@@ -478,7 +478,7 @@ int image_node_enumerator(sd_bus *bus, const char *path, void *userdata, char **
if (!images)
return -ENOMEM;
- r = image_discover(images);
+ r = image_discover(IMAGE_MACHINE, images);
if (r < 0)
return r;
diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c
index 2ac4689ba1..5cf0aa8838 100644
--- a/src/machine/machined-dbus.c
+++ b/src/machine/machined-dbus.c
@@ -145,7 +145,7 @@ static int method_get_image(sd_bus_message *message, void *userdata, sd_bus_erro
if (r < 0)
return r;
- r = image_find(name, NULL);
+ r = image_find(IMAGE_MACHINE, name, NULL);
if (r == 0)
return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_IMAGE, "No image '%s' known", name);
if (r < 0)
@@ -545,7 +545,7 @@ static int method_list_images(sd_bus_message *message, void *userdata, sd_bus_er
if (!images)
return -ENOMEM;
- r = image_discover(images);
+ r = image_discover(IMAGE_MACHINE, images);
if (r < 0)
return r;
@@ -738,7 +738,7 @@ static int method_remove_image(sd_bus_message *message, void *userdata, sd_bus_e
if (!image_name_is_valid(name))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Image name '%s' is invalid.", name);
- r = image_find(name, &i);
+ r = image_find(IMAGE_MACHINE, name, &i);
if (r < 0)
return r;
if (r == 0)
@@ -762,7 +762,7 @@ static int method_rename_image(sd_bus_message *message, void *userdata, sd_bus_e
if (!image_name_is_valid(old_name))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Image name '%s' is invalid.", old_name);
- r = image_find(old_name, &i);
+ r = image_find(IMAGE_MACHINE, old_name, &i);
if (r < 0)
return r;
if (r == 0)
@@ -786,7 +786,7 @@ static int method_clone_image(sd_bus_message *message, void *userdata, sd_bus_er
if (!image_name_is_valid(old_name))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Image name '%s' is invalid.", old_name);
- r = image_find(old_name, &i);
+ r = image_find(IMAGE_MACHINE, old_name, &i);
if (r < 0)
return r;
if (r == 0)
@@ -810,7 +810,7 @@ static int method_mark_image_read_only(sd_bus_message *message, void *userdata,
if (!image_name_is_valid(name))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Image name '%s' is invalid.", name);
- r = image_find(name, &i);
+ r = image_find(IMAGE_MACHINE, name, &i);
if (r < 0)
return r;
if (r == 0)
@@ -834,7 +834,7 @@ static int method_get_image_hostname(sd_bus_message *message, void *userdata, sd
if (!image_name_is_valid(name))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Image name '%s' is invalid.", name);
- r = image_find(name, &i);
+ r = image_find(IMAGE_MACHINE, name, &i);
if (r < 0)
return r;
if (r == 0)
@@ -858,7 +858,7 @@ static int method_get_image_machine_id(sd_bus_message *message, void *userdata,
if (!image_name_is_valid(name))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Image name '%s' is invalid.", name);
- r = image_find(name, &i);
+ r = image_find(IMAGE_MACHINE, name, &i);
if (r < 0)
return r;
if (r == 0)
@@ -882,7 +882,7 @@ static int method_get_image_machine_info(sd_bus_message *message, void *userdata
if (!image_name_is_valid(name))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Image name '%s' is invalid.", name);
- r = image_find(name, &i);
+ r = image_find(IMAGE_MACHINE, name, &i);
if (r < 0)
return r;
if (r == 0)
@@ -906,7 +906,7 @@ static int method_get_image_os_release(sd_bus_message *message, void *userdata,
if (!image_name_is_valid(name))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Image name '%s' is invalid.", name);
- r = image_find(name, &i);
+ r = image_find(IMAGE_MACHINE, name, &i);
if (r < 0)
return r;
if (r == 0)
@@ -1070,7 +1070,7 @@ static int method_clean_pool(sd_bus_message *message, void *userdata, sd_bus_err
goto child_fail;
}
- r = image_discover(images);
+ r = image_discover(IMAGE_MACHINE, images);
if (r < 0)
goto child_fail;
@@ -1211,7 +1211,7 @@ static int method_set_image_limit(sd_bus_message *message, void *userdata, sd_bu
if (!image_name_is_valid(name))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Image name '%s' is invalid.", name);
- r = image_find(name, &i);
+ r = image_find(IMAGE_MACHINE, name, &i);
if (r < 0)
return r;
if (r == 0)