- Timestamp:
- Feb 18, 2009 8:42:18 PM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r16931 r16932 1681 1681 HRESULT rc = S_OK; 1682 1682 1683 ComPtr<IVirtualBox> pVirtualBox(app->mVirtualBox); 1684 1683 1685 // rollback for errors: 1684 1686 // 1) a list of images that we created/imported … … 1726 1728 /* Now that we know the base system get our internal defaults based on that. */ 1727 1729 ComPtr<IGuestOSType> osType; 1728 CHECK_ERROR_THROW( app->mVirtualBox, GetGuestOSType(Bstr(strOsTypeVBox), osType.asOutParam()));1730 CHECK_ERROR_THROW(pVirtualBox, GetGuestOSType(Bstr(strOsTypeVBox), osType.asOutParam())); 1729 1731 1730 1732 /* Create the machine */ … … 1735 1737 tr("Missing VM name")); 1736 1738 const Utf8Str &strNameVBox = vsdeName.front()->strConfig; 1737 CHECK_ERROR_THROW( app->mVirtualBox, CreateMachine(Bstr(strNameVBox), Bstr(strOsTypeVBox),1738 1739 1739 CHECK_ERROR_THROW(pVirtualBox, CreateMachine(Bstr(strNameVBox), Bstr(strOsTypeVBox), 1740 Bstr(), Guid(), 1741 pNewMachine.asOutParam())); 1740 1742 1741 1743 if (!task->progress.isNull()) … … 1889 1891 1890 1892 /* Now its time to register the machine before we add any hard disks */ 1891 CHECK_ERROR_THROW( app->mVirtualBox, RegisterMachine(pNewMachine));1893 CHECK_ERROR_THROW(pVirtualBox, RegisterMachine(pNewMachine)); 1892 1894 1893 1895 Guid newMachineId; … … 1913 1915 /* In order to attach hard disks we need to open a session 1914 1916 * for the new machine */ 1915 CHECK_ERROR_THROW( app->mVirtualBox, OpenSession(session, newMachineId));1917 CHECK_ERROR_THROW(pVirtualBox, OpenSession(session, newMachineId)); 1916 1918 fSessionOpen = true; 1917 1919 … … 1972 1974 srcFormat = L"VMDK"; 1973 1975 /* Create an empty hard disk */ 1974 CHECK_ERROR_THROW( app->mVirtualBox, CreateHardDisk(srcFormat, Bstr(pcszDstFilePath), dstHdVBox.asOutParam()));1976 CHECK_ERROR_THROW(pVirtualBox, CreateHardDisk(srcFormat, Bstr(pcszDstFilePath), dstHdVBox.asOutParam())); 1975 1977 1976 1978 /* Create a dynamic growing disk image with the given capacity */ … … 1998 2000 1999 2001 /* First open the existing disk image */ 2000 CHECK_ERROR_THROW( app->mVirtualBox, OpenHardDisk(Bstr(strSrcFilePath), srcHdVBox.asOutParam()));2002 CHECK_ERROR_THROW(pVirtualBox, OpenHardDisk(Bstr(strSrcFilePath), srcHdVBox.asOutParam())); 2001 2003 fSourceHdNeedsClosing = true; 2002 2004 … … 2005 2007 CHECK_ERROR_THROW(srcHdVBox, COMGETTER(Format)(srcFormat.asOutParam())); 2006 2008 /* Create a new hard disk interface for the destination disk image */ 2007 CHECK_ERROR_THROW( app->mVirtualBox, CreateHardDisk(srcFormat, Bstr(pcszDstFilePath), dstHdVBox.asOutParam()));2009 CHECK_ERROR_THROW(pVirtualBox, CreateHardDisk(srcFormat, Bstr(pcszDstFilePath), dstHdVBox.asOutParam())); 2008 2010 /* Clone the source disk image */ 2009 2011 CHECK_ERROR_THROW(srcHdVBox, CloneTo(dstHdVBox, progress.asOutParam())); … … 2143 2145 { 2144 2146 const MyHardDiskAttachment &mhda = *itM; 2145 rc2 = app->mVirtualBox->OpenSession(session, mhda.uuid);2147 rc2 = pVirtualBox->OpenSession(session, mhda.uuid); 2146 2148 if (SUCCEEDED(rc2)) 2147 2149 { … … 2177 2179 const Guid &guid = *itID; 2178 2180 ComPtr<IMachine> failedMachine; 2179 rc2 = app->mVirtualBox->UnregisterMachine(guid, failedMachine.asOutParam());2181 rc2 = pVirtualBox->UnregisterMachine(guid, failedMachine.asOutParam()); 2180 2182 if (SUCCEEDED(rc2)) 2181 2183 rc2 = failedMachine->DeleteSettings(); -
trunk/src/VBox/Main/include/ApplianceImpl.h
r16931 r16932 83 83 private: 84 84 /** weak VirtualBox parent */ 85 VirtualBox*mVirtualBox;85 const ComObjPtr <VirtualBox, ComWeakRef> mVirtualBox; 86 86 87 87 struct Task; /* Worker thread for import */
Note:
See TracChangeset
for help on using the changeset viewer.