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:
+2
-2
@@ -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
@@ -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
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user