VirtualBox

Changeset 16926 in vbox


Ignore:
Timestamp:
Feb 18, 2009 5:26:40 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
43057
Message:

OVF: fix session handling (code failed if machine had more than one disk image attached); fix broken error reporting (null string passed with %d)

File:
1 edited

Legend:

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

    r16867 r16926  
    16541654DECLCALLBACK(int) Appliance::taskThread(RTTHREAD aThread, void *pvUser)
    16551655{
    1656     std::auto_ptr <Task> task(static_cast<Task *>(pvUser));
     1656    std::auto_ptr<Task> task(static_cast<Task *>(pvUser));
    16571657    AssertReturn(task.get(), VERR_GENERAL_FAILURE);
    16581658
     
    19211921                   the machine, so make an extra try/catch block. */
    19221922                ComPtr<ISession> session;
     1923                bool fSessionOpen = false;
    19231924                ComPtr<IHardDisk> srcHdVBox;
     1925
    19241926                try
    19251927                {
     
    19301932                    rc = app->mVirtualBox->OpenSession(session, newMachineId);
    19311933                    CheckComRCThrowRC(rc);
     1934                    fSessionOpen = true;
    19321935
    19331936                    int result;
     
    20272030                                /* This isn't allowed */
    20282031                                throw setError(VBOX_E_FILE_ERROR,
    2029                                                tr("Source virtual disk image file '%s' doesn't exists",
    2030                                                   strSrcFilePath.c_str()));
     2032                                               tr("Source virtual disk image file '%s' doesn't exist"),
     2033                                                  strSrcFilePath.c_str());
    20312034                            /* Clone the disk image (this is necessary cause the id has
    20322035                             * to be recreated for the case the same hard disk is
     
    21002103                        rc = sMachine->SaveSettings();
    21012104                        CheckComRCThrowRC(rc);
    2102                         rc = session->Close();
    2103                         CheckComRCThrowRC(rc);
    2104                     }
     2105                    } // end for (itHD = avsdeHDs.begin();
     2106
     2107                    // only now that we're done with all disks, close the session
     2108                    rc = session->Close();
     2109                    CheckComRCThrowRC(rc);
    21052110                }
    21062111                catch(HRESULT aRC)
Note: See TracChangeset for help on using the changeset viewer.

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