import subprocess, time, os, re, argparse, json
from pathlib import PurePosixPath
+import logging
+
+logger = logging.getLogger("auto_qemu")
g_lookup = {}
d_ro = get_config(disk, "ro", default=False)
d_fmt = get_config(disk, "format", default="raw")
d_id = f"disk_{i}"
+
+ if not os.path.exists(d_img):
+ logger.warning(f"AHCI bus: {d_img} not exists, disk skipped")
+ continue
cmds += [
"-drive", join_attrs([
def get_qemu_general_opts(self):
return [
"-m", get_config(self._opt, "memory", required=True),
- "-smp", get_config(self._opt, "ncpu", default=1)
+ "-smp", str(get_config(self._opt, "ncpu", default=1))
]
def add_peripheral(self, peripheral):
qemu_path = os.path.join(qemu_dir_override, qemu_path)
cmds = [
qemu_path,
+ *self.get_qemu_general_opts(),
*self.get_qemu_arch_opts(),
*self.get_qemu_debug_opts()
]
q.start(arg_opt.qemu_dir)
if __name__ == "__main__":
- try:
- main()
- except Exception as e:
- print(e)
\ No newline at end of file
+ main()
\ No newline at end of file