summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cat/virt-cat.c2
-rw-r--r--cat/virt-filesystems.c2
-rw-r--r--cat/virt-ls.c2
-rw-r--r--df/main.c2
-rw-r--r--fish/fish.c5
-rw-r--r--fish/guestfish.pod5
-rw-r--r--fish/inspect.c6
-rw-r--r--fish/options.h1
-rw-r--r--fish/virt.c4
-rw-r--r--fuse/guestmount.c5
-rw-r--r--fuse/guestmount.pod5
-rw-r--r--inspector/virt-inspector.c2
-rw-r--r--rescue/virt-rescue.c2
13 files changed, 43 insertions, 0 deletions
diff --git a/cat/virt-cat.c b/cat/virt-cat.c
index 470c70cc..834d490c 100644
--- a/cat/virt-cat.c
+++ b/cat/virt-cat.c
@@ -34,6 +34,7 @@
guestfs_h *g;
int read_only = 1;
+int live = 0;
int verbose = 0;
int keys_from_stdin = 0;
int echo_keys = 0;
@@ -213,6 +214,7 @@ main (int argc, char *argv[])
*/
assert (read_only == 1);
assert (inspector == 1);
+ assert (live == 0);
/* User must specify at least one filename on the command line. */
if (optind >= argc || argc - optind < 1)
diff --git a/cat/virt-filesystems.c b/cat/virt-filesystems.c
index cd991e85..7eca9ebc 100644
--- a/cat/virt-filesystems.c
+++ b/cat/virt-filesystems.c
@@ -46,6 +46,7 @@
guestfs_h *g;
int read_only = 1;
+int live = 0;
int verbose = 0;
int keys_from_stdin = 0;
int echo_keys = 0;
@@ -301,6 +302,7 @@ main (int argc, char *argv[])
*/
assert (read_only == 1);
assert (inspector == 0);
+ assert (live == 0);
/* Must be no extra arguments on the command line. */
if (optind != argc)
diff --git a/cat/virt-ls.c b/cat/virt-ls.c
index 64bae46e..315fb1ff 100644
--- a/cat/virt-ls.c
+++ b/cat/virt-ls.c
@@ -35,6 +35,7 @@
guestfs_h *g;
int read_only = 1;
+int live = 0;
int verbose = 0;
int keys_from_stdin = 0;
int echo_keys = 0;
@@ -227,6 +228,7 @@ main (int argc, char *argv[])
*/
assert (read_only == 1);
assert (inspector == 1);
+ assert (live == 0);
/* User must specify at least one directory name on the command line. */
if (optind >= argc || argc - optind < 1)
diff --git a/df/main.c b/df/main.c
index 7ac5a6c1..174692f9 100644
--- a/df/main.c
+++ b/df/main.c
@@ -41,6 +41,7 @@
guestfs_h *g;
int read_only = 1;
+int live = 0;
int verbose = 0;
int keys_from_stdin = 0;
int echo_keys = 0;
@@ -238,6 +239,7 @@ main (int argc, char *argv[])
*/
assert (read_only == 1);
assert (inspector == 0);
+ assert (live == 0);
/* Must be no extra arguments on the command line. */
if (optind != argc)
diff --git a/fish/fish.c b/fish/fish.c
index eb7c8fe8..b62c0988 100644
--- a/fish/fish.c
+++ b/fish/fish.c
@@ -74,6 +74,7 @@ static int override_progress_bars = -1;
guestfs_h *g;
int read_only = 0;
+int live = 0;
int quit = 0;
int verbose = 0;
int remote_control_listen = 0;
@@ -124,6 +125,7 @@ usage (int status)
" -i|--inspector Automatically mount filesystems\n"
" --keys-from-stdin Read passphrases from stdin\n"
" --listen Listen for remote commands\n"
+ " --live Connect to a live virtual machine\n"
" -m|--mount dev[:mnt] Mount dev on mnt (if omitted, /)\n"
" -n|--no-sync Don't autosync\n"
" -N|--new type Create prepared disk (test1.img, ...)\n"
@@ -173,6 +175,7 @@ main (int argc, char *argv[])
{ "inspector", 0, 0, 'i' },
{ "keys-from-stdin", 0, 0, 0 },
{ "listen", 0, 0, 0 },
+ { "live", 0, 0, 0 },
{ "mount", 1, 0, 'm' },
{ "new", 1, 0, 'N' },
{ "no-dest-paths", 0, 0, 'D' },
@@ -277,6 +280,8 @@ main (int argc, char *argv[])
format = optarg;
} else if (STREQ (long_options[option_index].name, "csh")) {
remote_control_csh = 1;
+ } else if (STREQ (long_options[option_index].name, "live")) {
+ live = 1;
} else {
fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
program_name, long_options[option_index].name, option_index);
diff --git a/fish/guestfish.pod b/fish/guestfish.pod
index 0f318f04..abf6d7ac 100644
--- a/fish/guestfish.pod
+++ b/fish/guestfish.pod
@@ -294,6 +294,11 @@ to try to read passphrases from the user by opening C</dev/tty>.
Fork into the background and listen for remote commands. See section
L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below.
+=item B<--live>
+
+Connect to a live virtual machine.
+(Experimental, see L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>).
+
=item B<-m dev[:mountpoint]>
=item B<--mount dev[:mountpoint]>
diff --git a/fish/inspect.c b/fish/inspect.c
index 713501e9..5e1948cd 100644
--- a/fish/inspect.c
+++ b/fish/inspect.c
@@ -73,6 +73,12 @@ compare_keys (const void *p1, const void *p2)
void
inspect_mount (void)
{
+ if (live) {
+ fprintf (stderr, _("%s: don't use --live and -i options together\n"),
+ program_name);
+ exit (EXIT_FAILURE);
+ }
+
inspect_do_decrypt ();
char **roots = guestfs_inspect_os (g);
diff --git a/fish/options.h b/fish/options.h
index 728df04a..b755d906 100644
--- a/fish/options.h
+++ b/fish/options.h
@@ -67,6 +67,7 @@
/* Provided by guestfish or guestmount. */
extern guestfs_h *g;
extern int read_only;
+extern int live;
extern int verbose;
extern int inspector;
extern int keys_from_stdin;
diff --git a/fish/virt.c b/fish/virt.c
index 13a6d127..b14cee2b 100644
--- a/fish/virt.c
+++ b/fish/virt.c
@@ -43,6 +43,10 @@ add_libvirt_drives (const char *guest)
optargs.bitmask |= GUESTFS_ADD_DOMAIN_READONLY_BITMASK;
optargs.readonly = 1;
}
+ if (live) {
+ optargs.bitmask |= GUESTFS_ADD_DOMAIN_LIVE_BITMASK;
+ optargs.live = 1;
+ }
return guestfs_add_domain_argv (g, guest, &optargs);
}
diff --git a/fuse/guestmount.c b/fuse/guestmount.c
index 3d3da39d..6adf1404 100644
--- a/fuse/guestmount.c
+++ b/fuse/guestmount.c
@@ -59,6 +59,7 @@
guestfs_h *g = NULL;
int read_only = 0;
+int live = 0;
int verbose = 0;
int inspector = 0;
int keys_from_stdin = 0;
@@ -879,6 +880,7 @@ usage (int status)
" -i|--inspector Automatically mount filesystems\n"
" --help Display help message and exit\n"
" --keys-from-stdin Read passphrases from stdin\n"
+ " --live Connect to a live virtual machine\n"
" -m|--mount dev[:mnt] Mount dev on mnt (if omitted, /)\n"
" -n|--no-sync Don't autosync\n"
" -o|--option opt Pass extra option to FUSE\n"
@@ -917,6 +919,7 @@ main (int argc, char *argv[])
{ "help", 0, 0, HELP_OPTION },
{ "inspector", 0, 0, 'i' },
{ "keys-from-stdin", 0, 0, 0 },
+ { "live", 0, 0, 0 },
{ "mount", 1, 0, 'm' },
{ "no-sync", 0, 0, 'n' },
{ "option", 1, 0, 'o' },
@@ -1017,6 +1020,8 @@ main (int argc, char *argv[])
keys_from_stdin = 1;
} else if (STREQ (long_options[option_index].name, "echo-keys")) {
echo_keys = 1;
+ } else if (STREQ (long_options[option_index].name, "live")) {
+ live = 1;
} else {
fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
program_name, long_options[option_index].name, option_index);
diff --git a/fuse/guestmount.pod b/fuse/guestmount.pod
index 567a2705..338af97b 100644
--- a/fuse/guestmount.pod
+++ b/fuse/guestmount.pod
@@ -143,6 +143,11 @@ mounted on the real virtual machine.
Read key or passphrase parameters from stdin. The default is
to try to read passphrases from the user by opening C</dev/tty>.
+=item B<--live>
+
+Connect to a live virtual machine.
+(Experimental, see L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>).
+
=item B<-m dev[:mnt]> | B<--mount dev[:mnt]>
Mount the named partition or logical volume on the given mountpoint
diff --git a/inspector/virt-inspector.c b/inspector/virt-inspector.c
index 68f8b46a..fda97874 100644
--- a/inspector/virt-inspector.c
+++ b/inspector/virt-inspector.c
@@ -38,6 +38,7 @@
guestfs_h *g;
int read_only = 1;
+int live = 0;
int verbose = 0;
int keys_from_stdin = 0;
int echo_keys = 0;
@@ -226,6 +227,7 @@ main (int argc, char *argv[])
*/
assert (read_only == 1);
assert (inspector == 1);
+ assert (live == 0);
/* Must be no extra arguments on the command line. */
if (optind != argc)
diff --git a/rescue/virt-rescue.c b/rescue/virt-rescue.c
index 6224ad7b..58be96bd 100644
--- a/rescue/virt-rescue.c
+++ b/rescue/virt-rescue.c
@@ -36,6 +36,7 @@
guestfs_h *g;
int read_only = 0;
+int live = 0;
int verbose = 0;
int keys_from_stdin = 0;
int echo_keys = 0;
@@ -239,6 +240,7 @@ main (int argc, char *argv[])
assert (inspector == 0);
assert (keys_from_stdin == 0);
assert (echo_keys == 0);
+ assert (live == 0);
/* Must be no extra arguments on the command line. */
if (optind != argc)