summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-05-25 11:27:49 +0100
committerRichard Jones <rjones@redhat.com>2010-05-25 11:27:49 +0100
commit1bd1f9b85f45275b1600d148530bc1877ff15213 (patch)
tree7b473806650a87b4b53a8c918ff85671c0aef7ac
parentf8ee7869f4836427109959cf20e299a31fa86eaf (diff)
downloadlibguestfs-1bd1f9b85f45275b1600d148530bc1877ff15213.tar.gz
libguestfs-1bd1f9b85f45275b1600d148530bc1877ff15213.tar.xz
libguestfs-1bd1f9b85f45275b1600d148530bc1877ff15213.zip
New API: available-all-groups to return list of all optional groups.
-rw-r--r--daemon/available.c18
-rw-r--r--src/MAX_PROC_NR2
-rwxr-xr-xsrc/generator.ml14
3 files changed, 33 insertions, 1 deletions
diff --git a/daemon/available.c b/daemon/available.c
index 77fdfa2c..2a30cadf 100644
--- a/daemon/available.c
+++ b/daemon/available.c
@@ -53,3 +53,21 @@ do_available (char *const *groups)
return 0;
}
+
+char **
+do_available_all_groups (void)
+{
+ size_t i;
+ char **groups = NULL;
+ int size = 0, alloc = 0;
+
+ for (i = 0; optgroups[i].group != NULL; ++i) {
+ if (add_string (&groups, &size, &alloc, optgroups[i].group) == -1)
+ return NULL;
+ }
+
+ if (add_string (&groups, &size, &alloc, NULL) == -1)
+ return NULL;
+
+ return groups; /* caller frees */
+}
diff --git a/src/MAX_PROC_NR b/src/MAX_PROC_NR
index cb1a40df..1f7e0d6e 100644
--- a/src/MAX_PROC_NR
+++ b/src/MAX_PROC_NR
@@ -1 +1 @@
-250
+251
diff --git a/src/generator.ml b/src/generator.ml
index ccadbfd5..f094749b 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -4278,6 +4278,8 @@ the libguestfs appliance will be able to provide.
The libguestfs groups, and the functions that those
groups correspond to, are listed in L<guestfs(3)/AVAILABILITY>.
+You can also fetch this list at runtime by calling
+C<guestfs_available_all_groups>.
The argument C<groups> is a list of group names, eg:
C<[\"inotify\", \"augeas\"]> would check for the availability of
@@ -4708,6 +4710,18 @@ allows you to specify the new size (in bytes) explicitly.");
This command is the same as C<guestfs_ntfsresize> except that it
allows you to specify the new size (in bytes) explicitly.");
+ ("available_all_groups", (RStringList "groups", []), 251, [],
+ [],
+ "return a list of all optional groups",
+ "\
+This command returns a list of all optional groups that this
+daemon knows about. Note this returns both supported and unsupported
+groups. To find out which ones the daemon can actually support
+you have to call C<guestfs_available> on each member of the
+returned list.
+
+See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>.");
+
]
let all_functions = non_daemon_functions @ daemon_functions