- Timestamp:
- Oct 29, 2013 10:05:21 PM (11 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ConsoleImpl.h
r49120 r49324 221 221 HRESULT onBandwidthGroupChange(IBandwidthGroup *aBandwidthGroup); 222 222 HRESULT onStorageDeviceChange(IMediumAttachment *aMediumAttachment, BOOL aRemove, BOOL aSilent); 223 HRESULT onExtraDataChange(IN_BSTR aMachineId, IN_BSTR aKey, IN_BSTR aVal); 223 224 224 225 HRESULT getGuestProperty(IN_BSTR aKey, BSTR *aValue, LONG64 *aTimestamp, BSTR *aFlags); -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r49120 r49324 347 347 } 348 348 349 case VBoxEventType_OnExtraDataChanged: 350 { 351 ComPtr<IExtraDataChangedEvent> pEDCEv = aEvent; 352 Bstr strMachineId; 353 Bstr strKey; 354 Bstr strVal; 355 HRESULT hrc = S_OK; 356 357 hrc = pEDCEv->COMGETTER(MachineId)(strMachineId.asOutParam()); 358 if (FAILED(hrc)) break; 359 360 hrc = pEDCEv->COMGETTER(Key)(strKey.asOutParam()); 361 if (FAILED(hrc)) break; 362 363 hrc = pEDCEv->COMGETTER(Value)(strVal.asOutParam()); 364 if (FAILED(hrc)) break; 365 366 mConsole->onExtraDataChange(strMachineId.raw(), strKey.raw(), strVal.raw()); 367 break; 368 } 369 349 370 default: 350 371 AssertFailed(); … … 574 595 eventTypes.push_back(VBoxEventType_OnNATRedirect); 575 596 eventTypes.push_back(VBoxEventType_OnHostPCIDevicePlug); 597 eventTypes.push_back(VBoxEventType_OnExtraDataChanged); 576 598 rc = pES->RegisterListener(aVmListener, ComSafeArrayAsInParam(eventTypes), true); 577 599 AssertComRC(rc); … … 5354 5376 LogFlowThisFunc(("Leaving rc=%#x\n", rc)); 5355 5377 return rc; 5378 } 5379 5380 HRESULT Console::onExtraDataChange(IN_BSTR aMachineId, IN_BSTR aKey, IN_BSTR aVal) 5381 { 5382 LogFlowThisFunc(("\n")); 5383 5384 AutoCaller autoCaller(this); 5385 AssertComRCReturnRC(autoCaller.rc()); 5386 5387 if (!aMachineId) 5388 return S_OK; 5389 5390 HRESULT hrc = S_OK; 5391 Bstr idMachine(aMachineId); 5392 Bstr idSelf; 5393 hrc = mMachine->COMGETTER(Id)(idSelf.asOutParam()); 5394 if ( FAILED(hrc) 5395 || idMachine != idSelf) 5396 return hrc; 5397 5398 /* don't do anything if the VM isn't running */ 5399 SafeVMPtrQuiet ptrVM(this); 5400 if (ptrVM.isOk()) 5401 { 5402 Bstr strKey(aKey); 5403 Bstr strVal(aVal); 5404 5405 if (strKey == "VBoxInternal2/TurnResetIntoPowerOff") 5406 { 5407 int vrc = VMR3SetPowerOffInsteadOfReset(ptrVM.rawUVM(), strVal == "1"); 5408 AssertRC(vrc); 5409 } 5410 5411 ptrVM.release(); 5412 } 5413 5414 /* notify console callbacks on success */ 5415 if (SUCCEEDED(hrc)) 5416 fireExtraDataChangedEvent(mEventSource, aMachineId, aKey, aVal); 5417 5418 LogFlowThisFunc(("Leaving hrc=%#x\n", hrc)); 5419 return hrc; 5356 5420 } 5357 5421 -
trunk/src/VBox/VMM/VMMR3/VMMR3.def
r48982 r49324 358 358 VMR3SetCpuExecutionCap 359 359 VMR3SetError 360 VMR3SetPowerOffInsteadOfReset 360 361 VMR3Suspend 361 362 VMR3Teleport
Note:
See TracChangeset
for help on using the changeset viewer.