aboutsummaryrefslogtreecommitdiffstats
path: root/qemu-run
diff options
context:
space:
mode:
authorkraxel <kraxel>2009-03-18 15:46:50 +0000
committerkraxel <kraxel>2009-03-18 15:46:50 +0000
commit41733a5b54bcd73122d5ed3e35620ebc69ab1611 (patch)
treeb3b875372a1c37e7ec7add62cdcdb4b1343f9aeb /qemu-run
parent09a214dd9c1659e23ecd02d700bb1a0547900e6c (diff)
downloadqemu-gtk-41733a5b54bcd73122d5ed3e35620ebc69ab1611.tar.gz
cursor blink option
Diffstat (limited to 'qemu-run')
-rwxr-xr-xqemu-run19
1 files changed, 13 insertions, 6 deletions
diff --git a/qemu-run b/qemu-run
index c3212f5..a90c4e7 100755
--- a/qemu-run
+++ b/qemu-run
@@ -3,6 +3,7 @@ use warnings;
use strict;
use XML::Parser;
use Getopt::Std;
+use POSIX;
# args
my %opts;
@@ -169,11 +170,11 @@ close HELP;
# build cmdline -- basic setup
print "-- \n" if $debug;
push @cmdline, $xml_elems{'emulator'};
-if (defined($xml_elems{'name'}) && $help =~ m/-name/) {
+if (defined($xml_elems{'name'}) and $help =~ m/-name/) {
push @cmdline, "-name";
push @cmdline, $xml_elems{'name'};
}
-if (defined($xml_elems{'uuid'}) && $help =~ m/-uuid/) {
+if (defined($xml_elems{'uuid'}) and $help =~ m/-uuid/) {
push @cmdline, "-uuid";
push @cmdline, $xml_elems{'uuid'};
}
@@ -197,6 +198,11 @@ if (defined($soundhw)) {
push @cmdline, $soundhw;
}
+# build cmdline -- kvm
+if (POSIX::access("/dev/kvm", &POSIX::W_OK) and $help =~ m/-enable-kvm/) {
+ push @cmdline, "-enable-kvm";
+}
+
# build cmdline -- disks
foreach my $disk (@disks) {
print "disk: " . join (", ", map {
@@ -272,6 +278,7 @@ if (-S $monitor and !system("fuser", "-s", $monitor)) {
# still running
printf "VM %s still running, reconnecting\n", $name;
} else {
+ unlink $monitor;
$pid = fork();
die "fork: $!" unless defined($pid);
if (0 == $pid) {
@@ -281,6 +288,10 @@ if (-S $monitor and !system("fuser", "-s", $monitor)) {
exec(@cmdline);
exit(1);
}
+ foreach my $i (0 ... 100) {
+ last if -S $monitor;
+ sleep(0.1);
+ }
}
# run qemu-gtk
@@ -288,10 +299,6 @@ if (-S $monitor and !system("fuser", "-s", $monitor)) {
push @cmdline, "qemu-gtk";
push @cmdline, "-m" if $showmon;
push @cmdline, "unix:" . $monitor . ",server,nowait";
-foreach my $i (0 ... 100) {
- last if -S $monitor;
- sleep(0.1);
-}
print join(", ", map { "\"$_\"" } @cmdline) . "\n"
if $debug;
exec(@cmdline);