Changes in tools/ew.py [7f4937e:3692678] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/ew.py

    r7f4937e r3692678  
    169169        return ' -usb'
    170170
     171def qemu_xhci_options():
     172        if is_override('noxhci'):
     173                return ''
     174        return ' -device nec-usb-xhci,id=xhci'
     175
     176def qemu_tablet_options():
     177        if is_override('notablet') or (is_override('nousb') and is_override('noxhci')):
     178                return ''
     179        return ' -device usb-tablet'
     180
    171181def qemu_audio_options():
    172182        if is_override('nosnd'):
     
    180190
    181191        cmdline = cmd
     192        if 'qemu_path' in overrides.keys():
     193                cmdline = overrides['qemu_path'] + cmd
     194
    182195        if options != '':
    183196                cmdline += ' ' + options
     
    189202        if (not 'usb' in cfg.keys()) or cfg['usb']:
    190203                cmdline += qemu_usb_options()
     204        if (not 'xhci' in cfg.keys()) or cfg['xhci']:
     205                cmdline += qemu_xhci_options()
     206        if (not 'tablet' in cfg.keys()) or cfg['tablet']:
     207                cmdline += qemu_tablet_options()
    191208        if (not 'audio' in cfg.keys()) or cfg['audio']:
    192209                cmdline += qemu_audio_options()
     
    297314def usage():
    298315        print("%s - emulator wrapper for running HelenOS\n" % os.path.basename(sys.argv[0]))
    299         print("%s [-d] [-h] [-net e1k|rtl8139|ne2k] [-nohdd] [-nokvm] [-nonet] [-nosnd] [-nousb]\n" %
     316        print("%s [-d] [-h] [-net e1k|rtl8139|ne2k] [-nohdd] [-nokvm] [-nonet] [-nosnd] [-nousb] [-noxhci] [-notablet]\n" %
    300317            os.path.basename(sys.argv[0]))
    301318        print("-d\tDry run: do not run the emulation, just print the command line.")
     
    306323        print("-nosnd\tDisable sound, if applicable.")
    307324        print("-nousb\tDisable USB support, if applicable.")
     325        print("-noxhci\tDisable XHCI support, if applicable.")
     326        print("-notablet\tDisable USB tablet (use only relative-position PS/2 mouse instead), if applicable.")
    308327
    309328def fail(platform, machine):
     
    313332def run():
    314333        expect_nic = False
     334        expect_qemu = False
    315335
    316336        for i in range(1, len(sys.argv)):
     
    329349                                usage()
    330350                                exit()
     351
     352                if expect_qemu:
     353                        expect_qemu = False
     354                        overrides['qemu_path'] = sys.argv[i]
    331355
    332356                elif sys.argv[i] == '-h':
     
    347371                elif sys.argv[i] == '-nousb':
    348372                        overrides['nousb'] = True
     373                elif sys.argv[i] == '-noxhci':
     374                        overrides['noxhci'] = True
     375                elif sys.argv[i] == '-notablet':
     376                        overrides['notablet'] = True
     377                elif sys.argv[i] == '-qemu_path' and i < len(sys.argv) - 1:
     378                        expect_qemu = True
    349379                else:
    350380                        usage()
Note: See TracChangeset for help on using the changeset viewer.