X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fmachine%2Fmachinectl.c;h=071b2b9ebf59cd5a6bae5923e62cfa7424dff3e0;hb=10bc4cd469fc677892b07748ec85804ca120825f;hp=5a42f26eaf1f4d584bc0840d445465f42c81ae9c;hpb=6adf7b5e46d32376868feef0197e6ada352aa6f2;p=elogind.git diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c index 5a42f26ea..071b2b9eb 100644 --- a/src/machine/machinectl.c +++ b/src/machine/machinectl.c @@ -1785,7 +1785,7 @@ static int transfer_signal_handler(sd_event_source *s, const struct signalfd_sig assert(si); if (!arg_quiet) - log_info("Continuing download in the background. Use \"machinectl cancel-transfer %" PRIu32 "\" to arbort transfer.", PTR_TO_UINT32(userdata)); + log_info("Continuing download in the background. Use \"machinectl cancel-transfer %" PRIu32 "\" to abort transfer.", PTR_TO_UINT32(userdata)); sd_event_exit(sd_event_source_get_event(s), EINTR); return 0; @@ -2000,7 +2000,7 @@ static int pull_dkr(int argc, char *argv[], void *userdata) { sd_bus *bus = userdata; int r; - if (!streq_ptr(arg_dkr_index_url, "no")) { + if (arg_verify != IMPORT_VERIFY_NO) { log_error("Imports from DKR do not support image verification, please pass --verify=no."); return -EINVAL; } @@ -2071,6 +2071,7 @@ typedef struct TransferInfo { const char *type; const char *remote; const char *local; + double progress; } TransferInfo; static int compare_transfer_info(const void *a, const void *b) { @@ -2088,6 +2089,7 @@ static int list_transfers(int argc, char *argv[], void *userdata) { const char *type, *remote, *local, *object; sd_bus *bus = userdata; uint32_t id, max_id = 0; + double progress; int r; pager_open_if_enabled(); @@ -2106,11 +2108,11 @@ static int list_transfers(int argc, char *argv[], void *userdata) { return r; } - r = sd_bus_message_enter_container(reply, 'a', "(ussso)"); + r = sd_bus_message_enter_container(reply, 'a', "(usssdo)"); if (r < 0) return bus_log_parse_error(r); - while ((r = sd_bus_message_read(reply, "(ussso)", &id, &type, &remote, &local, &object)) > 0) { + while ((r = sd_bus_message_read(reply, "(usssdo)", &id, &type, &remote, &local, &progress, &object)) > 0) { size_t l; if (!GREEDY_REALLOC(transfers, n_allocated, n_transfers + 1)) @@ -2120,6 +2122,7 @@ static int list_transfers(int argc, char *argv[], void *userdata) { transfers[n_transfers].type = type; transfers[n_transfers].remote = remote; transfers[n_transfers].local = local; + transfers[n_transfers].progress = progress; l = strlen(type); if (l > max_type) @@ -2148,15 +2151,17 @@ static int list_transfers(int argc, char *argv[], void *userdata) { qsort_safe(transfers, n_transfers, sizeof(TransferInfo), compare_transfer_info); if (arg_legend) - printf("%-*s %-*s %-*s %-*s\n", + printf("%-*s %-*s %-*s %-*s %-*s\n", (int) MAX(2U, DECIMAL_STR_WIDTH(max_id)), "ID", + (int) 7, "PERCENT", (int) max_type, "TYPE", (int) max_local, "LOCAL", (int) max_remote, "REMOTE"); for (j = 0; j < n_transfers; j++) - printf("%*" PRIu32 " %-*s %-*s %-*s\n", + printf("%*" PRIu32 " %*u%% %-*s %-*s %-*s\n", (int) MAX(2U, DECIMAL_STR_WIDTH(max_id)), transfers[j].id, + (int) 6, (unsigned) (transfers[j].progress * 100), (int) max_type, transfers[j].type, (int) max_local, transfers[j].local, (int) max_remote, transfers[j].remote); @@ -2246,7 +2251,7 @@ static int help(int argc, char *argv[], void *userdata) { " copy-from NAME PATH [PATH] Copy files from a container to the host\n" " bind NAME PATH [PATH] Bind mount a path from the host into a container\n\n" "Image Commands:\n" - " list-images Show available container annd VM images\n" + " list-images Show available container and VM images\n" " image-status NAME... Show image details\n" " show-image NAME... Show properties of image\n" " clone NAME NAME Clone an image\n"