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.
This commit is contained in:
Lennart Poettering
2018-05-24 17:01:57 +02:00
parent 3e36211be0
commit 5ef46e5f65
8 changed files with 52 additions and 36 deletions
+2 -2
View File
@@ -69,7 +69,7 @@ static int export_tar(int argc, char *argv[], void *userdata) {
int r, fd;
if (machine_name_is_valid(argv[1])) {
r = image_find(argv[1], &image);
r = image_find(IMAGE_MACHINE, argv[1], &image);
if (r < 0)
return log_error_errno(r, "Failed to look for machine %s: %m", argv[1]);
if (r == 0) {
@@ -148,7 +148,7 @@ static int export_raw(int argc, char *argv[], void *userdata) {
int r, fd;
if (machine_name_is_valid(argv[1])) {
r = image_find(argv[1], &image);
r = image_find(IMAGE_MACHINE, argv[1], &image);
if (r < 0)
return log_error_errno(r, "Failed to look for machine %s: %m", argv[1]);
if (r == 0) {
+2 -2
View File
@@ -75,7 +75,7 @@ static int import_tar(int argc, char *argv[], void *userdata) {
}
if (!arg_force) {
r = image_find(local, NULL);
r = image_find(IMAGE_MACHINE, local, NULL);
if (r < 0)
return log_error_errno(r, "Failed to check whether image '%s' exists: %m", local);
else if (r > 0) {
@@ -170,7 +170,7 @@ static int import_raw(int argc, char *argv[], void *userdata) {
}
if (!arg_force) {
r = image_find(local, NULL);
r = image_find(IMAGE_MACHINE, local, NULL);
if (r < 0)
return log_error_errno(r, "Failed to check whether image '%s' exists: %m", local);
else if (r > 0) {
+2 -2
View File
@@ -83,7 +83,7 @@ static int pull_tar(int argc, char *argv[], void *userdata) {
}
if (!arg_force) {
r = image_find(local, NULL);
r = image_find(IMAGE_MACHINE, local, NULL);
if (r < 0)
return log_error_errno(r, "Failed to check whether image '%s' exists: %m", local);
else if (r > 0) {
@@ -169,7 +169,7 @@ static int pull_raw(int argc, char *argv[], void *userdata) {
}
if (!arg_force) {
r = image_find(local, NULL);
r = image_find(IMAGE_MACHINE, local, NULL);
if (r < 0)
return log_error_errno(r, "Failed to check whether image '%s' exists: %m", local);
else if (r > 0) {