]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
machinectl: don't show ".host" pseudo-machine in list by default
authorLennart Poettering <lennart@poettering.net>
Mon, 24 Aug 2015 19:08:04 +0000 (21:08 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 24 Aug 2015 20:46:45 +0000 (22:46 +0200)
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 ".".

src/machine/machinectl.c

index c84deba1c0ccb16847d11734ed061bdd6f5a8bfa..0f9e732adaa9deb6dfeff3205bf573c549bb2e81 100644 (file)
@@ -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();