Changeset 75819 in vbox for trunk/src/VBox/Main
- Timestamp:
- Nov 29, 2018 4:16:40 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 127022
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r75817 r75819 1791 1791 <interface 1792 1792 name="IDHCPServer" extends="$unknown" 1793 uuid=" 197717d2-a742-4966-a529-d1467e903feb"1793 uuid="ea2d467f-b6c2-4b9a-8eb5-6e2f275dd72e" 1794 1794 wsmap="managed" 1795 1795 reservedMethods="2" reservedAttributes="6" … … 1842 1842 <param name="option" type="DhcpOpt" dir="in"/> 1843 1843 <param name="value" type="wstring" dir="in" /> 1844 </method> 1845 1846 <method name="removeGlobalOption"> 1847 <desc> 1848 removes the specified option 1849 <result name="E_INVALIDARG"> 1850 invalid option id supplied 1851 </result> 1852 </desc> 1853 <param name="option" type="DhcpOpt" dir="in"/> 1854 </method> 1855 1856 <method name="removeGlobalOptions"> 1857 <desc> 1858 removes all global options 1859 <result name="E_FAIL"> 1860 failed to remove global options 1861 </result> 1862 </desc> 1844 1863 </method> 1845 1864 … … 1877 1896 </method> 1878 1897 1898 <method name="removeVmSlotOption"> 1899 <desc> 1900 removes the specified option 1901 <result name="E_INVALIDARG"> 1902 invalid VM, slot, or option id supplied 1903 </result> 1904 </desc> 1905 <param name="vmname" type="wstring" dir="in"/> 1906 <param name="slot" type="long" dir="in"/> 1907 <param name="option" type="DhcpOpt" dir="in"/> 1908 </method> 1909 1879 1910 <method name="removeVmSlotOptions"> 1911 <desc> 1912 removes all option for the specified adapter 1913 <result name="E_INVALIDARG"> 1914 invalid VM or slot supplied 1915 </result> 1916 </desc> 1880 1917 <param name="vmname" type="wstring" dir="in"/> 1881 1918 <param name="slot" type="long" dir="in"/> -
trunk/src/VBox/Main/include/DHCPServerImpl.h
r75648 r75819 116 116 HRESULT addGlobalOption(DhcpOpt_T aOption, 117 117 const com::Utf8Str &aValue); 118 HRESULT removeGlobalOption(DhcpOpt_T aOption); 119 HRESULT removeGlobalOptions(); 118 120 HRESULT addVmSlotOption(const com::Utf8Str &aVmName, 119 121 LONG aSlot, 120 122 DhcpOpt_T aOption, 121 123 const com::Utf8Str &aValue); 124 HRESULT removeVmSlotOption(const com::Utf8Str &aVmName, 125 LONG aSlot, 126 DhcpOpt_T aOption); 122 127 HRESULT removeVmSlotOptions(const com::Utf8Str &aVmName, 123 128 LONG aSlot); -
trunk/src/VBox/Main/src-server/DHCPServerImpl.cpp
r75648 r75819 478 478 479 479 480 HRESULT DHCPServer::removeGlobalOption(DhcpOpt_T aOption) 481 { 482 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 483 484 settings::DhcpOptionMap::size_type cErased = m->GlobalDhcpOptions.erase(aOption); 485 if (!cErased) 486 return E_INVALIDARG; 487 488 alock.release(); 489 490 AutoWriteLock vboxLock(mVirtualBox COMMA_LOCKVAL_SRC_POS); 491 return mVirtualBox->i_saveSettings(); 492 } 493 494 495 HRESULT DHCPServer::removeGlobalOptions() 496 { 497 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 498 m->GlobalDhcpOptions.clear(); 499 500 alock.release(); 501 502 AutoWriteLock vboxLock(mVirtualBox COMMA_LOCKVAL_SRC_POS); 503 return mVirtualBox->i_saveSettings(); 504 } 505 506 480 507 HRESULT DHCPServer::getGlobalOptions(std::vector<com::Utf8Str> &aValues) 481 508 { … … 520 547 int rc = addOption(map, aOption, aValue); 521 548 if (!RT_SUCCESS(rc)) 549 return E_INVALIDARG; 550 551 alock.release(); 552 553 AutoWriteLock vboxLock(mVirtualBox COMMA_LOCKVAL_SRC_POS); 554 return mVirtualBox->i_saveSettings(); 555 } 556 557 558 HRESULT DHCPServer::removeVmSlotOption(const com::Utf8Str &aVmName, LONG aSlot, DhcpOpt_T aOption) 559 { 560 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 561 settings::DhcpOptionMap &map = i_findOptMapByVmNameSlot(aVmName, aSlot); 562 settings::DhcpOptionMap::size_type cErased = map.erase(aOption); 563 if (!cErased) 522 564 return E_INVALIDARG; 523 565
Note:
See TracChangeset
for help on using the changeset viewer.