]> iEval git - gruntmaster-daemon.git/commitdiff
Fix VM usage and update ex/runvm
authorMarius Gavrilescu <marius@ieval.ro>
Wed, 5 Aug 2015 14:15:09 +0000 (17:15 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Wed, 5 Aug 2015 14:15:09 +0000 (17:15 +0300)
ex/runvm
lib/Gruntmaster/Daemon/Format.pm

index 8495e5106c4894258ee8df9c0e77b2306f474958..18331a0af557ebddbbbbef287dd9b01f9bff03ef 100755 (executable)
--- a/ex/runvm
+++ b/ex/runvm
@@ -2,10 +2,10 @@
 ROOT=.
 
 qemu-system-x86_64 \
-       -enable-kvm -cpu host -m 256MB \
-       -nodefaults -nographic \
+       -enable-kvm -cpu host -m 1G \
+       -nodefaults -display none -monitor none \
        -kernel $ROOT/bzImage \
-       -append 'root=/dev/vda console=ttyS0,1200 init=/bin/bash --login' \
+       -append 'root=/dev/vda console=ttyS0,1200 acpi=noirq quiet init=/bin/bash --login' \
        -drive file=$ROOT/vm.squashfs,if=virtio,readonly \
        -virtfs local,id=virtfs0,path=.,security_model=none,mount_tag=virtfs \
-       -serial stdio "$@"
+       -chardev stdio,id=stdio,signal=off -serial chardev:stdio "$@"
index 4a57d6a38b6757e99f6906645341efb21588095c..7b6f77bcc6c24527021b095e04dbe58f55181897 100644 (file)
@@ -29,8 +29,10 @@ sub runvm {
        my $cmd = $ENV{GRUNTMASTER_VM};
        $cmd .= ' ' . $arg if $arg;
        get_logger->trace("Starting VM $name ($cmd)");
-       $vm{$name} = Expect->spawn($cmd);
+       $vm{$name} = Expect->new;
        $vm{$name}->raw_pty(1);
+       $vm{$name}->log_stdout(0);
+       $vm{$name}->spawn($cmd);
        $vm{$name}->expect(5, '# ') or get_logger->logdie("Error while starting VM $name: ". $vm{$name}->error);
 }
 
@@ -66,7 +68,7 @@ sub execlist {
        if ($vm{$vm}) {
                my $cmd = ">$er " . shell_quote 'gruntmaster-exec', @args;
                get_logger->trace("Running in VM $vm: $cmd");
-               $vm{$vm}->send($cmd);
+               $vm{$vm}->send($cmd, "\n");
        } else {
                $pid{$vm} = fork // die "Cannot fork\n";
                unless ($pid{$vm}) {
This page took 0.023478 seconds and 4 git commands to generate.