summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2009-06-08 17:44:14 +0100
committerRichard Jones <rjones@redhat.com>2009-06-08 17:44:14 +0100
commit3de234656bc61a2d35b0f1a9ccb1e6ef7535166b (patch)
treeb3a9b736a1cb6095f45207166b23059bfeeda3e9 /src
parent88be1d399915c716ff312f29a7d3f3afcfd509f8 (diff)
downloadlibguestfs-3de234656bc61a2d35b0f1a9ccb1e6ef7535166b.tar.gz
libguestfs-3de234656bc61a2d35b0f1a9ccb1e6ef7535166b.tar.xz
libguestfs-3de234656bc61a2d35b0f1a9ccb1e6ef7535166b.zip
Add 'ntfs_3g_probe' command so we can probe the "mountability" of an NTFS partition.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/generator.ml23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/generator.ml b/src/generator.ml
index ffee564e..2113bc43 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -2318,6 +2318,29 @@ This command is only needed because of C<guestfs_resize2fs>
"\
Sleep for C<secs> seconds.");
+ ("ntfs_3g_probe", (RInt "status", [Bool "rw"; String "device"]), 110, [],
+ [InitNone, Always, TestOutputInt (
+ [["sfdisk"; "/dev/sda"; "0"; "0"; "0"; ","];
+ ["mkfs"; "ntfs"; "/dev/sda1"];
+ ["ntfs_3g_probe"; "true"; "/dev/sda1"]], 0);
+ InitNone, Always, TestOutputInt (
+ [["sfdisk"; "/dev/sda"; "0"; "0"; "0"; ","];
+ ["mkfs"; "ext2"; "/dev/sda1"];
+ ["ntfs_3g_probe"; "true"; "/dev/sda1"]], 12)],
+ "probe NTFS volume",
+ "\
+This command runs the L<ntfs-3g.probe(8)> command which probes
+an NTFS C<device> for mountability. (Not all NTFS volumes can
+be mounted read-write, and some cannot be mounted at all).
+
+C<rw> is a boolean flag. Set it to true if you want to test
+if the volume can be mounted read-write. Set it to false if
+you want to test if the volume can be mounted read-only.
+
+The return value is an integer which C<0> if the operation
+would succeed, or some non-zero value documented in the
+L<ntfs-3g.probe(8)> manual page.");
+
]
let all_functions = non_daemon_functions @ daemon_functions