Changeset 67049 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 23, 2017 5:48:32 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 115695
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
r63231 r67049 267 267 vbox = ctx['vb'] 268 268 perf = ctx['perf'] 269 session = ctx['global'].getSessionObject( vbox)269 session = ctx['global'].getSessionObject() 270 270 progress = mach.launchVMProcess(session, vmtype, "") 271 271 if progressBar(ctx, progress, 100) and int(progress.resultCode) == 0: … … 700 700 try: 701 701 vbox = ctx['vb'] 702 session = ctx['global'].getSessionObject(vbox) 703 mach.lockMachine(session, ctx['global'].constants.LockType_Shared) 702 session = ctx['global'].openMachineSession(mach, fPermitSharing=True) 704 703 except Exception as e: 705 704 printErr(ctx, "Session to '%s' not open: %s" % (mach.name, str(e))) … … 747 746 748 747 def cmdClosedVm(ctx, mach, cmd, args=[], save=True): 749 session = ctx['global'].openMachineSession(mach, True)748 session = ctx['global'].openMachineSession(mach, fPermitSharing=True) 750 749 mach = session.machine 751 750 try: … … 767 766 768 767 def cmdAnyVm(ctx, mach, cmd, args=[], save=False): 769 session = ctx['global'].openMachineSession(mach )768 session = ctx['global'].openMachineSession(mach, fPermitSharing=True) 770 769 mach = session.machine 771 770 try: … … 1670 1669 guestPort = int(args[4]) 1671 1670 proto = "TCP" 1672 session = ctx['global'].openMachineSession(mach )1671 session = ctx['global'].openMachineSession(mach, fPermitSharing=True) 1673 1672 mach = session.machine 1674 1673 … … 1879 1878 1880 1879 ctx['wsinfo'] = [url, user, passwd] 1881 vbox = ctx['global'].platform.connect(url, user, passwd) 1882 ctx['vb'] = vbox 1880 ctx['vb'] = ctx['global'].platform.connect(url, user, passwd) 1883 1881 try: 1884 print("Running VirtualBox version %s" % ( vbox.version))1882 print("Running VirtualBox version %s" % (ctx['vb'].version)) 1885 1883 except Exception as e: 1886 1884 printErr(ctx, e) … … 1926 1924 if g_fVerbose: 1927 1925 traceback.print_exc() 1926 ctx['perf'] = ctx['global'].getPerfCollector(ctx['vb']) 1928 1927 return 0 1929 1928 … … 2906 2905 if len(cmdargs) > 1: 2907 2906 rosession = 0 2908 session = ctx['global'].openMachineSession(mach, False)2907 session = ctx['global'].openMachineSession(mach, fPermitSharing=False) 2909 2908 mach = session.machine 2910 2909 … … 3084 3083 func = args[3] 3085 3084 session = None 3086 session = ctx['global'].openMachineSession(vm )3085 session = ctx['global'].openMachineSession(vm, fPermitSharing=True) 3087 3086 vm = session.machine 3088 3087 adapter = vm.getNetworkAdapter(nicnum) … … 3540 3539 asLocations = [ os.getcwd(), ] 3541 3540 try: sScriptDir = os.path.dirname(os.path.abspath(__file__)) 3542 except: pass ;# In case __file__ isn't there.3541 except: pass # In case __file__ isn't there. 3543 3542 else: 3544 3543 if platform.system() in [ 'SunOS', ]: … … 3584 3583 ctx = { 3585 3584 'global': oVBoxMgr, 3586 'vb': oVBoxMgr. vbox,3585 'vb': oVBoxMgr.getVirtualBox(), 3587 3586 'const': oVBoxMgr.constants, 3588 3587 'remote': oVBoxMgr.remote, … … 3605 3604 # 3606 3605 for sKey in list(ctx.keys()): 3607 del ctx[sKey] ;3608 ctx = None ;3609 gc.collect() ;3606 del ctx[sKey] 3607 ctx = None 3608 gc.collect() 3610 3609 3611 3610 oVBoxMgr.deinit()
Note:
See TracChangeset
for help on using the changeset viewer.