summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Alcantara <palcantara@suse.de>2018-05-07 11:51:09 -0300
committerPaulo Alcantara <palcantara@suse.de>2018-05-07 11:51:09 -0300
commit9c0bb53c5379931068c1abcbb2b5d5dd735546dc (patch)
tree63e0395687e45eee34cb49c384839110ca5ae368
parent789d16bdb8ad7fba57a22497e6455252dd553258 (diff)
downloadvmhtool-9c0bb53c5379931068c1abcbb2b5d5dd735546dc.tar.gz
vmhtool-9c0bb53c5379931068c1abcbb2b5d5dd735546dc.tar.xz
vmhtool-9c0bb53c5379931068c1abcbb2b5d5dd735546dc.zip
Print out qemu cmd when installing or executing a vm.
Signed-off-by: Paulo Alcantara <palcantara@suse.de>
-rwxr-xr-xvmhelper21
1 files changed, 18 insertions, 3 deletions
diff --git a/vmhelper b/vmhelper
index d177b1b..9c94a1e 100755
--- a/vmhelper
+++ b/vmhelper
@@ -354,8 +354,15 @@ if ($cmd_opts{install_iso_path}) {
$qemu_cmd .= " " . sprintf $qemu_linux_opts{'net'}, $macaddr, $tap_iface;
}
- print "[*] installing $vm_name vm...";
- system($qemu_cmd . " 2>/dev/null");
+ $qemu_cmd .= " 2>/dev/null";
+
+ print "[*] install $vm_name vm\n";
+ print "[*] macaddr: $macaddr\n";
+ print "[*] cmd: $qemu_cmd\n";
+ if (system($qemu_cmd)) {
+ destroy_tap_dev();
+ die "failed to exec cmd: $qemu_cmd";
+ }
print "\n[*] done\n";
save_vm_info($vm_name, $macaddr);
@@ -397,10 +404,16 @@ if ($cmd_opts{windows_guest}) {
$qemu_cmd .= " $qemu_win_opts{'time'} $qemu_win_opts{'usb'}" .
" $qemu_win_opts{'gfx'}";
+ $qemu_cmd .= " 2>/dev/null";
+
print "[*] $vm_name is up and running\n";
print "[*] ipaddr: " . resolve_name($vm_name) . "\n";
print "[*] macaddr: " . get_vm_macaddr() . "\n";
- system($qemu_cmd . " 2>/dev/null");
+ print "[*] cmd: $qemu_cmd\n";
+ if (system($qemu_cmd)) {
+ destroy_tap_dev();
+ die "failed to exec cmd: $qemu_cmd";
+ }
print "[*] terminated\n";
destroy_tap_dev();
@@ -582,6 +595,8 @@ if ($cmd_opts{kernel_path}) {
$qemu_cmd .= " -nographic -device virtio-serial-pci -serial mon:stdio" if $cmd_opts{nographic};
}
+$qemu_cmd .= " 2>/dev/null";
+
print "[*] $vm_name vm is up and running\n";
print "[*] ipaddr: " . resolve_name($vm_name) . "\n";
print "[*] macaddr: " . get_vm_macaddr() . "\n";