- Timestamp:
- May 27, 2010 6:11:51 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
r29813 r29848 495 495 # to allow sleep interruption 496 496 pass 497 all_stats = ctx[' ifaces'].all_values('GuestStatisticType')497 all_stats = ctx['const'].all_values('GuestStatisticType') 498 498 cpu = 0 499 499 for s in all_stats.keys(): … … 532 532 533 533 def 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")) 535 535 536 536 def ginfo(ctx,console, args): … … 569 569 traceback.print_exc() 570 570 return 571 if session.state != ctx[' ifaces'].SessionState_Open:571 if session.state != ctx['const'].SessionState_Open: 572 572 print "Session to '%s' in wrong state: %s" %(mach.name, session.state) 573 573 session.close() … … 684 684 685 685 def asEnumElem(ctx,enum,elem): 686 all = ctx[' ifaces'].all_values(enum)686 all = ctx['const'].all_values(enum) 687 687 for e in all.keys(): 688 688 if str(elem) == str(all[e]): … … 691 691 692 692 def enumFromString(ctx,enum,str): 693 all = ctx[' ifaces'].all_values(enum)693 all = ctx['const'].all_values(enum) 694 694 return all.get(str, None) 695 695 … … 733 733 print " APIC [BIOSSettings.IOAPICEnabled]: %s" %(asState(bios.IOAPICEnabled)) 734 734 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) 740 740 741 741 print " Hardware 3d acceleration [accelerate3DEnabled]: " + asState(mach.accelerate3DEnabled) … … 778 778 print " HDD:" 779 779 print " Id: %s" %(m.id) 780 print " Location: %s" %( m.location)780 print " Location: %s" %(colPath(ctx,m.location)) 781 781 print " Name: %s" %(m.name) 782 782 print " Format: %s" %(m.format) … … 788 788 print " Name: %s" %(m.name) 789 789 if m.hostDrive: 790 print " Host DVD %s" %( m.location)790 print " Host DVD %s" %(colPath(ctx,m.location)) 791 791 if a.passthrough: 792 792 print " [passthrough mode]" 793 793 else: 794 print " Virtual image at %s" %( m.location)794 print " Virtual image at %s" %(colPath(ctx,m.location)) 795 795 print " Size: %s" %(m.size) 796 796 … … 801 801 print " Name: %s" %(m.name) 802 802 if m.hostDrive: 803 print " Host floppy %s" %( m.location)803 print " Host floppy %s" %(colPath(ctx,m.location)) 804 804 else: 805 print " Virtual image at %s" %( m.location)805 print " Virtual image at %s" %(colPath(ctx,m.location)) 806 806 print " Size: %s" %(m.size) 807 807 … … 996 996 if mach == None: 997 997 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:])) 999 1002 return 0 1000 1003 … … 1083 1086 if mach == None: 1084 1087 return 0 1085 if str(mach.sessionState) != str(ctx[' ifaces'].SessionState_Open):1088 if str(mach.sessionState) != str(ctx['const'].SessionState_Open): 1086 1089 if mach.CPUHotPlugEnabled: 1087 1090 cmdClosedVm(ctx, mach, plugcpu, [True, int(args[2])]) … … 1097 1100 if mach == None: 1098 1101 return 0 1099 if str(mach.sessionState) != str(ctx[' ifaces'].SessionState_Open):1102 if str(mach.sessionState) != str(ctx['const'].SessionState_Open): 1100 1103 if mach.CPUHotPlugEnabled: 1101 1104 cmdClosedVm(ctx, mach, plugcpu, [False, int(args[2])]) … … 1787 1790 progress = hdd.createBaseStorage(size, ctx['global'].constants.MediumVariant_Standard) 1788 1791 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) 1790 1793 else: 1791 1794 print "cannot create disk (file %s exist?)" %(loc) … … 1940 1943 1941 1944 progress = dvd.close() 1942 print "Unregistered ISO at %s" %( dvd.location)1945 print "Unregistered ISO at %s" %(colPath(ctx,dvd.location)) 1943 1946 1944 1947 return 0 … … 1959 1962 progress = dvd.deleteStorage() 1960 1963 if progressBar(ctx,progress): 1961 print "Removed ISO at %s" %( dvd.location)1964 print "Removed ISO at %s" %(colPath(ctx,dvd.location)) 1962 1965 else: 1963 1966 reportError(ctx,progress) … … 2545 2548 ''' 2546 2549 if len(args) == 1: 2547 nictypes = ctx[' ifaces'].all_values('NetworkAdapterType')2550 nictypes = ctx['const'].all_values('NetworkAdapterType') 2548 2551 for n in nictypes.keys(): 2549 2552 if str(adapter.adapterType) == str(nictypes[n]): … … 2551 2554 return (1, None) 2552 2555 else: 2553 nictypes = ctx[' ifaces'].all_values('NetworkAdapterType')2556 nictypes = ctx['const'].all_values('NetworkAdapterType') 2554 2557 if args[1] not in nictypes.keys(): 2555 2558 print '%s not in acceptable values (%s)' % (args[1], nictypes.keys()) … … 2922 2925 'mgr':g_virtualBoxManager.mgr, 2923 2926 'vb':g_virtualBoxManager.vbox, 2924 ' ifaces':g_virtualBoxManager.constants,2927 'const':g_virtualBoxManager.constants, 2925 2928 'remote':g_virtualBoxManager.remote, 2926 2929 'type':g_virtualBoxManager.type,
Note:
See TracChangeset
for help on using the changeset viewer.