Changeset 42178 in vbox for trunk/src/VBox
- Timestamp:
- Jul 17, 2012 12:35:07 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 79176
- Location:
- trunk/src/VBox
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r42176 r42178 591 591 " websrvauthlibrary default|null|<library> |\n" 592 592 " vrdeextpack null|<library> |\n" 593 " autostartdbpath null|<folder> |\n" 593 594 " loghistorycount <value>\n" 594 595 "\n"); -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
r42176 r42178 857 857 CHECK_ERROR(systemProperties, COMSETTER(LogHistoryCount)(uVal)); 858 858 } 859 else if (!strcmp(a->argv[0], "autostartdbpath")) 860 { 861 /* disable? */ 862 if (!strcmp(a->argv[1], "null")) 863 CHECK_ERROR(systemProperties, COMSETTER(AutostartDatabasePath)(NULL)); 864 else 865 CHECK_ERROR(systemProperties, COMSETTER(AutostartDatabasePath)(Bstr(a->argv[1]).raw())); 866 } 859 867 else 860 868 return errorSyntax(USAGE_SETPROPERTY, "Invalid parameter '%s'", a->argv[0]); -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r42176 r42178 7981 7981 name="ISystemProperties" 7982 7982 extends="$unknown" 7983 uuid=" 8a0ab9ab-48c1-4d04-954b-4a751413d084"7983 uuid="20fc263c-e1e9-4e86-b9b0-835950790d13" 7984 7984 wsmap="managed" 7985 7985 > … … 8231 8231 </attribute> 8232 8232 8233 <attribute name="autostartDatabasePath" type="wstring"> 8234 <desc> 8235 The path to the autostart database. Depending on the host this might 8236 be a filesystem path or something else. 8237 </desc> 8238 </attribute> 8233 8239 8234 8240 <method name="getMaxNetworkAdapters"> -
trunk/src/VBox/Main/include/AutostartDb.h
r41999 r42178 30 30 31 31 /** 32 * Sets the path to the autostart database. 33 * 34 * @returns VBox status code. 35 * @param pszAutostartDbPathNew Path to the autostart database. 36 */ 37 int setAutostartDbPath(const char *pszAutostartDbPathNew); 38 39 /** 32 40 * Add a autostart VM to the global database. 33 41 * 34 42 * @returns VBox status code. 43 * @retval VERR_PATH_NOT_FOUND if the autostart database directory is not set. 35 44 * @param pszVMId ID of the VM to add. 36 45 */ … … 41 50 * 42 51 * @returns VBox status code. 52 * @retval VERR_PATH_NOT_FOUND if the autostart database directory is not set. 43 53 * @param pszVMId ID of the VM to remove. 44 54 */ … … 49 59 * 50 60 * @returns VBox status code. 61 * @retval VERR_PATH_NOT_FOUND if the autostart database directory is not set. 51 62 * @param pszVMId ID of the VM to add. 52 63 */ … … 57 68 * 58 69 * @returns VBox status code. 70 * @retval VERR_PATH_NOT_FOUND if the autostart database directory is not set. 59 71 * @param pszVMId ID of the VM to remove. 60 72 */ … … 66 78 /** Critical section protecting the database against concurrent access. */ 67 79 RTCRITSECT CritSect; 80 /** Path to the autostart database. */ 81 char *m_pszAutostartDbPath; 82 83 /** 84 * Autostart database modification worker. 85 * 86 * @returns VBox status code. 87 * @param fAutostart Flag whether the autostart or autostop database is modified. 88 * @param fAddVM Flag whether a VM is added or removed from the database. 89 */ 90 int autostartModifyDb(bool fAutostart, bool fAddVM); 68 91 #endif 69 92 }; -
trunk/src/VBox/Main/include/SystemPropertiesImpl.h
r35761 r42178 92 92 STDMETHOD(COMSETTER(LogHistoryCount))(ULONG count); 93 93 STDMETHOD(COMGETTER(DefaultAudioDriver))(AudioDriverType_T *aAudioDriver); 94 STDMETHOD(COMGETTER(AutostartDatabasePath))(BSTR *aAutostartDbPath); 95 STDMETHOD(COMSETTER(AutostartDatabasePath))(IN_BSTR aAutostartDbPath); 94 96 95 97 STDMETHOD(GetMaxNetworkAdapters)(ChipsetType_T aChipset, ULONG *aMaxInstances); … … 124 126 HRESULT setWebServiceAuthLibrary(const Utf8Str &aPath); 125 127 HRESULT setDefaultVRDEExtPack(const Utf8Str &aPath); 128 HRESULT setAutostartDatabasePath(const Utf8Str &aPath); 126 129 127 130 VirtualBox * const mParent; -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r42177 r42178 6640 6640 hrc = setError(VBOX_E_NOT_SUPPORTED, 6641 6641 tr("The VM autostart feature is not supported on this platform")); 6642 else if (vrc == VERR_PATH_NOT_FOUND) 6643 hrc = setError(E_FAIL, 6644 tr("The path to the autostart database is not set")); 6642 6645 else 6643 6646 hrc = setError(E_UNEXPECTED, … … 6728 6731 hrc = setError(VBOX_E_NOT_SUPPORTED, 6729 6732 tr("The VM autostop feature is not supported on this platform")); 6733 else if (vrc == VERR_PATH_NOT_FOUND) 6734 hrc = setError(E_FAIL, 6735 tr("The path to the autostart database is not set")); 6730 6736 else 6731 6737 hrc = setError(E_UNEXPECTED, -
trunk/src/VBox/Main/src-server/SystemPropertiesImpl.cpp
r39248 r42178 26 26 #include "Global.h" 27 27 #include "Logging.h" 28 #include "AutostartDb.h" 28 29 29 30 // generated header … … 918 919 } 919 920 921 STDMETHODIMP SystemProperties::COMGETTER(AutostartDatabasePath)(BSTR *aAutostartDbPath) 922 { 923 CheckComArgOutPointerValid(aAutostartDbPath); 924 925 AutoCaller autoCaller(this); 926 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 927 928 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 929 930 m->strAutostartDatabasePath.cloneTo(aAutostartDbPath); 931 932 return S_OK; 933 } 934 935 STDMETHODIMP SystemProperties::COMSETTER(AutostartDatabasePath)(IN_BSTR aAutostartDbPath) 936 { 937 AutoCaller autoCaller(this); 938 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 939 940 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 941 HRESULT rc = setAutostartDatabasePath(aAutostartDbPath); 942 alock.release(); 943 944 if (SUCCEEDED(rc)) 945 { 946 // VirtualBox::saveSettings() needs vbox write lock 947 AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS); 948 rc = mParent->saveSettings(); 949 } 950 951 return rc; 952 } 953 920 954 // public methods only for internal purposes 921 955 ///////////////////////////////////////////////////////////////////////////// … … 946 980 947 981 m->ulLogHistoryCount = data.ulLogHistoryCount; 982 983 rc = setAutostartDatabasePath(data.strAutostartDatabasePath); 984 if (FAILED(rc)) return rc; 948 985 949 986 return S_OK; … … 1124 1161 return S_OK; 1125 1162 } 1163 1164 HRESULT SystemProperties::setAutostartDatabasePath(const Utf8Str &aPath) 1165 { 1166 HRESULT rc = S_OK; 1167 AutostartDb *autostartDb = this->mParent->getAutostartDb(); 1168 1169 if (!aPath.isEmpty()) 1170 { 1171 /* Update path in the autostart database. */ 1172 int vrc = autostartDb->setAutostartDbPath(aPath.c_str()); 1173 if (RT_SUCCESS(vrc)) 1174 m->strAutostartDatabasePath = aPath; 1175 else 1176 rc = setError(E_FAIL, 1177 tr("Cannot set the autostart database path (%Rrc)"), 1178 vrc); 1179 } 1180 else 1181 { 1182 int vrc = autostartDb->setAutostartDbPath(NULL); 1183 AssertRC(vrc); 1184 m->strAutostartDatabasePath = ""; 1185 } 1186 1187 return rc; 1188 } -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r42177 r42178 423 423 if (FAILED(rc)) throw rc; 424 424 425 /* 426 * Create autostart database object early, because the system properties 427 * might need it. 428 */ 429 unconst(m->pAutostartDb) = new AutostartDb; 430 425 431 /* create the system properties object, someone may need it too */ 426 432 unconst(m->pSystemProperties).createObject(); … … 489 495 throw rc; 490 496 #endif 491 492 unconst(m->pAutostartDb) = new AutostartDb;493 497 } 494 498 catch (HRESULT err)
Note:
See TracChangeset
for help on using the changeset viewer.