technology identifier.</para></listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>--list</option></term>
+
+ <listitem><para>Output all currently known and detectable container and VM environments.</para></listitem>
+ </varlistentry>
+
<xi:include href="standard-options.xml" xpointer="help" />
<xi:include href="standard-options.xml" xpointer="version" />
</variablelist>
#include <stdbool.h>
#include <stdlib.h>
+#include "string-table.h"
#include "util.h"
#include "virt.h"
" -r --chroot Detect whether we are run in a chroot() environment\n"
" --private-users Only detect whether we are running in a user namespace\n"
" -q --quiet Don't output anything, just set return value\n"
+ " --list List all known and detectable types of virtualization\n"
, program_invocation_short_name);
}
enum {
ARG_VERSION = 0x100,
ARG_PRIVATE_USERS,
+ ARG_LIST,
};
static const struct option options[] = {
{ "chroot", no_argument, NULL, 'r' },
{ "private-users", no_argument, NULL, ARG_PRIVATE_USERS },
{ "quiet", no_argument, NULL, 'q' },
+ { "list", no_argument, NULL, ARG_LIST },
{}
};
arg_mode = ONLY_CHROOT;
break;
+ case ARG_LIST:
+ DUMP_STRING_TABLE(virtualization, int, _VIRTUALIZATION_MAX);
+ return 0;
+
case '?':
return -EINVAL;