summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Alcantara <palcantara@suse.de>2018-04-29 15:17:42 -0300
committerPaulo Alcantara <palcantara@suse.de>2018-04-30 10:23:27 -0300
commit6dec74731d9d22cd6d221dc97fdcee08ca22ecfe (patch)
treef7a28e42da31d498fd88b1a6c25f46f45e5d378a
parent1b8dbf06efd78b096618cf3ef44b9fa15806809c (diff)
downloadvmhtool-6dec74731d9d22cd6d221dc97fdcee08ca22ecfe.tar.gz
vmhtool-6dec74731d9d22cd6d221dc97fdcee08ca22ecfe.tar.xz
vmhtool-6dec74731d9d22cd6d221dc97fdcee08ca22ecfe.zip
Print out some useful information during execution.
Signed-off-by: Paulo Alcantara <palcantara@suse.de>
-rwxr-xr-xvmhelper19
1 files changed, 15 insertions, 4 deletions
diff --git a/vmhelper b/vmhelper
index 731a4f2..40d8666 100755
--- a/vmhelper
+++ b/vmhelper
@@ -78,7 +78,6 @@ sub parse_user_hdds {
return '' unless $vm_hdds;
my $args = '';
my $num = 1;
- print "$vm_hdds\n";
my @hdds = split(/,/, $vm_hdds);
foreach (@hdds) {
my $id = sprintf "hd%02x", rand(256);
@@ -366,7 +365,10 @@ if ($install_iso_path) {
$qemu_cmd .= " " . sprintf $qemu_linux_opts{'net'}, $macaddr, $tap_iface;
}
- system($qemu_cmd);
+ print "[*] installing $vm_name vm...";
+ system($qemu_cmd . " 2>/dev/null");
+ print "\n[*] done\n";
+
save_vm_info($vm_name, $macaddr);
destroy_tap_dev();
@@ -378,6 +380,7 @@ die "$vm_img_path does not exist" unless -f $vm_img_path;
if ($delete_vm) {
unlink($vm_img_path) or die "failed to remove $vm_img_path: $!";
rem_vm_info($vm_name);
+ print "[*] successfully deleted $vm_name\n";
exit 0;
}
@@ -405,7 +408,11 @@ if ($windows_guest) {
$qemu_cmd .= " $qemu_win_opts{'time'} $qemu_win_opts{'usb'}" .
" $qemu_win_opts{'gfx'}";
- system($qemu_cmd);
+ 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 "[*] terminated\n";
destroy_tap_dev();
exit 0;
@@ -581,7 +588,11 @@ if ($kernel_path) {
$qemu_cmd .= " -nographic -device virtio-serial-pci -serial mon:stdio" if $nographic;
}
-system($qemu_cmd);
+print "[*] $vm_name vm 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 "[*] terminated\n";
OUT:
destroy_tap_dev();