diff options
author | Richard Jones <rjones@redhat.com> | 2009-06-08 17:44:18 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-06-08 17:44:18 +0100 |
commit | 460d139e6a52da67a4f1947035b1978610349f78 (patch) | |
tree | 798177aa71bc9615074cd1a9a351ff4b38165c7c /fish/cmds.c | |
parent | 3de234656bc61a2d35b0f1a9ccb1e6ef7535166b (diff) | |
download | libguestfs-460d139e6a52da67a4f1947035b1978610349f78.tar.gz libguestfs-460d139e6a52da67a4f1947035b1978610349f78.tar.xz libguestfs-460d139e6a52da67a4f1947035b1978610349f78.zip |
Generated code for ntfs_3g_probe command.
Diffstat (limited to 'fish/cmds.c')
-rw-r--r-- | fish/cmds.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/fish/cmds.c b/fish/cmds.c index 8e8e08ac..334d7154 100644 --- a/fish/cmds.c +++ b/fish/cmds.c @@ -114,6 +114,7 @@ void list_commands (void) printf ("%-20s %s\n", "mount-vfs", "mount a guest disk with mount options and vfstype"); printf ("%-20s %s\n", "mounts", "show mounted filesystems"); printf ("%-20s %s\n", "mv", "move a file"); + printf ("%-20s %s\n", "ntfs-3g-probe", "probe NTFS volume"); printf ("%-20s %s\n", "ping-daemon", "ping the guest daemon"); printf ("%-20s %s\n", "pvcreate", "create an LVM physical volume"); printf ("%-20s %s\n", "pvremove", "remove an LVM physical volume"); @@ -556,6 +557,9 @@ void display_command (const char *cmd) if (strcasecmp (cmd, "sleep") == 0) pod2text ("sleep - sleep for some seconds", " sleep <secs>\n\nSleep for C<secs> seconds."); else + if (strcasecmp (cmd, "ntfs_3g_probe") == 0 || strcasecmp (cmd, "ntfs-3g-probe") == 0) + pod2text ("ntfs-3g-probe - probe NTFS volume", " ntfs-3g-probe <rw> <device>\n\nThis command runs the L<ntfs-3g.probe(8)> command which probes\nan NTFS C<device> for mountability. (Not all NTFS volumes can\nbe mounted read-write, and some cannot be mounted at all).\n\nC<rw> is a boolean flag. Set it to true if you want to test\nif the volume can be mounted read-write. Set it to false if\nyou want to test if the volume can be mounted read-only.\n\nThe return value is an integer which C<0> if the operation\nwould succeed, or some non-zero value documented in the\nL<ntfs-3g.probe(8)> manual page."); + else display_builtin_command (cmd); } @@ -2716,6 +2720,24 @@ static int run_sleep (const char *cmd, int argc, char *argv[]) return r; } +static int run_ntfs_3g_probe (const char *cmd, int argc, char *argv[]) +{ + int r; + int rw; + const char *device; + if (argc != 2) { + fprintf (stderr, "%s should have 2 parameter(s)\n", cmd); + fprintf (stderr, "type 'help %s' for help on %s\n", cmd, cmd); + return -1; + } + rw = is_true (argv[0]) ? 1 : 0; + device = argv[1]; + r = guestfs_ntfs_3g_probe (g, rw, device); + if (r == -1) return -1; + printf ("%d\n", r); + return 0; +} + int run_action (const char *cmd, int argc, char *argv[]) { if (strcasecmp (cmd, "launch") == 0 || strcasecmp (cmd, "run") == 0) @@ -3108,6 +3130,9 @@ int run_action (const char *cmd, int argc, char *argv[]) if (strcasecmp (cmd, "sleep") == 0) return run_sleep (cmd, argc, argv); else + if (strcasecmp (cmd, "ntfs_3g_probe") == 0 || strcasecmp (cmd, "ntfs-3g-probe") == 0) + return run_ntfs_3g_probe (cmd, argc, argv); + else { fprintf (stderr, "%s: unknown command\n", cmd); return -1; |