VirtualBox

Changeset 27953 in vbox


Ignore:
Timestamp:
Apr 1, 2010 8:09:40 PM (15 years ago)
Author:
vboxsync
Message:

python shell: bits

File:
1 edited

Legend:

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

    r27952 r27953  
    11#!/usr/bin/python
    22#
    3 # Copyright (C) 2009 Sun Microsystems, Inc.
     3# Copyright (C) 2009-2010 Sun Microsystems, Inc.
    44#
    55# This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020#                                                                               #
    2121# It also provides you with examples on how to use VirtualBox's Python API.     #
    22 # This shell is even somewhat documented and supports TAB-completion and        #
     22# This shell is even somewhat documented, supports TAB-completion and           #
    2323# history if you have Python readline installed.                                #
    2424#                                                                               #
     25# Finally, shell allows arbitrary custom extensions, just create                #
     26# .VirtualBox/shexts/ and drop your extensions there.                           #
    2527#                                                Enjoy.                         #
    2628################################################################################
     
    525527    return 0
    526528
    527 def getControllerType(type):
    528     if type == 0:
    529         return "Null"
    530     elif  type == 1:
    531         return "LsiLogic"
    532     elif type == 2:
    533         return "BusLogic"
    534     elif type == 3:
    535         return "IntelAhci"
    536     elif type == 4:
    537         return "PIIX3"
    538     elif type == 5:
    539         return "PIIX4"
    540     elif type == 6:
    541         return "ICH6"
    542     else:
    543         return "Unknown"
    544 
    545529def asEnumElem(ctx,enum,elem):
    546530    all = ctx['ifaces'].all_values(enum)
     
    589573
    590574    print "  HPET [hpetEnabled]: %s" %(asState(mach.hpetEnabled))
     575    if mach.audioAdapter.enabled:
     576        print "  Audio [via audioAdapter]: chip %s; host driver %s" %(asEnumElem(ctx,"AudioControllerType", mach.audioAdapter.audioController), asEnumElem(ctx,"AudioDriverType",  mach.audioAdapter.audioDriver))
    591577    print "  CPU hotplugging [CPUHotPlugEnabled]: %s" %(asState(mach.CPUHotPlugEnabled))
    592578
     
    601587        print "  Controllers:"
    602588    for controller in controllers:
    603         print "    %s %s bus: %d" % (controller.name, getControllerType(controller.controllerType), controller.bus)
     589        print "    %s %s bus: %d" % (controller.name, asEnumElem(ctx,"StorageControllerType", controller.controllerType), controller.bus)
    604590
    605591    attaches = ctx['global'].getArray(mach, 'mediumAttachments')
     
    13471333            group = False
    13481334            continue
     1335        if ch == 'W':
     1336            # just wait a bit
     1337            time.sleep(0.3)
     1338            continue
    13491339        if  ch == '^' or  ch == '|' or ch == '$' or ch == '_':
    13501340            if ch == '^':
     
    14531443            'gueststats':['Print available guest stats (only Windows guests with additions so far): gueststats Win32', gueststatsCmd, 0],
    14541444            'plugcpu':['Add a CPU to a running VM: plugcpu Win 1', plugcpuCmd, 0],
    1455             'unplugcpu':['Remove a CPU from a running VM: plugcpu Win 1', unplugcpuCmd, 0],
     1445            'unplugcpu':['Remove a CPU from a running VM (additions required, Windows cannot unplug): unplugcpu Linux 1', unplugcpuCmd, 0],
    14561446            }
    14571447
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