diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2022-10-03 13:43:14 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2022-10-03 13:43:14 +0200 |
commit | aa47e92291e85e7d2909e2c0d9083d607f501cc8 (patch) | |
tree | c7a01bdaf3468c0ef1edf39ef98467b7efa4ef03 | |
parent | 3cfd94181841bd9acacc4704a07bf17d899aa103 (diff) |
Omit USB QEMU options if custom options are provided
-rw-r--r-- | bbot/agent/machine.cxx | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/bbot/agent/machine.cxx b/bbot/agent/machine.cxx index 83e64e5..e7f549d 100644 --- a/bbot/agent/machine.cxx +++ b/bbot/agent/machine.cxx @@ -309,10 +309,10 @@ namespace bbot } else { - auto add = [&os] (string o, string v) + auto add = [&os] (string o, optional<string> v = {}) { os.push_back (move (o)); - os.push_back (move (v)); + if (v) os.push_back (move (*v)); }; // Network. @@ -334,6 +334,17 @@ namespace bbot //"-drive", "if=none,id=disk0,format=raw,file=disk.img" //"-device", "virtio-scsi-pci,id=scsi" //"-device", "scsi-hd,drive=disk0" + + // USB settings. + // + // These options should make graphical VMs usable from VNC. + // + // Note that the "standard" USB bus may not be available on + // architectures other than x86 (e.g., aarch64). + // + add ("-usb"); + add ("-device", "usb-kbd"); + add ("-device", "usb-tablet"); } // Setup QMP (QEMU Machine Protocol) monitor to act as a log. @@ -388,12 +399,6 @@ namespace bbot "-global", "kvm-pit.lost_tick_policy=discard", #endif - // USB settings. - // - // This option should make graphical VMs usable from VNC. - // - "-usb", "-device", "usb-kbd", "-device", "usb-tablet", - // These can override the above but not below. // os, |