]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
import: mention explicitly which image directory we operate on
authorLennart Poettering <lennart@poettering.net>
Mon, 26 Feb 2024 14:53:35 +0000 (15:53 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 1 Mar 2024 21:25:42 +0000 (22:25 +0100)
Also, let's move the similar message about sync() mode to more common
code.

src/import/import-fs.c
src/import/import.c
src/import/pull.c

index b1619ef9eac0d17c0b48e004f69e4d5f418c2c93..44fc5be8a5cbfed5ba15a04e9e67cd67a109da0b 100644 (file)
@@ -171,6 +171,8 @@ static int import_fs(int argc, char *argv[], void *userdata) {
                 log_info("Importing '%s', saving as '%s'.", strempty(pretty), local);
         }
 
+        log_info("Operating on image directory '%s'.", arg_image_root);
+
         if (!arg_sync)
                 log_info("File system synchronization on completion is off.");
 
index 37dd0b2078f2f9943a0d804acaf05fe81711df05..889cd63ff0d87bafc249a62c3f7ee3f06ed1eb01 100644 (file)
@@ -114,6 +114,12 @@ static int open_source(const char *path, const char *local, int *ret_open_fd) {
                         log_info("Importing '%s', saving as '%s'.", strempty(pretty), local);
         }
 
+        if (!FLAGS_SET(arg_import_flags, IMPORT_DIRECT))
+                log_info("Operating on image directory '%s'.", arg_image_root);
+
+        if (!FLAGS_SET(arg_import_flags, IMPORT_SYNC))
+                log_info("File system synchronization on completion is off.");
+
         *ret_open_fd = TAKE_FD(open_fd);
         return retval;
 }
@@ -167,9 +173,6 @@ static int import_tar(int argc, char *argv[], void *userdata) {
         if (r < 0)
                 return r;
 
-        if (!FLAGS_SET(arg_import_flags, IMPORT_SYNC))
-                log_info("File system synchronization on completion is off.");
-
         r = tar_import_new(&import, event, arg_image_root, on_tar_finished, event);
         if (r < 0)
                 return log_error_errno(r, "Failed to allocate importer: %m");
@@ -239,9 +242,6 @@ static int import_raw(int argc, char *argv[], void *userdata) {
         if (r < 0)
                 return r;
 
-        if (!FLAGS_SET(arg_import_flags, IMPORT_SYNC))
-                log_info("File system synchronization on completion is off.");
-
         r = raw_import_new(&import, event, arg_image_root, on_raw_finished, event);
         if (r < 0)
                 return log_error_errno(r, "Failed to allocate importer: %m");
index d4ad0b2ea375887cc78b79571eb09ddcec54271f..7c838a5307b4c694d5a408bd9dfebd5aab70cb66 100644 (file)
@@ -90,6 +90,12 @@ static int normalize_local(const char *local, const char *url, char **ret) {
         } else
                 log_info("Pulling '%s'.", url);
 
+        if (!FLAGS_SET(arg_import_flags, IMPORT_DIRECT))
+                log_info("Operating on image directory '%s'.", arg_image_root);
+
+        if (!FLAGS_SET(arg_import_flags, IMPORT_SYNC))
+                log_info("File system synchronization on completion is off.");
+
         *ret = TAKE_PTR(ll);
         return 0;
 }
@@ -142,9 +148,6 @@ static int pull_tar(int argc, char *argv[], void *userdata) {
         if (r < 0)
                 return r;
 
-        if (!FLAGS_SET(arg_import_flags, IMPORT_SYNC))
-                log_info("File system synchronization on completion is off.");
-
         r = tar_pull_new(&pull, event, arg_image_root, on_tar_finished, event);
         if (r < 0)
                 return log_error_errno(r, "Failed to allocate puller: %m");
@@ -212,9 +215,6 @@ static int pull_raw(int argc, char *argv[], void *userdata) {
         if (r < 0)
                 return r;
 
-        if (!FLAGS_SET(arg_import_flags, IMPORT_SYNC))
-                log_info("File system synchronization on completion is off.");
-
         r = raw_pull_new(&pull, event, arg_image_root, on_raw_finished, event);
         if (r < 0)
                 return log_error_errno(r, "Failed to allocate puller: %m");