Changeset 49620 in vbox for trunk/src/VBox/Main/src-server/ApplianceImpl.cpp
- Timestamp:
- Nov 22, 2013 10:37:17 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 90839
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImpl.cpp
r49408 r49620 29 29 #include "ProgressImpl.h" 30 30 #include "MachineImpl.h" 31 #include "MediumFormatImpl.h"32 31 #include "SystemPropertiesImpl.h" 33 32 #include "AutoCaller.h" … … 728 727 } 729 728 729 730 /** 731 * Returns a medium format object corresponding to the given 732 * disk image or null if no such format. 733 * 734 * @param di Disk Image 735 * @param mf Medium Format 736 * 737 * @return ComObjPtr<MediumFormat> 738 */ 739 HRESULT Appliance::findMediumFormatFromDiskImage(const ovf::DiskImage &di, ComObjPtr<MediumFormat>& mf) 740 { 741 HRESULT rc = S_OK; 742 743 /* Get the system properties. */ 744 SystemProperties *pSysProps = mVirtualBox->getSystemProperties(); 745 746 /* We need a proper source format description */ 747 /* Which format to use? */ 748 Utf8Str strSrcFormat = typeOfVirtualDiskFormatFromURI(di.strFormat); 749 750 /* 751 * fallback, if we can't determine virtual disk format using URI from the attribute ovf:format 752 * in the corresponding section <Disk> in the OVF file. 753 */ 754 if (strSrcFormat.isEmpty()) 755 { 756 /* Figure out from extension which format the image of disk has. */ 757 { 758 char *pszExt = RTPathSuffix(di.strHref.c_str()); 759 if (pszExt) 760 pszExt++; 761 mf = pSysProps->mediumFormatFromExtension(pszExt); 762 } 763 } 764 else 765 mf = pSysProps->mediumFormat(strSrcFormat); 766 767 if (mf.isNull()) 768 { 769 rc = setError(E_FAIL, 770 tr("Internal inconsistency looking up medium format for the disk image '%s'"), 771 di.strHref.c_str()); 772 } 773 774 return rc; 775 } 776 730 777 /** 731 778 * Returns true if the appliance is in "idle" state. This should always be the
Note:
See TracChangeset
for help on using the changeset viewer.