New API: available-all-groups to return list of all optional groups.
authorRichard Jones <rjones@redhat.com>
Tue, 25 May 2010 10:27:49 +0000 (11:27 +0100)
committerRichard Jones <rjones@redhat.com>
Tue, 25 May 2010 10:27:49 +0000 (11:27 +0100)
daemon/available.c
src/MAX_PROC_NR
src/generator.ml

index 77fdfa2..2a30cad 100644 (file)
@@ -53,3 +53,21 @@ do_available (char *const *groups)
 
   return 0;
 }
 
   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 */
+}
index cb1a40d..1f7e0d6 100644 (file)
@@ -1 +1 @@
-250
+251
index ccadbfd..f094749 100755 (executable)
@@ -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>.
 
 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
 
 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.");
 
 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
 ]
 
 let all_functions = non_daemon_functions @ daemon_functions