import: mention explicitly which image directory we operate on

Also, let's move the similar message about sync() mode to more common
code.
This commit is contained in:
Lennart Poettering
2024-03-01 22:25:42 +01:00
parent d304686ca3
commit ed459ec0c0
3 changed files with 14 additions and 12 deletions
+2
View 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.");
+6 -6
View 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");
+6 -6
View 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");