diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-05-01 11:47:31 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-05-01 11:47:31 +0100 |
commit | 8c3b820c2b687345448e3d74a7101b07ff32688e (patch) | |
tree | 0cf5be9515ddcaa1ef6e74c2c55fca5760400c1c /fish | |
parent | 632012e6419f04fab93909f92ecbab5a2c590447 (diff) | |
download | libguestfs-8c3b820c2b687345448e3d74a7101b07ff32688e.tar.gz libguestfs-8c3b820c2b687345448e3d74a7101b07ff32688e.tar.xz libguestfs-8c3b820c2b687345448e3d74a7101b07ff32688e.zip |
Generated code for ping-daemon command.
Diffstat (limited to 'fish')
-rw-r--r-- | fish/cmds.c | 19 | ||||
-rw-r--r-- | fish/completion.c | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/fish/cmds.c b/fish/cmds.c index 561018ab..7264e7dc 100644 --- a/fish/cmds.c +++ b/fish/cmds.c @@ -107,6 +107,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", "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"); printf ("%-20s %s\n", "pvs", "list the LVM physical volumes (PVs)"); @@ -472,6 +473,9 @@ void display_command (const char *cmd) if (strcasecmp (cmd, "dmesg") == 0) pod2text ("dmesg - return kernel messages", " dmesg\n\nThis returns the kernel messages (C<dmesg> output) from\nthe guest kernel. This is sometimes useful for extended\ndebugging of problems.\n\nAnother way to get the same information is to enable\nverbose messages with C<set_verbose> or by setting\nthe environment variable C<LIBGUESTFS_DEBUG=1> before\nrunning the program."); else + if (strcasecmp (cmd, "ping_daemon") == 0 || strcasecmp (cmd, "ping-daemon") == 0) + pod2text ("ping-daemon - ping the guest daemon", " ping-daemon\n\nThis is a test probe into the guestfs daemon running inside\nthe qemu subprocess. Calling this function checks that the\ndaemon responds to the ping message, without affecting the daemon\nor attached block device(s) in any other way."); + else display_builtin_command (cmd); } @@ -2299,6 +2303,18 @@ static int run_dmesg (const char *cmd, int argc, char *argv[]) return 0; } +static int run_ping_daemon (const char *cmd, int argc, char *argv[]) +{ + int r; + if (argc != 0) { + fprintf (stderr, "%s should have 0 parameter(s)\n", cmd); + fprintf (stderr, "type 'help %s' for help on %s\n", cmd, cmd); + return -1; + } + r = guestfs_ping_daemon (g); + return r; +} + int run_action (const char *cmd, int argc, char *argv[]) { if (strcasecmp (cmd, "launch") == 0 || strcasecmp (cmd, "run") == 0) @@ -2628,6 +2644,9 @@ int run_action (const char *cmd, int argc, char *argv[]) if (strcasecmp (cmd, "dmesg") == 0) return run_dmesg (cmd, argc, argv); else + if (strcasecmp (cmd, "ping_daemon") == 0 || strcasecmp (cmd, "ping-daemon") == 0) + return run_ping_daemon (cmd, argc, argv); + else { fprintf (stderr, "%s: unknown command\n", cmd); return -1; diff --git a/fish/completion.c b/fish/completion.c index f1abc0ba..095a3351 100644 --- a/fish/completion.c +++ b/fish/completion.c @@ -114,6 +114,7 @@ static const char *const commands[] = { "mounts", "mv", "path", + "ping-daemon", "pvcreate", "pvremove", "pvs", |