diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-06-24 20:10:53 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-06-24 20:10:53 +0100 |
commit | 67a469c3eb68cbf735749118249ea6cd2c892486 (patch) | |
tree | 06e9fc5ecac039c592bf97cc753c53da1a9b890e /inspector | |
parent | 215041c7178922341ecbfdb23eb203f2bb8c29c4 (diff) | |
download | libguestfs-67a469c3eb68cbf735749118249ea6cd2c892486.tar.gz libguestfs-67a469c3eb68cbf735749118249ea6cd2c892486.tar.xz libguestfs-67a469c3eb68cbf735749118249ea6cd2c892486.zip |
Allow guestfish -i / virt-inspector on live domains, in limited circumstances.
Diffstat (limited to 'inspector')
-rwxr-xr-x | inspector/virt-inspector.pl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/inspector/virt-inspector.pl b/inspector/virt-inspector.pl index 6aa63ad3..28bee778 100755 --- a/inspector/virt-inspector.pl +++ b/inspector/virt-inspector.pl @@ -222,6 +222,13 @@ if (-e $ARGV[0]) { die "cannot connect to libvirt $uri\n" unless $vmm; my @doms = $vmm->list_defined_domains (); + my $isitinactive = "an inactive libvirt domain"; + if ($output ne "fish") { + # In the special case where we want read-only access to + # a domain, allow the user to specify an active domain too. + push @doms, $vmm->list_domains (); + $isitinactive = "a libvirt domain"; + } my $dom; foreach (@doms) { if ($_->get_name () eq $ARGV[0]) { @@ -229,8 +236,7 @@ if (-e $ARGV[0]) { last; } } - die "$ARGV[0] is not the name of an inactive libvirt domain\n" - unless $dom; + die "$ARGV[0] is not the name of $isitinactive\n" unless $dom; # Get the names of the image(s). my $xml = $dom->get_xml_description (); |