VirtualBox

Changeset 29848 in vbox for trunk


Ignore:
Timestamp:
May 27, 2010 6:11:51 PM (15 years ago)
Author:
vboxsync
Message:

vboxshell: small bits

File:
1 edited

Legend:

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

    r29813 r29848  
    495495            # to allow sleep interruption
    496496            pass
    497     all_stats = ctx['ifaces'].all_values('GuestStatisticType')
     497    all_stats = ctx['const'].all_values('GuestStatisticType')
    498498    cpu = 0
    499499    for s in all_stats.keys():
     
    532532
    533533def printSf(ctx,sf):
    534     print "    name=%s host=%s %s %s" %(sf.name, sf.hostPath, cond(sf.accessible, "accessible", "not accessible"), cond(sf.writable, "writable", "read-only"))
     534    print "    name=%s host=%s %s %s" %(sf.name, colPath(ctx,sf.hostPath), cond(sf.accessible, "accessible", "not accessible"), cond(sf.writable, "writable", "read-only"))
    535535
    536536def ginfo(ctx,console, args):
     
    569569            traceback.print_exc()
    570570        return
    571     if session.state != ctx['ifaces'].SessionState_Open:
     571    if session.state != ctx['const'].SessionState_Open:
    572572        print "Session to '%s' in wrong state: %s" %(mach.name, session.state)
    573573        session.close()
     
    684684
    685685def asEnumElem(ctx,enum,elem):
    686     all = ctx['ifaces'].all_values(enum)
     686    all = ctx['const'].all_values(enum)
    687687    for e in all.keys():
    688688        if str(elem) == str(all[e]):
     
    691691
    692692def enumFromString(ctx,enum,str):
    693     all = ctx['ifaces'].all_values(enum)
     693    all = ctx['const'].all_values(enum)
    694694    return all.get(str, None)
    695695
     
    733733    print "  APIC [BIOSSettings.IOAPICEnabled]: %s" %(asState(bios.IOAPICEnabled))
    734734    hwVirtEnabled = mach.getHWVirtExProperty(ctx['global'].constants.HWVirtExPropertyType_Enabled)
    735     print "  Hardware virtualization [mach.setHWVirtExProperty(ctx['global'].constants.HWVirtExPropertyType_Enabled,value)]: " + asState(hwVirtEnabled)
    736     hwVirtVPID = mach.getHWVirtExProperty(ctx['global'].constants.HWVirtExPropertyType_VPID)
    737     print "  VPID support [mach.setHWVirtExProperty(ctx['global'].constants.HWVirtExPropertyType_VPID,value)]: " + asState(hwVirtVPID)
    738     hwVirtNestedPaging = mach.getHWVirtExProperty(ctx['global'].constants.HWVirtExPropertyType_NestedPaging)
    739     print "  Nested paging [mach.setHWVirtExProperty(ctx['global'].constants.HWVirtExPropertyType_NestedPaging,value)]: " + asState(hwVirtNestedPaging)
     735    print "  Hardware virtualization [guest win machine.setHWVirtExProperty(ctx[\\'const\\'].HWVirtExPropertyType_Enabled,value)]: " + asState(hwVirtEnabled)
     736    hwVirtVPID = mach.getHWVirtExProperty(ctx['const'].HWVirtExPropertyType_VPID)
     737    print "  VPID support [guest win machine.setHWVirtExProperty(ctx[\\'const\\'].HWVirtExPropertyType_VPID,value)]: " + asState(hwVirtVPID)
     738    hwVirtNestedPaging = mach.getHWVirtExProperty(ctx['const'].HWVirtExPropertyType_NestedPaging)
     739    print "  Nested paging [guest win machine.setHWVirtExProperty(ctx[\\'const\\'].HWVirtExPropertyType_NestedPaging,value)]: " + asState(hwVirtNestedPaging)
    740740
    741741    print "  Hardware 3d acceleration [accelerate3DEnabled]: " + asState(mach.accelerate3DEnabled)
     
    778778            print "   HDD:"
    779779            print "    Id: %s" %(m.id)
    780             print "    Location: %s" %(m.location)
     780            print "    Location: %s" %(colPath(ctx,m.location))
    781781            print "    Name: %s"  %(m.name)
    782782            print "    Format: %s"  %(m.format)
     
    788788                print "    Name: %s" %(m.name)
    789789                if m.hostDrive:
    790                     print "    Host DVD %s" %(m.location)
     790                    print "    Host DVD %s" %(colPath(ctx,m.location))
    791791                    if a.passthrough:
    792792                         print "    [passthrough mode]"
    793793                else:
    794                     print "    Virtual image at %s" %(m.location)
     794                    print "    Virtual image at %s" %(colPath(ctx,m.location))
    795795                    print "    Size: %s" %(m.size)
    796796
     
    801801                print "    Name: %s" %(m.name)
    802802                if m.hostDrive:
    803                     print "    Host floppy %s" %(m.location)
     803                    print "    Host floppy %s" %(colPath(ctx,m.location))
    804804                else:
    805                     print "    Virtual image at %s" %(m.location)
     805                    print "    Virtual image at %s" %(colPath(ctx,m.location))
    806806                    print "    Size: %s" %(m.size)
    807807
     
    996996    if mach == None:
    997997        return 0
    998     cmdExistingVm(ctx, mach, 'guest', ' '.join(args[2:]))
     998    if str(mach.sessionState) != str(ctx['const'].SessionState_Open):
     999        cmdClosedVm(ctx, mach, lambda ctx, mach, a: guestExec (ctx, mach, None, ' '.join(args[2:])))
     1000    else:
     1001        cmdExistingVm(ctx, mach, 'guest', ' '.join(args[2:]))
    9991002    return 0
    10001003
     
    10831086    if mach == None:
    10841087        return 0
    1085     if str(mach.sessionState) != str(ctx['ifaces'].SessionState_Open):
     1088    if str(mach.sessionState) != str(ctx['const'].SessionState_Open):
    10861089        if mach.CPUHotPlugEnabled:
    10871090            cmdClosedVm(ctx, mach, plugcpu, [True, int(args[2])])
     
    10971100    if mach == None:
    10981101        return 0
    1099     if str(mach.sessionState) != str(ctx['ifaces'].SessionState_Open):
     1102    if str(mach.sessionState) != str(ctx['const'].SessionState_Open):
    11001103        if mach.CPUHotPlugEnabled:
    11011104            cmdClosedVm(ctx, mach, plugcpu, [False, int(args[2])])
     
    17871790   progress = hdd.createBaseStorage(size, ctx['global'].constants.MediumVariant_Standard)
    17881791   if progressBar(ctx,progress) and hdd.id:
    1789        print "created HDD at %s as %s" %(hdd.location, hdd.id)
     1792       print "created HDD at %s as %s" %(colPath(ctx,hdd.location), hdd.id)
    17901793   else:
    17911794      print "cannot create disk (file %s exist?)" %(loc)
     
    19401943
    19411944   progress = dvd.close()
    1942    print "Unregistered ISO at %s" %(dvd.location)
     1945   print "Unregistered ISO at %s" %(colPath(ctx,dvd.location))
    19431946
    19441947   return 0
     
    19591962   progress = dvd.deleteStorage()
    19601963   if progressBar(ctx,progress):
    1961        print "Removed ISO at %s" %(dvd.location)
     1964       print "Removed ISO at %s" %(colPath(ctx,dvd.location))
    19621965   else:
    19631966       reportError(ctx,progress)
     
    25452548    '''
    25462549    if len(args) == 1:
    2547         nictypes = ctx['ifaces'].all_values('NetworkAdapterType')
     2550        nictypes = ctx['const'].all_values('NetworkAdapterType')
    25482551        for n in nictypes.keys():
    25492552            if str(adapter.adapterType) == str(nictypes[n]):
     
    25512554        return (1, None)
    25522555    else:
    2553         nictypes = ctx['ifaces'].all_values('NetworkAdapterType')
     2556        nictypes = ctx['const'].all_values('NetworkAdapterType')
    25542557        if args[1] not in nictypes.keys():
    25552558            print '%s not in acceptable values (%s)' % (args[1], nictypes.keys())
     
    29222925           'mgr':g_virtualBoxManager.mgr,
    29232926           'vb':g_virtualBoxManager.vbox,
    2924            'ifaces':g_virtualBoxManager.constants,
     2927           'const':g_virtualBoxManager.constants,
    29252928           'remote':g_virtualBoxManager.remote,
    29262929           'type':g_virtualBoxManager.type,
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