summaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorWanlong Gao <wanlong.gao@gmail.com>2011-12-03 17:07:47 +0800
committerRichard W.M. Jones <rjones@redhat.com>2011-12-03 11:05:48 +0000
commitfcb975a6424d48d63f03961e34b92ed7c6a27362 (patch)
tree3d50ded681c05bee1effce496fa84cf43f95d383 /generator
parentb7addee24d211014086c44bcef6a0c799e4fb987 (diff)
downloadlibguestfs-fcb975a6424d48d63f03961e34b92ed7c6a27362.tar.gz
libguestfs-fcb975a6424d48d63f03961e34b92ed7c6a27362.tar.xz
libguestfs-fcb975a6424d48d63f03961e34b92ed7c6a27362.zip
NEW API: add blkid command to print the attributes of the device
A NEW API blkid. It can print the device attributes. Use it after list-devices, we can list ower devices and the attributes of each device. Use it like: blkid <device> It's should be a usefull function. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Diffstat (limited to 'generator')
-rw-r--r--generator/generator_actions.ml38
1 files changed, 38 insertions, 0 deletions
diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml
index 0e39e2f5..55e8d5da 100644
--- a/generator/generator_actions.ml
+++ b/generator/generator_actions.ml
@@ -6538,6 +6538,44 @@ The name of the MD device.
This command deactivates the MD array named C<md>. The
device is stopped, but it is not destroyed or zeroed.");
+ ("blkid", (RHashtable "info", [Device "device"], []), 303, [],
+ [InitScratchFS, Always, TestOutputHashtable (
+ [["blkid"; "/dev/sdb1"]],
+ ["TYPE", "ext2";
+ "USAGE", "filesystem";
+ "PART_ENTRY_NUMBER", "1";
+ "PART_ENTRY_TYPE", "0x83";
+ "PART_ENTRY_OFFSET", "128";
+ "PART_ENTRY_SIZE", "102145"])],
+ "print block device attributes",
+ "\
+This command returns block device attributes for C<device>. The following fields are
+usually present in the returned hash. Other fields may also be present.
+
+=over
+
+=item C<UUID>
+
+The uuid of this device.
+
+=item C<LABEL>
+
+The label of this device.
+
+=item C<VERSION>
+
+The version of blkid command.
+
+=item C<TYPE>
+
+The filesystem type or RAID of this device.
+
+=item C<USAGE>
+
+The usage of this device, for example C<filesystem> or C<raid>.
+
+=back");
+
]
let all_functions = non_daemon_functions @ daemon_functions