From 36f311912372be3150633b4da0f344c70e456d55 Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Wed, 31 Jul 2019 17:54:40 +0200 Subject: More helpful error message when running qemu Signed-off-by: Laurent Bonnans --- scripts/qemucommand.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts/qemucommand.py') diff --git a/scripts/qemucommand.py b/scripts/qemucommand.py index 3045b45..6f744e2 100644 --- a/scripts/qemucommand.py +++ b/scripts/qemucommand.py @@ -1,4 +1,4 @@ -from os.path import exists, join, realpath, abspath +from os.path import exists, isdir, join, realpath, abspath from os import listdir import random import socket @@ -42,6 +42,8 @@ class QemuCommand(object): if args.machine: self.machine = args.machine else: + if not isdir(args.dir): + raise ValueError("Directory %s does not exist, please specify a --machine or a valid images directory" % args.dir) machines = listdir(args.dir) if len(machines) == 1: self.machine = machines[0] -- cgit v1.2.3-54-g00ecf From c6ad1d288b8f930bbc3fa6de9e102209e3304c66 Mon Sep 17 00:00:00 2001 From: Eugene Smirnov Date: Tue, 6 Aug 2019 12:31:36 +0200 Subject: qemucommand.py: redirect qemu monitor to null chardev By default qemu monitor gets attached to stdio, and that interferes with the test output. We also don't need vga options in nographic mode. Signed-off-by: Eugene Smirnov --- scripts/qemucommand.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'scripts/qemucommand.py') diff --git a/scripts/qemucommand.py b/scripts/qemucommand.py index 6f744e2..a869d4d 100644 --- a/scripts/qemucommand.py +++ b/scripts/qemucommand.py @@ -102,12 +102,8 @@ class QemuCommand(object): cmdline += [ "-serial", "tcp:127.0.0.1:%d,server,nowait" % self.serial_port, "-m", self.mem, - "-usb", "-object", "rng-random,id=rng0,filename=/dev/urandom", "-device", "virtio-rng-pci,rng=rng0", - "-device", "usb-tablet", - "-show-cursor", - "-vga", "std", "-net", netuser, "-net", "nic,macaddr=%s" % self.mac_address ] @@ -119,9 +115,17 @@ class QemuCommand(object): '-device', 'e1000,netdev=vlan1,mac='+random_mac(), ] if self.gui: - cmdline += ["-serial", "stdio"] + cmdline += [ + "-usb", + "-device", "usb-tablet", + "-show-cursor", + "-vga", "std" + ] else: - cmdline.append('-nographic') + cmdline += [ + "-nographic", + "-monitor", "null", + ] if self.kvm: cmdline += ['-enable-kvm', '-cpu', 'host'] else: -- cgit v1.2.3-54-g00ecf