summaryrefslogtreecommitdiffstats
path: root/inspector
diff options
context:
space:
mode:
authorRichard Jones <rjones@trick.home.annexia.org>2009-07-20 15:09:11 +0100
committerRichard Jones <rjones@trick.home.annexia.org>2009-07-20 15:09:11 +0100
commit7a14e0509d5cc976deda9b5299f56930e0317502 (patch)
tree9b9835140b405e4d7b27ac167cba28ffb9047d38 /inspector
parent06f6cc32f02c25b88e763237332b17dc7c6c6837 (diff)
downloadlibguestfs-7a14e0509d5cc976deda9b5299f56930e0317502.tar.gz
libguestfs-7a14e0509d5cc976deda9b5299f56930e0317502.tar.xz
libguestfs-7a14e0509d5cc976deda9b5299f56930e0317502.zip
virt-inspector --fish: Fix incorrect '-a' parameter (RHBZ#512709)
virt-inspector --fish dom virt-inspector --ro-fish dom Both of the above commands give incorrect results if run on a libvirt domain, eg: $ virt-inspector --ro-fish RHEL54Betax64 ==> --ro -a RHEL54Betax64 -m /dev/VolGroup00/LogVol00:/ -m /dev/sda1:/boot ^^^^^^^^^^^^^ This is because the current code just prints back the original @ARGV parameters. This patch fixes this by getting the image names instead.
Diffstat (limited to 'inspector')
-rwxr-xr-xinspector/virt-inspector.pl11
1 files changed, 8 insertions, 3 deletions
diff --git a/inspector/virt-inspector.pl b/inspector/virt-inspector.pl
index cd53bcbf..09edbae1 100755
--- a/inspector/virt-inspector.pl
+++ b/inspector/virt-inspector.pl
@@ -207,10 +207,15 @@ pod2usage (__"virt-inspector: no image or VM names given") if @ARGV == 0;
my $rw = 0;
$rw = 1 if $output eq "fish";
my $g;
+my @images;
if ($uri) {
- $g = open_guest (\@ARGV, rw => $rw, address => $uri);
+ my ($conn, $dom);
+ ($g, $conn, $dom, @images) =
+ open_guest (\@ARGV, rw => $rw, address => $uri);
} else {
- $g = open_guest (\@ARGV, rw => $rw);
+ my ($conn, $dom);
+ ($g, $conn, $dom, @images) =
+ open_guest (\@ARGV, rw => $rw);
}
$g->launch ();
@@ -302,7 +307,7 @@ if ($output eq "fish" || $output eq "ro-fish") {
print "--ro ";
}
- print "-a $_ " foreach @ARGV;
+ print "-a $_ " foreach @images;
my $mounts = $oses->{$root_dev}->{mounts};
# Have to mount / first. Luckily '/' is early in the ASCII