summaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-03-20 17:17:02 +0000
committerRichard W.M. Jones <rjones@redhat.com>2012-03-20 18:50:24 +0000
commit3f6cc550ff5dcaca813b19938daaf41baacb1efa (patch)
tree112bec75e5bb37ce22448401cf9c92c720f73b86 /generator
parent65ebec4a7a70cd179e4c39d72f539e500931c267 (diff)
downloadlibguestfs-3f6cc550ff5dcaca813b19938daaf41baacb1efa.tar.gz
libguestfs-3f6cc550ff5dcaca813b19938daaf41baacb1efa.tar.xz
libguestfs-3f6cc550ff5dcaca813b19938daaf41baacb1efa.zip
New API: md-stat.
This returns information about the underlying devices of an MD (software RAID) device.
Diffstat (limited to 'generator')
-rw-r--r--generator/generator_actions.ml49
-rw-r--r--generator/generator_structs.ml8
2 files changed, 57 insertions, 0 deletions
diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml
index 8c074ca9..68a7bf69 100644
--- a/generator/generator_actions.ml
+++ b/generator/generator_actions.ml
@@ -6822,6 +6822,55 @@ volume group and returns its metadata.
Note that the metadata is an internal structure used by LVM,
subject to change at any time, and is provided for information only.");
+ ("md_stat", (RStructList ("devices", "mdstat"), [Device "md"], []), 316, [Optional "mdadm"],
+ [],
+ "get underlying devices from an MD device",
+ "\
+This call returns a list of the underlying devices which make
+up the single software RAID array device C<md>.
+
+To get a list of software RAID devices, call C<guestfs_list_md_devices>.
+
+Each structure returned corresponds to one device along with
+additional status information:
+
+=over 4
+
+=item C<mdstat_device>
+
+The name of the underlying device.
+
+=item C<mdstat_index>
+
+The index of this device within the array.
+
+=item C<mdstat_flags>
+
+Flags associated with this device. This is a string containing
+(in no specific order) zero or more of the following flags:
+
+=over 4
+
+=item C<W>
+
+write-mostly
+
+=item C<F>
+
+device is faulty
+
+=item C<S>
+
+device is a RAID spare
+
+=item C<R>
+
+replacement
+
+=back
+
+=back");
+
]
let all_functions = non_daemon_functions @ daemon_functions
diff --git a/generator/generator_structs.ml b/generator/generator_structs.ml
index 61228a4b..8c862ae3 100644
--- a/generator/generator_structs.ml
+++ b/generator/generator_structs.ml
@@ -212,6 +212,13 @@ let structs = [
"iso_volume_expiration_t", FInt64;
"iso_volume_effective_t", FInt64;
];
+
+ (* /proc/mdstat information. See linux.git/drivers/md/md.c *)
+ "mdstat", [
+ "mdstat_device", FString;
+ "mdstat_index", FInt32;
+ "mdstat_flags", FString;
+ ];
] (* end of structs *)
(* For bindings which want camel case *)
@@ -229,6 +236,7 @@ let camel_structs = [
"partition", "Partition";
"application", "Application";
"isoinfo", "ISOInfo";
+ "mdstat", "MDStat";
]
let camel_structs = List.sort (fun (_,a) (_,b) -> compare a b) camel_structs