Displaying 1 result from an estimated 1 matches for "is_feature_avail".
2015 Nov 04
2
[PATCH] tests/c-api: cache available features
...pr "struct feature features[%d] = {\n" nr_features;
+ List.iter (
+ fun feature ->
+ pr " { .name = \"%s\", .read = false, .available = false },\n"
+ feature
+ ) features;
+ pr "};\n";
+ pr "\n";
+
+ pr "\
+static bool
+is_feature_available (guestfs_h *g, const char *feature)
+{
+ size_t i;
+
+ for (i = 0; i < nr_features; ++i) {
+ struct feature *f = &features[i];
+
+ if (STRNEQ (f->name, feature))
+ continue;
+
+ if (!f->read) {
+ const char *array[] = { f->name, NULL };
+ int res = gues...