VirtualBox

Changeset 26623 in vbox


Ignore:
Timestamp:
Feb 17, 2010 4:53:27 PM (15 years ago)
Author:
vboxsync
Message:

VBoxShell: Add commands for CPU hot-add/remove

File:
1 edited

Legend:

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

    r26584 r26623  
    407407            pass
    408408
     409def plugCpu(ctx,machine,session,args):
     410    cpu = int(args)
     411    print "Adding CPU %d..." %(cpu)
     412    machine.HotPlugCPU(cpu)
     413
     414def unplugCpu(ctx,machine,session,args):
     415    cpu = int(args)
     416    print "Removing CPU %d..." %(cpu)
     417    machine.HotUnplugCPU(cpu)
     418
    409419def cmdExistingVm(ctx,mach,cmd,args):
    410420    mgr=ctx['mgr']
     
    439449         'teleport':        lambda: teleport(ctx,session,console,args),
    440450         'gueststats':      lambda: guestStats(ctx, console, args),
     451         'plugcpu':         lambda: plugCpu(ctx, session.machine, session, args),
     452         'unplugcpu':       lambda: unplugCpu(ctx, session.machine, session, args),
    441453         }
    442454    try:
     
    783795    return 0
    784796
     797def plugcpuCmd(ctx, args):
     798    if (len(args) < 2):
     799        print "usage: plugcpu name cpuid"
     800        return 0
     801    mach = argsToMach(ctx,args)
     802    if mach == None:
     803        return 0
     804    cmdExistingVm(ctx, mach, 'plugcpu', args[2])
     805    return 0
     806
     807def unplugcpuCmd(ctx, args):
     808    if (len(args) < 2):
     809        print "usage: unplugcpu name cpuid"
     810        return 0
     811    mach = argsToMach(ctx,args)
     812    if mach == None:
     813        return 0
     814    cmdExistingVm(ctx, mach, 'unplugcpu', args[2])
     815    return 0
    785816
    786817def setvarCmd(ctx, args):
     
    11991230            'setextra':['Set extra data, empty value removes key: setextra <vm|global> <key> <value>', setExtraDataCmd, 0],
    12001231            'gueststats':['Print available guest stats (only Windows guests with additions so far): gueststats Win32', gueststatsCmd, 0],
     1232            'plugcpu':['Add a CPU to a running VM: plugcpu Win 1', plugcpuCmd, 0],
     1233            'unplugcpu':['Remove a CPU from a running VM: plugcpu Win 1', unplugcpuCmd, 0],
    12011234            }
    12021235
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