VirtualBox

Changeset 16932 in vbox for trunk


Ignore:
Timestamp:
Feb 18, 2009 8:42:18 PM (16 years ago)
Author:
vboxsync
Message:

OVF: try to fix windows burn

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ApplianceImpl.cpp

    r16931 r16932  
    16811681    HRESULT rc = S_OK;
    16821682
     1683    ComPtr<IVirtualBox> pVirtualBox(app->mVirtualBox);
     1684
    16831685    // rollback for errors:
    16841686    // 1) a list of images that we created/imported
     
    17261728            /* Now that we know the base system get our internal defaults based on that. */
    17271729            ComPtr<IGuestOSType> osType;
    1728             CHECK_ERROR_THROW(app->mVirtualBox, GetGuestOSType(Bstr(strOsTypeVBox), osType.asOutParam()));
     1730            CHECK_ERROR_THROW(pVirtualBox, GetGuestOSType(Bstr(strOsTypeVBox), osType.asOutParam()));
    17291731
    17301732            /* Create the machine */
     
    17351737                               tr("Missing VM name"));
    17361738            const Utf8Str &strNameVBox = vsdeName.front()->strConfig;
    1737             CHECK_ERROR_THROW(app->mVirtualBox, CreateMachine(Bstr(strNameVBox), Bstr(strOsTypeVBox),
    1738                                                               Bstr(), Guid(),
    1739                                                               pNewMachine.asOutParam()));
     1739            CHECK_ERROR_THROW(pVirtualBox, CreateMachine(Bstr(strNameVBox), Bstr(strOsTypeVBox),
     1740                                                         Bstr(), Guid(),
     1741                                                         pNewMachine.asOutParam()));
    17401742
    17411743            if (!task->progress.isNull())
     
    18891891
    18901892            /* 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));
    18921894
    18931895            Guid newMachineId;
     
    19131915                    /* In order to attach hard disks we need to open a session
    19141916                     * for the new machine */
    1915                     CHECK_ERROR_THROW(app->mVirtualBox, OpenSession(session, newMachineId));
     1917                    CHECK_ERROR_THROW(pVirtualBox, OpenSession(session, newMachineId));
    19161918                    fSessionOpen = true;
    19171919
     
    19721974                                srcFormat = L"VMDK";
    19731975                            /* 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()));
    19751977
    19761978                            /* Create a dynamic growing disk image with the given capacity */
     
    19982000
    19992001                            /* 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()));
    20012003                            fSourceHdNeedsClosing = true;
    20022004
     
    20052007                            CHECK_ERROR_THROW(srcHdVBox, COMGETTER(Format)(srcFormat.asOutParam()));
    20062008                            /* 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()));
    20082010                            /* Clone the source disk image */
    20092011                            CHECK_ERROR_THROW(srcHdVBox, CloneTo(dstHdVBox, progress.asOutParam()));
     
    21432145        {
    21442146            const MyHardDiskAttachment &mhda = *itM;
    2145             rc2 = app->mVirtualBox->OpenSession(session, mhda.uuid);
     2147            rc2 = pVirtualBox->OpenSession(session, mhda.uuid);
    21462148            if (SUCCEEDED(rc2))
    21472149            {
     
    21772179            const Guid &guid = *itID;
    21782180            ComPtr<IMachine> failedMachine;
    2179             rc2 = app->mVirtualBox->UnregisterMachine(guid, failedMachine.asOutParam());
     2181            rc2 = pVirtualBox->UnregisterMachine(guid, failedMachine.asOutParam());
    21802182            if (SUCCEEDED(rc2))
    21812183                rc2 = failedMachine->DeleteSettings();
  • trunk/src/VBox/Main/include/ApplianceImpl.h

    r16931 r16932  
    8383private:
    8484    /** weak VirtualBox parent */
    85     VirtualBox*        mVirtualBox;
     85    const ComObjPtr <VirtualBox, ComWeakRef> mVirtualBox;
    8686
    8787    struct Task; /* Worker thread for import */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette