VirtualBox

Changeset 27906 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Mar 31, 2010 2:21:18 PM (15 years ago)
Author:
vboxsync
Message:

vboxshell: handy function for exts to run command with guest

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxShell/vboxshell.py

    r27894 r27906  
    449449         'stats':           lambda: perfStats(ctx, mach),
    450450         'guest':           lambda: guestExec(ctx, mach, console, args),
     451         'guestlambda':     lambda: args[0](ctx, mach, console, args[1:]),
    451452         'monitorGuest':    lambda: monitorGuest(ctx, mach, console, args),
    452453         'save':            lambda: progressBar(ctx,console.saveState()),
     
    12571258            'quit':['Exits', quitCmd, 0],
    12581259            'host':['Show host information', hostCmd, 0],
    1259             'guest':['Execute command for guest: guest Win32 \'console.mouse.putMouseEvent(20, 20, 0, 0)\'', guestCmd, 0],
     1260            'guest':['Execute command for guest: guest Win32 \'console.mouse.putMouseEvent(20, 20, 0, 0, 0)\'', guestCmd, 0],
    12601261            'monitorGuest':['Monitor what happens with the guest for some time: monitorGuest Win32 10', monitorGuestCmd, 0],
    12611262            'monitorVBox':['Monitor what happens with Virtual Box for some time: monitorVBox 10', monitorVBoxCmd, 0],
     
    13971398    return runCommandArgs(ctx, args)
    13981399
     1400def runGuestCommandCb(ctx, id, guestLambda, args):
     1401    mach =  machById(ctx,id)
     1402    if mach == None:
     1403        return 0
     1404    args.insert(0, guestLambda)
     1405    cmdExistingVm(ctx, mach, 'guestlambda', args)
     1406    return 0
     1407
    13991408def main(argv):
    14001409    style = None
     
    14261435           'type':g_virtualBoxManager.type,
    14271436           'run': lambda cmd,args: runCommandCb(ctx, cmd, args),
     1437           'guestlambda': lambda id,guestLambda,args: runGuestCommandCb(ctx, id, guestLambda, args),
    14281438           'machById': lambda id: machById(ctx,id),
    14291439           'argsToMach': lambda args: argsToMach(ctx,args),
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette