Changeset 30956 in vbox
- Timestamp:
- Jul 21, 2010 12:59:12 PM (14 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 12 edited
-
Frontends/VBoxManage/VBoxManageMisc.cpp (modified) (1 diff)
-
Frontends/VirtualBox/src/globals/VBoxProblemReporter.cpp (modified) (1 diff)
-
Frontends/VirtualBox/src/globals/VBoxProblemReporter.h (modified) (1 diff)
-
Frontends/VirtualBox/src/selector/VBoxSelectorWnd.cpp (modified) (2 diffs)
-
Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp (modified) (1 diff)
-
Main/ApplianceImplImport.cpp (modified) (1 diff)
-
Main/MachineImpl.cpp (modified) (2 diffs)
-
Main/VirtualBoxImpl.cpp (modified) (2 diffs)
-
Main/idl/VirtualBox.xidl (modified) (9 diffs)
-
Main/include/MachineImpl.h (modified) (2 diffs)
-
Main/include/VirtualBoxImpl.h (modified) (3 diffs)
-
Main/testcase/tstOVF.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
r30929 r30956 159 159 if (machine) 160 160 { 161 Bstr uuid;162 machine->COMGETTER(Id)(uuid.asOutParam());163 machine = NULL;164 161 SafeArray<BSTR> abstrFiles; 165 CHECK_ERROR(a->virtualBox, UnregisterMachine(uuid, 166 false /* fDetachMedia */, 167 ComSafeArrayAsOutParam(abstrFiles), 168 machine.asOutParam())); 169 if (SUCCEEDED(rc) && machine && fDelete) 170 CHECK_ERROR(machine, DeleteSettings()); 162 CHECK_ERROR(machine, Unregister(false /* fDetachMedia */, 163 ComSafeArrayAsOutParam(abstrFiles))); 164 if (SUCCEEDED(rc) && fDelete) 165 CHECK_ERROR(machine, Delete()); 171 166 } 172 167 return SUCCEEDED(rc) ? 0 : 1; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.cpp
r30022 r30956 790 790 } 791 791 792 void VBoxProblemReporter::cannotDeleteMachine (const CVirtualBox &vbox, 793 const CMachine &machine) 792 void VBoxProblemReporter::cannotDeleteMachine(const CMachine &machine) 794 793 { 795 794 /* preserve the current error info before calling the object again */ 796 795 COMResult res (machine); 797 796 798 message (mainWindowShown(), Error,799 tr ("Failed to remove the virtual machine <b>%1</b>.")800 .arg(machine.GetName()),801 !vbox.isOk() ? formatErrorInfo (vbox) : formatErrorInfo(res));797 message(mainWindowShown(), 798 Error, 799 tr("Failed to remove the virtual machine <b>%1</b>.").arg(machine.GetName()), 800 !machine.isOk() ? formatErrorInfo(machine) : formatErrorInfo(res)); 802 801 } 803 802 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.h
r28846 r30956 204 204 void cannotStopMachine (const CConsole &console); 205 205 void cannotStopMachine (const CProgress &progress); 206 void cannotDeleteMachine (const C VirtualBox &vbox, const CMachine &machine);206 void cannotDeleteMachine (const CMachine &machine); 207 207 void cannotDiscardSavedState (const CConsole &console); 208 208 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSelectorWnd.cpp
r30929 r30956 679 679 if (ok) 680 680 { 681 QVector<QString> files; 682 CMachine machine; 683 vbox.UnregisterMachine(id, false /*fDetachMedia*/, files, machine); 684 if (vbox.isOk() && item->accessible()) 681 CMachine machine = item->machine(); 682 QVector<QString> files = machine.Unregister(false /*fDetachMedia*/); 683 if (machine.isOk() && item->accessible()) 685 684 { 686 685 /* delete machine settings */ 687 machine.Delete Settings();686 machine.Delete(); 688 687 /* remove the item shortly: cmachine it refers to is no longer valid! */ 689 688 int row = mVMModel->rowById (item->id()); … … 692 691 mVMListView->ensureSomeRowSelected (row); 693 692 } 694 if (! vbox.isOk() || !machine.isOk())695 vboxProblem().cannotDeleteMachine (vbox,machine);693 if (!machine.isOk()) 694 vboxProblem().cannotDeleteMachine(machine); 696 695 } 697 696 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp
r30929 r30956 782 782 { 783 783 /* Unregister on failure */ 784 QVector<QString> files; 785 CMachine machine; 786 vbox.UnregisterMachine(machineId, false /*fDetachMedia*/, files, machine); 784 QVector<QString> files = m_Machine.Unregister(false /*fDetachMedia*/); 787 785 if (vbox.isOk()) 788 m_Machine.Delete Settings();786 m_Machine.Delete(); 789 787 return false; 790 788 } -
trunk/src/VBox/Main/ApplianceImplImport.cpp
r30929 r30956 1268 1268 ComPtr<IMachine> failedMachine; 1269 1269 SafeArray<BSTR> abstrPaths; 1270 rc2 = mVirtualBox-> UnregisterMachine(bstrGuid, false, ComSafeArrayAsOutParam(abstrPaths), failedMachine.asOutParam());1270 rc2 = mVirtualBox->GetMachine(bstrGuid, failedMachine.asOutParam()); 1271 1271 if (SUCCEEDED(rc2)) 1272 rc2 = failedMachine->DeleteSettings(); 1272 { 1273 rc2 = failedMachine->Unregister(false, ComSafeArrayAsOutParam(abstrPaths)); 1274 rc2 = failedMachine->Delete(); 1275 } 1273 1276 } 1274 1277 } -
trunk/src/VBox/Main/MachineImpl.cpp
r30940 r30956 3687 3687 } 3688 3688 3689 STDMETHODIMP Machine::DeleteSettings() 3689 /** @note Locks objects! */ 3690 STDMETHODIMP Machine::Unregister(BOOL fCloseMedia, 3691 ComSafeArrayOut(BSTR, aFiles)) 3692 { 3693 AutoCaller autoCaller(this); 3694 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 3695 3696 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 3697 3698 MediaList llMedia; 3699 if (mData->mSession.mState != SessionState_Closed) 3700 return setError(VBOX_E_INVALID_OBJECT_STATE, 3701 tr("Cannot unregister the machine '%ls' because it has an open session"), 3702 mUserData->mName.raw()); 3703 3704 // @todo optionally discard saved state 3705 if (mData->mMachineState == MachineState_Saved) 3706 return setError(VBOX_E_INVALID_VM_STATE, 3707 tr("Cannot unregister the machine '%ls' because it is in the Saved state"), 3708 mUserData->mName.raw()); 3709 3710 // @todo optionally nuke snapshots 3711 size_t snapshotCount = 0; 3712 if (mData->mFirstSnapshot) 3713 snapshotCount = mData->mFirstSnapshot->getAllChildrenCount() + 1; 3714 if (snapshotCount) 3715 return setError(VBOX_E_INVALID_OBJECT_STATE, 3716 tr("Cannot unregister the machine '%ls' because it has %d snapshots"), 3717 mUserData->mName.raw(), snapshotCount); 3718 3719 if ( !mMediaData.isNull() // can be NULL if machine is inaccessible 3720 && mMediaData->mAttachments.size() 3721 ) 3722 { 3723 // we have media attachments: 3724 if (fCloseMedia) 3725 { 3726 // caller wants automatic detachment: then do that and report all media to the array 3727 3728 // make a temporary list because detachDevice invalidates iterators into 3729 // mMediaData->mAttachments 3730 MediaData::AttachmentList llAttachments2 = mMediaData->mAttachments; 3731 3732 for (MediaData::AttachmentList::iterator it = llAttachments2.begin(); 3733 it != llAttachments2.end(); 3734 ++it) 3735 { 3736 ComObjPtr<MediumAttachment> pAttach = *it; 3737 ComObjPtr<Medium> pMedium = pAttach->getMedium(); 3738 3739 if (!pMedium.isNull()) 3740 llMedia.push_back(pMedium); 3741 3742 detachDevice(pAttach, 3743 alock, 3744 NULL /* pfNeedsSaveSettings */); 3745 }; 3746 } 3747 else 3748 return setError(VBOX_E_INVALID_OBJECT_STATE, 3749 tr("Cannot unregister the machine '%ls' because it has %d media attachments"), 3750 mMediaData->mAttachments.size()); 3751 } 3752 3753 // commit all the media changes made above 3754 commitMedia(); 3755 3756 mData->mRegistered = false; 3757 3758 // machine lock no longer needed 3759 alock.release(); 3760 3761 if (fCloseMedia) 3762 { 3763 // now go thru the list of attached media reported by prepareUnregister() and close them all 3764 SafeArray<BSTR> sfaFiles(llMedia.size()); 3765 size_t u = 0; 3766 for (MediaList::const_iterator it = llMedia.begin(); 3767 it != llMedia.end(); 3768 ++it) 3769 { 3770 ComObjPtr<Medium> pMedium = *it; 3771 Bstr bstrFile = pMedium->getLocationFull(); 3772 3773 AutoCaller autoCaller2(pMedium); 3774 if (FAILED(autoCaller2.rc())) return autoCaller2.rc(); 3775 3776 pMedium->close(NULL /*fNeedsSaveSettings*/, // we'll call saveSettings() in any case below 3777 autoCaller2); 3778 // this uninitializes the medium 3779 3780 // report the path to the caller 3781 bstrFile.detachTo(&sfaFiles[u]); 3782 ++u; 3783 } 3784 // report all paths to the caller 3785 sfaFiles.detachTo(ComSafeArrayOutArg(aFiles)); 3786 } 3787 3788 mParent->unregisterMachine(this); 3789 3790 return S_OK; 3791 } 3792 3793 STDMETHODIMP Machine::Delete() 3690 3794 { 3691 3795 AutoCaller autoCaller(this); … … 5943 6047 5944 6048 return rc; 5945 }5946 5947 /**5948 * Called from VirtualBox::UnregisterMachine() with the flags given there to5949 * give the machine a chance to clean up for itself.5950 * @param fDetachMedia As passed to VirtualBox::UnregisterMachine(). If true, all5951 * media are detached from the machine and its snapshots.5952 * @param llFiles5953 * @return5954 */5955 HRESULT Machine::prepareUnregister(bool fCloseMedia,5956 MediaList &llMedia)5957 {5958 AutoLimitedCaller autoCaller(this);5959 AssertComRCReturnRC(autoCaller.rc());5960 5961 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);5962 5963 if (mData->mSession.mState != SessionState_Closed)5964 return setError(VBOX_E_INVALID_OBJECT_STATE,5965 tr("Cannot unregister the machine '%ls' because it has an open session"),5966 mUserData->mName.raw());5967 5968 // @todo optionally discard saved state5969 if (mData->mMachineState == MachineState_Saved)5970 return setError(VBOX_E_INVALID_VM_STATE,5971 tr("Cannot unregister the machine '%ls' because it is in the Saved state"),5972 mUserData->mName.raw());5973 5974 // @todo optionally nuke snapshots5975 size_t snapshotCount = 0;5976 if (mData->mFirstSnapshot)5977 snapshotCount = mData->mFirstSnapshot->getAllChildrenCount() + 1;5978 if (snapshotCount)5979 return setError(VBOX_E_INVALID_OBJECT_STATE,5980 tr("Cannot unregister the machine '%ls' because it has %d snapshots"),5981 mUserData->mName.raw(), snapshotCount);5982 5983 if ( !mMediaData.isNull() // can be NULL if machine is inaccessible5984 && mMediaData->mAttachments.size()5985 )5986 {5987 // we have media attachments:5988 if (fCloseMedia)5989 {5990 // caller wants automatic detachment: then do that and report all media to the array5991 5992 // make a temporary list because detachDevice invalidates iterators into5993 // mMediaData->mAttachments5994 MediaData::AttachmentList llAttachments2 = mMediaData->mAttachments;5995 5996 for (MediaData::AttachmentList::iterator it = llAttachments2.begin();5997 it != llAttachments2.end();5998 ++it)5999 {6000 ComObjPtr<MediumAttachment> pAttach = *it;6001 ComObjPtr<Medium> pMedium = pAttach->getMedium();6002 6003 if (!pMedium.isNull())6004 llMedia.push_back(pMedium);6005 6006 detachDevice(pAttach,6007 alock,6008 NULL /* pfNeedsSaveSettings */);6009 };6010 }6011 else6012 return setError(VBOX_E_INVALID_OBJECT_STATE,6013 tr("Cannot unregister the machine '%ls' because it has %d media attachments"),6014 mMediaData->mAttachments.size());6015 }6016 6017 // commit all the media changes made above6018 commitMedia();6019 6020 mData->mRegistered = false;6021 6022 return S_OK;6023 6049 } 6024 6050 -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r30950 r30956 1369 1369 } 1370 1370 1371 /** @note Locks objects! */1372 STDMETHODIMP VirtualBox::UnregisterMachine(IN_BSTR aId,1373 BOOL fCloseMedia,1374 ComSafeArrayOut(BSTR, aFiles),1375 IMachine **aMachine)1376 {1377 Guid id(aId);1378 if (id.isEmpty())1379 return E_INVALIDARG;1380 1381 AutoCaller autoCaller(this);1382 if (FAILED(autoCaller.rc())) return autoCaller.rc();1383 1384 // find machine from the given ID1385 ComObjPtr<Machine> pMachine;1386 HRESULT rc = findMachine(id,1387 true /* fPermitInaccessible */,1388 true /* setError */,1389 &pMachine);1390 if (FAILED(rc)) return rc;1391 1392 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);1393 1394 MediaList llMedia;1395 rc = pMachine->prepareUnregister(fCloseMedia, llMedia);1396 if (FAILED(rc)) return rc;1397 1398 // remove from the collection of registered machines1399 m->allMachines.removeChild(pMachine);1400 1401 if (fCloseMedia)1402 {1403 // now go thru the list of attached media reported by prepareUnregister() and close them all1404 SafeArray<BSTR> sfaFiles(llMedia.size());1405 size_t u = 0;1406 for (MediaList::const_iterator it = llMedia.begin();1407 it != llMedia.end();1408 ++it)1409 {1410 ComObjPtr<Medium> pMedium = *it;1411 Bstr bstrFile = pMedium->getLocationFull();1412 1413 AutoCaller autoCaller2(pMedium);1414 if (FAILED(autoCaller2.rc())) return autoCaller2.rc();1415 1416 pMedium->close(NULL /*fNeedsSaveSettings*/, // we'll call saveSettings() in any case below1417 autoCaller2);1418 // this uninitializes the medium1419 1420 // report the path to the caller1421 bstrFile.detachTo(&sfaFiles[u]);1422 ++u;1423 }1424 // report all paths to the caller1425 sfaFiles.detachTo(ComSafeArrayOutArg(aFiles));1426 }1427 1428 // save the global registry1429 rc = saveSettings();1430 1431 alock.release();1432 1433 /* return the unregistered machine to the caller */1434 pMachine.queryInterfaceTo(aMachine);1435 1436 /* fire an event */1437 onMachineRegistered(id, FALSE);1438 1439 return rc;1440 }1441 1442 1371 STDMETHODIMP VirtualBox::CreateHardDisk(IN_BSTR aFormat, 1443 1372 IN_BSTR aLocation, … … 3823 3752 if (pfNeedsSaveSettings) 3824 3753 *pfNeedsSaveSettings = true; 3754 3755 return rc; 3756 } 3757 3758 /** 3759 * Removes the given machine object from the internal list of registered machines. 3760 * Called from Machine::Unregister(). 3761 * @param pMachine 3762 * @return 3763 */ 3764 HRESULT VirtualBox::unregisterMachine(Machine *pMachine) 3765 { 3766 const Guid &id = pMachine->getId(); 3767 3768 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 3769 3770 // remove from the collection of registered machines 3771 m->allMachines.removeChild(pMachine); 3772 3773 // save the global registry 3774 HRESULT rc = saveSettings(); 3775 3776 alock.release(); 3777 3778 /* fire an event */ 3779 onMachineRegistered(id, FALSE); 3825 3780 3826 3781 return rc; -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r30929 r30956 1105 1105 <interface 1106 1106 name="IVirtualBoxErrorInfo" extends="$errorinfo" 1107 uuid=" 4b86d186-407e-4f9e-8be8-e50061be8725"1107 uuid="e053d3c0-f493-491b-a735-3a9f0b1feed4" 1108 1108 supportsErrorInfo="no" 1109 1109 wsmap="managed" … … 1706 1706 <param name="name" type="wstring" dir="in"/> 1707 1707 <param name="machine" type="IMachine" dir="return"/> 1708 </method>1709 1710 <method name="unregisterMachine">1711 <desc>1712 Unregisters the machine previously registered using1713 <link to="#registerMachine"/>. After successful method invocation, the1714 <link to="IMachineRegisteredEvent"/> event is fired.1715 1716 <note>1717 The specified machine must not be in the Saved state, have an open1718 (or a spawning) direct session associated with it, have snapshots or1719 have any medium attached.1720 </note>1721 1722 <note>1723 This method implicitly calls <link to="IMachine::saveSettings"/> to1724 save all current machine settings before unregistering it.1725 </note>1726 1727 <note>1728 If the given machine is inaccessible (see1729 <link to="IMachine::accessible"/>), it will be unregistered and1730 fully uninitialized right afterwards. As a result, the returned1731 machine object will be unusable and an attempt to call1732 <b>any</b> method will return the "Object not ready" error.1733 </note>1734 1735 <result name="VBOX_E_OBJECT_NOT_FOUND">1736 Could not find registered machine matching @a id.1737 </result>1738 <result name="VBOX_E_INVALID_VM_STATE">1739 Machine is in Saved state.1740 </result>1741 <result name="VBOX_E_INVALID_OBJECT_STATE">1742 Machine has snapshot or open session or medium attached.1743 </result>1744 </desc>1745 1746 <param name="id" type="uuid" mod="string" dir="in">1747 <desc>UUID of the machine to unregister.</desc>1748 </param>1749 <param name="fCloseMedia" type="boolean" dir="in">1750 <desc>If true, the method will automatically detach all media from the1751 machine and its snapshots, call <link to="IMedium::close" /> on each1752 medium, and the paths of all media files involved will be reported to1753 the caller in the @a aFiles array so the caller can then delete the1754 image files.1755 If false, the method will fail if media attachments are present.</desc>1756 </param>1757 <param name="aFiles" type="wstring" safearray="yes" dir="out">1758 <desc>1759 List of all files detached from medium attachments of the machine, if1760 @a fDetachMedia is true.1761 </desc>1762 </param>1763 <param name="machine" type="IMachine" dir="out">1764 <desc>Unregistered machine object.</desc>1765 </param>1766 1708 </method> 1767 1709 … … 3926 3868 <interface 3927 3869 name="IMachine" extends="$unknown" 3928 uuid=" 6d9212cb-a5c0-48b7-bbc1-3fa2ba2ee6d2"3870 uuid="276e0f43-889b-4b87-b05f-35f1db814700" 3929 3871 wsmap="managed" 3930 3872 > … … 3998 3940 The only possible action you can perform on an inaccessible 3999 3941 machine is to unregister it using the 4000 <link to=" IVirtualBox::unregisterMachine"/> call (or, to check3942 <link to="#unregisterMachine"/> call (or, to check 4001 3943 for the accessibility state once more by querying this 4002 3944 property). … … 4269 4211 by <link to="IVirtualBox::openMachine"/> but not 4270 4212 yet registered, or on unregistered machines after calling 4271 <link to=" IVirtualBox::unregisterMachine"/>. For all other4213 <link to="#unregisterMachine"/>. For all other 4272 4214 cases, the settings can never be modified. 4273 4215 </note> … … 5228 5170 created by <link to="IVirtualBox::createMachine"/> but not 5229 5171 yet registered, or on unregistered machines after calling 5230 <link to=" IVirtualBox::unregisterMachine"/>.5172 <link to="#unregisterMachine"/>. 5231 5173 </note> 5232 5174 … … 5255 5197 opened by <link to="IVirtualBox::openMachine"/> but not 5256 5198 yet registered, or on unregistered machines after calling 5257 <link to=" IVirtualBox::unregisterMachine"/>.5199 <link to="#unregisterMachine"/>. 5258 5200 </note> 5259 5201 … … 5265 5207 </method> 5266 5208 5267 <method name="deleteSettings"> 5268 <desc> 5269 Deletes the settings file of this machine from disk. 5270 The machine must not be registered in order for this operation 5271 to succeed. 5209 <method name="unregister"> 5210 <desc> 5211 Unregisters the machine, which must have been previously registered using 5212 <link to="IVirtualBox::registerMachine"/>. After successful method invocation, 5213 the <link to="IMachineRegisteredEvent"/> event is fired. 5214 5215 <note> 5216 The specified machine must not be in the Saved state nor have an open 5217 (or a spawning) direct session associated with it. 5218 </note> 5219 5220 <note> 5221 This method implicitly calls <link to="#saveSettings"/> to 5222 save all current machine settings before unregistering it. 5223 </note> 5224 5225 <note> 5226 If the given machine is inaccessible (see <link to="#accessible"/>), it 5227 will be unregistered and fully uninitialized right afterwards. As a result, 5228 the returned machine object will be unusable and an attempt to call 5229 <b>any</b> method will return the "Object not ready" error. 5230 </note> 5231 5232 <result name="VBOX_E_OBJECT_NOT_FOUND"> 5233 Could not find registered machine matching @a id. 5234 </result> 5235 <result name="VBOX_E_INVALID_VM_STATE"> 5236 Machine is in Saved state. 5237 </result> 5238 <result name="VBOX_E_INVALID_OBJECT_STATE"> 5239 Machine has snapshot or open session or medium attached. 5240 </result> 5241 </desc> 5242 5243 <param name="fCloseMedia" type="boolean" dir="in"> 5244 <desc>If true, the method will automatically detach all media from the 5245 machine and its snapshots, call <link to="IMedium::close" /> on each 5246 medium, and the paths of all media files involved will be reported to 5247 the caller in the @a aFiles array so the caller can then delete the 5248 image files. 5249 If false, the method will fail if media attachments are present.</desc> 5250 </param> 5251 <param name="aFiles" type="wstring" safearray="yes" dir="return"> 5252 <desc> 5253 List of all files detached from medium attachments of the machine, if 5254 @a fCloseMedia is true. 5255 </desc> 5256 </param> 5257 </method> 5258 5259 <method name="delete"> 5260 <desc> 5261 Deletes the settings (machine XML) file of this machine from disk. The machine 5262 must not be registered in order for this operation to succeed. 5272 5263 <note> 5273 5264 <link to="#settingsModified"/> will return @c true after this … … 5280 5271 opened by <link to="IVirtualBox::openMachine"/> but not 5281 5272 yet registered, or on unregistered machines after calling 5282 <link to=" IVirtualBox::unregisterMachine"/>.5273 <link to="#unregisterMachine"/>. 5283 5274 </note> 5284 5275 <note> -
trunk/src/VBox/Main/include/MachineImpl.h
r30940 r30956 481 481 STDMETHOD(SaveSettings)(); 482 482 STDMETHOD(DiscardSettings)(); 483 STDMETHOD(DeleteSettings)(); 483 STDMETHOD(Unregister) (BOOL fCloseMedia, ComSafeArrayOut(BSTR, aFiles)); 484 STDMETHOD(Delete)(); 484 485 STDMETHOD(Export)(IAppliance *aAppliance, IVirtualSystemDescription **aDescription); 485 486 STDMETHOD(GetSnapshot)(IN_BSTR aId, ISnapshot **aSnapshot); … … 683 684 684 685 HRESULT prepareRegister(); 685 HRESULT prepareUnregister(bool fDetachMedia, MediaList &llMedia);686 686 687 687 HRESULT getSharedFolder(CBSTR aName, -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r30938 r30956 128 128 STDMETHOD(GetMachine) (IN_BSTR aId, IMachine **aMachine); 129 129 STDMETHOD(FindMachine) (IN_BSTR aName, IMachine **aMachine); 130 STDMETHOD(UnregisterMachine) (IN_BSTR aId, BOOL fCloseMedia, ComSafeArrayOut(BSTR, aFiles), IMachine **aMachine);131 130 STDMETHOD(CreateAppliance) (IAppliance **anAppliance); 132 131 … … 264 263 HRESULT unregisterImage(Medium *aImage, DeviceType_T argType, bool *pfNeedsSaveSettings); 265 264 265 HRESULT unregisterMachine(Machine *pMachine); 266 266 267 void rememberMachineNameChangeForMedia(const Utf8Str &strOldConfigDir, 267 268 const Utf8Str &strNewConfigDir); … … 288 289 Utf8Str &aConflictType); 289 290 290 HRESULT registerMachine (Machine *aMachine);291 HRESULT registerMachine(Machine *aMachine); 291 292 292 293 HRESULT registerDHCPServer(DHCPServer *aDHCPServer, -
trunk/src/VBox/Main/testcase/tstOVF.cpp
r30931 r30956 350 350 RTPrintf(" Deleting machine %ls...\n", bstrUUID.raw()); 351 351 SafeArray<BSTR> sfaFiles; 352 rc = pVirtualBox->UnregisterMachine(bstrUUID, 353 true /* fDetachMedia */, 354 ComSafeArrayAsOutParam(sfaFiles), 355 pMachine.asOutParam()); 356 if (FAILED(rc)) throw MyError(rc, "VirtualBox::UnregisterMachine() failed\n"); 352 rc = pMachine->Unregister(true /* fDetachMedia */, 353 ComSafeArrayAsOutParam(sfaFiles)); 354 if (FAILED(rc)) throw MyError(rc, "Machine::Unregister() failed\n"); 357 355 358 356 for (size_t u = 0; … … 364 362 } 365 363 366 rc = pMachine->Delete Settings();364 rc = pMachine->Delete(); 367 365 if (FAILED(rc)) throw MyError(rc, "Machine::DeleteSettings() failed\n"); 368 366 }
Note:
See TracChangeset
for help on using the changeset viewer.

