Changeset 23599 in vbox
- Timestamp:
- Oct 7, 2009 5:24:18 PM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r23585 r23599 155 155 156 156 mNameSync = TRUE; 157 mLiveMigrationTarget = FALSE; 158 mLiveMigrationPort = 0; 157 159 158 160 /* mName, mOSTypeId, mSnapshotFolder, mSnapshotFolderFull are initialized in … … 1817 1819 mHWData->mGuestPropertyNotificationPatterns.cloneTo(aPatterns); 1818 1820 1819 return RT_LIKELY (aPatterns != NULL) ? S_OK : E_OUTOFMEMORY; 1821 return RT_LIKELY (aPatterns != NULL) ? S_OK : E_OUTOFMEMORY; /** @todo r=bird: this is wrong... :-) */ 1820 1822 } 1821 1823 … … 1854 1856 return S_OK; 1855 1857 } 1858 1859 STDMETHODIMP 1860 Machine::COMGETTER(LiveMigrationTarget)(BOOL *aEnabled) 1861 { 1862 CheckComArgOutPointerValid(aEnabled); 1863 1864 AutoCaller autoCaller(this); 1865 CheckComRCReturnRC(autoCaller.rc()); 1866 1867 AutoReadLock alock(this); 1868 1869 *aEnabled = mUserData->mLiveMigrationTarget; 1870 1871 return S_OK; 1872 } 1873 1874 STDMETHODIMP 1875 Machine::COMSETTER(LiveMigrationTarget)(BOOL aEnabled) 1876 { 1877 AutoCaller autoCaller(this); 1878 CheckComRCReturnRC(autoCaller.rc()); 1879 1880 AutoWriteLock alock(this); 1881 1882 /* Only allow it to be set to true when PoweredOff. 1883 (Clearing it is always permitted.) */ 1884 if ( aEnabled 1885 && mData->mRegistered 1886 && ( mType != IsSessionMachine 1887 || mData->mMachineState > MachineState_PoweredOff) 1888 ) 1889 return setError(VBOX_E_INVALID_VM_STATE, 1890 tr("The machine is not powered off (state is %d)"), 1891 mData->mMachineState); 1892 1893 mUserData.backup(); 1894 mUserData->mLiveMigrationTarget = aEnabled; 1895 1896 return S_OK; 1897 } 1898 1899 STDMETHODIMP 1900 Machine::COMGETTER(LiveMigrationPort)(ULONG *aPort) 1901 { 1902 CheckComArgOutPointerValid(aPort); 1903 1904 AutoCaller autoCaller(this); 1905 CheckComRCReturnRC(autoCaller.rc()); 1906 1907 AutoReadLock alock(this); 1908 1909 *aPort = mUserData->mLiveMigrationPort; 1910 1911 return S_OK; 1912 } 1913 1914 STDMETHODIMP 1915 Machine::COMSETTER(LiveMigrationPort)(ULONG aPort) 1916 { 1917 if (aPort >= _64K) 1918 return setError(E_INVALIDARG, tr("Invalid port number %d"), aPort); 1919 1920 AutoCaller autoCaller(this); 1921 CheckComRCReturnRC(autoCaller.rc()); 1922 1923 AutoWriteLock alock(this); 1924 1925 HRESULT rc = checkStateDependency(MutableStateDep); 1926 CheckComRCReturnRC(rc); 1927 1928 mUserData.backup(); 1929 mUserData->mLiveMigrationPort = aPort; 1930 1931 return S_OK; 1932 } 1933 1934 STDMETHODIMP 1935 Machine::COMGETTER(LiveMigrationPassword)(BSTR *aPassword) 1936 { 1937 CheckComArgOutPointerValid(aPassword); 1938 1939 AutoCaller autoCaller(this); 1940 CheckComRCReturnRC(autoCaller.rc()); 1941 1942 AutoReadLock alock(this); 1943 1944 mUserData->mLiveMigrationPassword.cloneTo(aPassword); 1945 1946 return S_OK; 1947 } 1948 1949 STDMETHODIMP 1950 Machine::COMSETTER(LiveMigrationPassword)(IN_BSTR aPassword) 1951 { 1952 AutoCaller autoCaller(this); 1953 CheckComRCReturnRC(autoCaller.rc()); 1954 1955 AutoWriteLock alock(this); 1956 1957 HRESULT rc = checkStateDependency(MutableStateDep); 1958 CheckComRCReturnRC(rc); 1959 1960 mUserData.backup(); 1961 mUserData->mLiveMigrationPassword = aPassword; 1962 1963 return S_OK; 1964 } 1965 1856 1966 1857 1967 // IMachine methods … … 4922 5032 mData->mLastStateChange = mData->m_pMachineConfigFile->timeLastStateChange; 4923 5033 5034 /** @todo LiveMigration: Load LiveMigration properties here. */ 4924 5035 /* 4925 5036 * note: all mUserData members must be assigned prior this point because … … 5911 6022 mData->m_pMachineConfigFile->timeLastStateChange = mData->mLastStateChange; 5912 6023 mData->m_pMachineConfigFile->fAborted = (mData->mMachineState == MachineState_Aborted); 6024 /** @todo LiveMigration: Save LiveMigration properties here. */ 5913 6025 5914 6026 rc = saveHardware(mData->m_pMachineConfigFile->hardwareMachine); -
trunk/src/VBox/Main/Makefile.kmk
r23537 r23599 598 598 ConsoleImpl.cpp \ 599 599 ConsoleImpl2.cpp \ 600 ConsoleImpl-LiveMigration.cpp \ 600 601 ConsoleVRDPServer.cpp \ 601 602 GuestImpl.cpp \ -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r23567 r23599 4002 4002 <interface 4003 4003 name="IMachine" extends="$unknown" 4004 uuid=" 445ecfcc-8ebd-a2a5-459c-4d21ae0b206b"4004 uuid="160b0ccc-c3d6-4c1b-bbe9-39b1a732f833" 4005 4005 wsmap="managed" 4006 4006 > … … 4491 4491 </attribute> 4492 4492 4493 <attribute name="liveMigrationTarget" type="boolean"> 4494 <desc> 4495 When set to @a true, the virtual machine becomes a live migration 4496 target. This can only set to @a true when the VM is in the @a 4497 PoweredOff state. 4498 4499 This property is automatically set to @a false when the VM is powered 4500 on. 4501 </desc> 4502 </attribute> 4503 4504 <attribute name="liveMigrationPort" type="unsigned long"> 4505 <desc> 4506 The TCP port used for live migration. This can only be set when the 4507 VM is in the @a PoweredOff state. 4508 4509 0 means the port is automatically selected and the source machine will 4510 have to be told where to connected after the destination has been 4511 started. 4512 </desc> 4513 </attribute> 4514 4515 <attribute name="liveMigrationPassword" type="wstring"> 4516 <desc> 4517 The password the live migration target will check for. 4518 </desc> 4519 </attribute> 4520 4493 4521 <method name="setBootOrder"> 4494 4522 <desc> … … 5913 5941 <interface 5914 5942 name="IConsole" extends="$unknown" 5915 uuid=" 0a51994b-cbc6-4686-94eb-d4e4023280e2"5943 uuid="c47486e1-3d99-4212-b1c5-86451978999d" 5916 5944 wsmap="managed" 5917 5945 > … … 6646 6674 </result> 6647 6675 </desc> 6676 <param name="progress" type="IProgress" dir="return"> 6677 <desc>Progress object to track the operation completion.</desc> 6678 </param> 6679 </method> 6680 6681 <method name="migrate"> 6682 <desc> 6683 Migrate the VM to a different host machine. 6684 6685 TODO explain the details. 6686 6687 <result name="VBOX_E_INVALID_VM_STATE"> 6688 Virtual machine not running or paused. 6689 </result> 6690 </desc> 6691 <param name="hostname" type="wstring" dir="in"> 6692 <desc>The name or IP of the host to migrate to.</desc> 6693 </param> 6694 <param name="port" type="unsigned long" dir="in"> 6695 <desc>The TCP port to connect to (1..65535).</desc> 6696 </param> 6697 <param name="password" type="wstring" dir="in"> 6698 <desc>The password.</desc> 6699 </param> 6648 6700 <param name="progress" type="IProgress" dir="return"> 6649 6701 <desc>Progress object to track the operation completion.</desc> -
trunk/src/VBox/Main/include/ConsoleImpl.h
r23419 r23599 147 147 STDMETHOD(DiscardCurrentState) (IProgress **aProgress); 148 148 STDMETHOD(DiscardCurrentSnapshotAndState) (IProgress **aProgress); 149 STDMETHOD(Migrate)(IN_BSTR aHostname, ULONG aPort, IN_BSTR aPassword, IProgress **aProgress); 149 150 STDMETHOD(RegisterCallback) (IConsoleCallback *aCallback); 150 151 STDMETHOD(UnregisterCallback)(IConsoleCallback *aCallback); -
trunk/src/VBox/Main/include/MachineImpl.h
r23223 r23599 233 233 mDescription == that.mDescription && 234 234 mOSTypeId == that.mOSTypeId && 235 mSnapshotFolderFull == that.mSnapshotFolderFull); 235 mSnapshotFolderFull == that.mSnapshotFolderFull && 236 mLiveMigrationTarget == that.mLiveMigrationTarget && 237 mLiveMigrationPort == that.mLiveMigrationPort && 238 mLiveMigrationPassword == that.mLiveMigrationPassword); 236 239 } 237 240 … … 242 245 Bstr mSnapshotFolder; 243 246 Bstr mSnapshotFolderFull; 247 BOOL mLiveMigrationTarget; 248 ULONG mLiveMigrationPort; 249 Bstr mLiveMigrationPassword; 244 250 }; 245 251 … … 560 566 STDMETHOD(COMSETTER(GuestPropertyNotificationPatterns))(IN_BSTR aPattern); 561 567 STDMETHOD(COMGETTER(StorageControllers))(ComSafeArrayOut(IStorageController *, aStorageControllers)); 568 STDMETHOD(COMGETTER(LiveMigrationTarget))(BOOL *aEnabled); 569 STDMETHOD(COMSETTER(LiveMigrationTarget))(BOOL aEnabled); 570 STDMETHOD(COMGETTER(LiveMigrationPort))(ULONG *aPort); 571 STDMETHOD(COMSETTER(LiveMigrationPort))(ULONG aPort); 572 STDMETHOD(COMGETTER(LiveMigrationPassword))(BSTR *aPassword); 573 STDMETHOD(COMSETTER(LiveMigrationPassword))(IN_BSTR aPassword); 562 574 563 575 // IMachine methods
Note:
See TracChangeset
for help on using the changeset viewer.