Changeset 31014 in vbox
- Timestamp:
- Jul 22, 2010 4:24:56 PM (15 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
r30871 r31014 233 233 perf = ctx['perf'] 234 234 session = mgr.getSessionObject(vb) 235 uuid = mach.id 236 progress = vb.openRemoteSession(session, uuid, type, "") 235 progress = mach.launchVMProcess(session, type, "") 237 236 if progressBar(ctx, progress, 100) and int(progress.resultCode) == 0: 238 237 # we ignore exceptions to allow starting VM even if … … 492 491 vb = ctx['vb'] 493 492 session = ctx['mgr'].getSessionObject(vb) 494 vb.openExistingSession(session, mach.id)493 mach.lockForSession(session, True) 495 494 except Exception,e: 496 495 printErr(ctx, "Session to '%s' not open: %s" %(mach.name,str(e))) … … 498 497 traceback.print_exc() 499 498 return 500 if session.state != ctx['const'].SessionState_ Open:499 if session.state != ctx['const'].SessionState_Locked: 501 500 print "Session to '%s' in wrong state: %s" %(mach.name, session.state) 502 501 session.close() … … 536 535 537 536 def cmdClosedVm(ctx,mach,cmd,args=[],save=True): 538 session = ctx['global'].openMachineSession(mach .id)537 session = ctx['global'].openMachineSession(mach, False) 539 538 mach = session.machine 540 539 try: … … 551 550 552 551 def cmdAnyVm(ctx,mach,cmd, args=[],save=False): 553 session = ctx['global'].openMachineSession(mach .id)552 session = ctx['global'].openMachineSession(mach) 554 553 mach = session.machine 555 554 try: … … 1039 1038 if mach == None: 1040 1039 return 0 1041 if str(mach.sessionState) != str(ctx['const'].SessionState_ Open):1040 if str(mach.sessionState) != str(ctx['const'].SessionState_Locked): 1042 1041 cmdClosedVm(ctx, mach, lambda ctx, mach, a: guestExec (ctx, mach, None, ' '.join(args[2:]))) 1043 1042 else: … … 1129 1128 if mach == None: 1130 1129 return 0 1131 if str(mach.sessionState) != str(ctx['const'].SessionState_ Open):1130 if str(mach.sessionState) != str(ctx['const'].SessionState_Locked): 1132 1131 if mach.CPUHotPlugEnabled: 1133 1132 cmdClosedVm(ctx, mach, plugcpu, [True, int(args[2])]) … … 1143 1142 if mach == None: 1144 1143 return 0 1145 if str(mach.sessionState) != str(ctx['const'].SessionState_ Open):1144 if str(mach.sessionState) != str(ctx['const'].SessionState_Locked): 1146 1145 if mach.CPUHotPlugEnabled: 1147 1146 cmdClosedVm(ctx, mach, plugcpu, [False, int(args[2])]) … … 1348 1347 guestPort = int(args[4]) 1349 1348 proto = "TCP" 1350 session = ctx['global'].openMachineSession(mach .id)1349 session = ctx['global'].openMachineSession(mach) 1351 1350 mach = session.machine 1352 1351 … … 2533 2532 if len(cmdargs) > 1: 2534 2533 rosession = 0 2535 session = ctx['global'].openMachineSession(mach .id);2534 session = ctx['global'].openMachineSession(mach, False); 2536 2535 mach = session.machine; 2537 2536 … … 2710 2709 func = args[3] 2711 2710 session = None 2712 session = ctx['global'].openMachineSession(vm .id)2711 session = ctx['global'].openMachineSession(vm) 2713 2712 vm = session.machine 2714 2713 adapter = vm.getNetworkAdapter(nicnum) -
trunk/src/VBox/Main/glue/vboxapi.py
r30825 r31014 519 519 self.platform.initPerThread() 520 520 521 def openMachineSession(self, mach ineId):521 def openMachineSession(self, mach, permitSharing = True): 522 522 session = self.mgr.getSessionObject(self.vbox) 523 try: 524 self.vbox.openExistingSession(session, machineId) 525 except: 526 self.vbox.openSession(session, machineId) 523 mach.lockForSession(session, permitSharing) 527 524 return session 528 525
Note:
See TracChangeset
for help on using the changeset viewer.