Don't pass "-nics 0" to qemu, because this option name has changed
[pintos-anon] / src / utils / pintos
index 0c1f34d54aab6c79d1a7f6ec7cb81e0380c0545d..214e05198a17edd13271b024e601149f3a316c73 100755 (executable)
@@ -8,7 +8,7 @@ use Getopt::Long qw(:config bundling);
 
 # Command-line options.
 our ($start_time) = time ();
-our ($sim);                    # Simulator: bochs, qemu, or gsx.
+our ($sim) = $ENV{PINTOSSIM};  # Simulator: bochs, qemu, or gsx.
 our ($debug) = "none";         # Debugger: none, monitor, or gdb.
 our ($mem) = 4;                        # Physical RAM in MB.
 our ($serial_out) = 1;         # Send output to serial port?
@@ -130,6 +130,8 @@ Disk options: (name an existing FILE or specify SIZE in MB for a temp disk)
   --swap-disk=FILE|SIZE    Set swap disk file (default: swap.dsk)
 Other options:
   -h, --help               Display this help message.
+Environment variables:
+  PINTOSSIM                Select default simulator.
 EOF
     exit $exitcode;
 }
@@ -381,7 +383,8 @@ log: bochsout.txt
 panic: action=fatal
 EOF
     print BOCHSRC "gdbstub: enabled=1\n" if $debug eq 'gdb';
-    print BOCHSRC "clock: sync=", $realtime ? 'realtime' : 'none', "time0=0\n";
+    print BOCHSRC "clock: sync=", $realtime ? 'realtime' : 'none',
+      " time0=0\n";
     print_bochs_disk_line ("ata0-master", 0);
     print_bochs_disk_line ("ata0-slave", 1);
     if (defined ($disks_by_iface[2]{FILENAME})
@@ -446,7 +449,7 @@ sub run_qemu {
        push (@cmd, $option, $disks_by_iface[$iface]{FILENAME})
          if defined $disks_by_iface[$iface]{FILENAME};
     }
-    push (@cmd, '-m', $mem, '-nics', '0');
+    push (@cmd, '-m', $mem);
     push (@cmd, '-nographic') if $vga eq 'none';
     push (@cmd, '-serial', 'stdio') if $serial_out && $vga ne 'none';
     push (@cmd, '-S') if $debug eq 'monitor';