VirtualBox

Changeset 17741 in vbox


Ignore:
Timestamp:
Mar 12, 2009 12:39:34 PM (16 years ago)
Author:
vboxsync
Message:

OVF: use the format based on the target file extension & not based on the source format

File:
1 edited

Legend:

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

    r17718 r17741  
    28452845                /* This isn't allowed */
    28462846                throw setError(VBOX_E_FILE_ERROR,
    2847                                 tr("Source virtual disk image file '%s' doesn't exist"),
    2848                                     strSrcFilePath.c_str());
     2847                               tr("Source virtual disk image file '%s' doesn't exist"),
     2848                               strSrcFilePath.c_str());
    28492849
    28502850            // output filename
     
    28642864            if (FAILED(rc)) throw rc;
    28652865
    2866             /* We need the format description of the source disk image */
    2867             Bstr bstrSrcFormat;
    2868             rc = pSourceDisk->COMGETTER(Format)(bstrSrcFormat.asOutParam());
    2869             if (FAILED(rc)) throw rc;
     2866            /* Based on the file extensions we choose the right format for the
     2867             * disk */
     2868            Bstr bstrSrcFormat = L"VDI";
     2869            if (strTargetFilePath.endsWith(".vmdk"))
     2870                bstrSrcFormat = L"VMDK";
    28702871            /* Create a new hard disk interface for the destination disk image */
    28712872            Log(("Creating target disk \"%s\"\n", strTargetFilePath.raw()));
     
    34793480                default:
    34803481                    throw setError(VBOX_E_NOT_SUPPORTED,
    3481                                   tr("Cannot handle hard disk attachment: storageBus is %d, channel is %d, device is %d"), storageBus, lChannel, lDevice);
     3482                                   tr("Cannot handle hard disk attachment: storageBus is %d, channel is %d, device is %d"), storageBus, lChannel, lDevice);
    34823483                break;
    34833484            }
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