On 1/19/23 03:54, Fabiano Rosas wrote:
+        cpu_map = (
+            ('aarch64', 'cortex-a57'),
+        )

This isn't a map...

+        for suffix, cpu in cpu_map:
+            if self.qemu_prog.endswith(f'qemu-system-{suffix}'):
+                self.qemu_options += f' -cpu {cpu}'

... which causes you to use a loop here, instead of a map lookup.

Also, not keen on cortex-a57 vs max, again.

You want something like

    cpu_map = {
        'aarch64': 'max'
    }

    m = re.match('qemu-system-(.*)', self.qemu_prog)
    if m and m.group(1) in cpu_map:
        self.qemu_options += ' -cpu ' + cpu_map[m.group(1)]


My python is rough, so take that with a lot of testing...


r~

Reply via email to