summaryrefslogtreecommitdiffstats
path: root/daemon/available.c
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 /daemon/available.c
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.
Diffstat (limited to 'daemon/available.c')
-rw-r--r--daemon/available.c18
1 files changed, 18 insertions, 0 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 */
+}