diff --git a/src/import/export-raw.c b/src/import/export-raw.c index f4253962615..02d48fe991c 100644 --- a/src/import/export-raw.c +++ b/src/import/export-raw.c @@ -9,9 +9,11 @@ #include "copy.h" #include "export-raw.h" #include "fd-util.h" +#include "format-util.h" #include "fs-util.h" #include "import-common.h" #include "missing_fcntl.h" +#include "pretty-print.h" #include "ratelimit.h" #include "stat-util.h" #include "string-util.h" @@ -106,6 +108,7 @@ int raw_export_new( } static void raw_export_report_progress(RawExport *e) { + _cleanup_free_ char *s = NULL; unsigned percent; assert(e); @@ -121,7 +124,14 @@ static void raw_export_report_progress(RawExport *e) { return; sd_notifyf(false, "X_IMPORT_PROGRESS=%u%%", percent); - log_info("Exported %u%%.", percent); + + if (asprintf(&s, "%s %s/%s", + special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + FORMAT_BYTES(e->written_uncompressed), + FORMAT_BYTES(e->st.st_size)) < 0) + return; + + draw_progress_bar(s, percent); e->last_percent = percent; } diff --git a/src/import/export-tar.c b/src/import/export-tar.c index 9e92badfef3..c60026c03a9 100644 --- a/src/import/export-tar.c +++ b/src/import/export-tar.c @@ -7,6 +7,7 @@ #include "export-tar.h" #include "fd-util.h" #include "import-common.h" +#include "pretty-print.h" #include "process-util.h" #include "ratelimit.h" #include "string-util.h" @@ -113,6 +114,7 @@ int tar_export_new( } static void tar_export_report_progress(TarExport *e) { + _cleanup_free_ char *s = NULL; unsigned percent; assert(e); @@ -132,7 +134,14 @@ static void tar_export_report_progress(TarExport *e) { return; sd_notifyf(false, "X_IMPORT_PROGRESS=%u%%", percent); - log_info("Exported %u%%.", percent); + + if (asprintf(&s, "%s %s/%s", + special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + FORMAT_BYTES(e->written_uncompressed), + FORMAT_BYTES(e->quota_referenced)) < 0) + return; + + draw_progress_bar(s, percent); e->last_percent = percent; } diff --git a/src/import/import-raw.c b/src/import/import-raw.c index 78775b96d67..53657251964 100644 --- a/src/import/import-raw.c +++ b/src/import/import-raw.c @@ -20,6 +20,7 @@ #include "machine-pool.h" #include "mkdir-label.h" #include "path-util.h" +#include "pretty-print.h" #include "qcow2-util.h" #include "ratelimit.h" #include "rm-rf.h" @@ -130,6 +131,7 @@ int raw_import_new( } static void raw_import_report_progress(RawImport *i) { + _cleanup_free_ char *s = NULL; unsigned percent; assert(i); @@ -149,7 +151,14 @@ static void raw_import_report_progress(RawImport *i) { return; sd_notifyf(false, "X_IMPORT_PROGRESS=%u%%", percent); - log_info("Imported %u%%.", percent); + + if (asprintf(&s, "%s %s/%s", + special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + FORMAT_BYTES(i->written_compressed), + FORMAT_BYTES(i->input_stat.st_size)) < 0) + return; + + draw_progress_bar(s, percent); i->last_percent = percent; } diff --git a/src/import/import-tar.c b/src/import/import-tar.c index 976c9182461..ec269716729 100644 --- a/src/import/import-tar.c +++ b/src/import/import-tar.c @@ -20,6 +20,7 @@ #include "machine-pool.h" #include "mkdir-label.h" #include "path-util.h" +#include "pretty-print.h" #include "process-util.h" #include "qcow2-util.h" #include "ratelimit.h" @@ -131,6 +132,7 @@ int tar_import_new( } static void tar_import_report_progress(TarImport *i) { + _cleanup_free_ char *s = NULL; unsigned percent; assert(i); @@ -150,7 +152,14 @@ static void tar_import_report_progress(TarImport *i) { return; sd_notifyf(false, "X_IMPORT_PROGRESS=%u%%", percent); - log_info("Imported %u%%.", percent); + + if (asprintf(&s, "%s %s/%s", + special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + FORMAT_BYTES(i->written_compressed), + FORMAT_BYTES(i->input_stat.st_size)) < 0) + return; + + draw_progress_bar(s, percent); i->last_percent = percent; }