summaryrefslogtreecommitdiffstats
path: root/src/import/importctl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-03-01 16:13:59 +0100
committerLennart Poettering <lennart@poettering.net>2024-03-01 22:25:42 +0100
commit420b8ce7989206607902819ab32977a9f7d8eccb (patch)
treee3fea3f6c416fdddfe340bb7340f24c30c7363d5 /src/import/importctl.c
parentimportctl: add support for selecting image class to download (diff)
downloadsystemd-420b8ce7989206607902819ab32977a9f7d8eccb.tar.xz
systemd-420b8ce7989206607902819ab32977a9f7d8eccb.zip
importlisttransfersxclient
Diffstat (limited to 'src/import/importctl.c')
-rw-r--r--src/import/importctl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/import/importctl.c b/src/import/importctl.c
index 8035a69a38..3028f7d4bd 100644
--- a/src/import/importctl.c
+++ b/src/import/importctl.c
@@ -701,7 +701,7 @@ static int list_transfers(int argc, char *argv[], void *userdata) {
pager_open(arg_pager_flags);
bool ex;
- r = bus_call_method(bus, bus_import_mgr, "ListTransfersEx", &error, &reply, NULL);
+ r = bus_call_method(bus, bus_import_mgr, "ListTransfersEx", &error, &reply, "st", image_class_to_string(arg_image_class), UINT64_C(0));
if (r < 0) {
if (sd_bus_error_has_name(&error, SD_BUS_ERROR_UNKNOWN_METHOD)) {
sd_bus_error_free(&error);
@@ -741,6 +741,10 @@ static int list_transfers(int argc, char *argv[], void *userdata) {
if (r == 0)
break;
+ /* Ideally we use server-side filtering. But if the server can't do it, we need to do it client side */
+ if (arg_image_class >= 0 && image_class_from_string(class) != arg_image_class)
+ continue;
+
r = table_add_many(
t,
TABLE_UINT32, id,