From cd61c3bfd718fb398cc53ced906266a9297782c9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 19 Dec 2014 18:42:50 +0100 Subject: machined/machinectl: add logic to show list of available images This adds a new bus call to machined that enumerates /var/lib/container and returns all trees stored in it, distuingishing three types: - GPT disk images, which are files suffixed with ".gpt" - directory trees - btrfs subvolumes --- src/shared/util.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/shared/util.h') diff --git a/src/shared/util.h b/src/shared/util.h index 96b8c1bcc0..e783ec6cdb 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -775,6 +775,15 @@ int search_and_fopen_nulstr(const char *path, const char *mode, const char *root continue; \ else +#define FOREACH_DIRENT_ALL(de, d, on_error) \ + for (errno = 0, de = readdir(d);; errno = 0, de = readdir(d)) \ + if (!de) { \ + if (errno > 0) { \ + on_error; \ + } \ + break; \ + } else + static inline void *mempset(void *s, int c, size_t n) { memset(s, c, n); return (uint8_t*)s + n; -- cgit v1.2.3-54-g00ecf