From: Lennart Poettering Date: Mon, 24 Aug 2015 19:08:04 +0000 (+0200) Subject: machinectl: don't show ".host" pseudo-machine in list by default X-Git-Tag: v225~26^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fee6d013d859bc66f5c993530898fece53fab06d;p=thirdparty%2Fsystemd.git machinectl: don't show ".host" pseudo-machine in list by default Let's hide all machines whose name begins with "." by default, thus hiding the ".host" pseudo-machine, unless --all is specified. This takes inspiration from the ".host" image handling in "machinectl list-images" which also hides all images whose name starts with ".". --- diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c index c84deba1c0c..0f9e732adaa 100644 --- a/src/machine/machinectl.c +++ b/src/machine/machinectl.c @@ -158,6 +158,9 @@ static int list_machines(int argc, char *argv[], void *userdata) { while ((r = sd_bus_message_read(reply, "(ssso)", &name, &class, &service, &object)) > 0) { size_t l; + if (name[0] == '.' && !arg_all) + continue; + if (!GREEDY_REALLOC(machines, n_allocated, n_machines + 1)) return log_oom();