Changeset 47964 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Aug 21, 2013 12:53:18 PM (11 years ago)
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r47963 r47964 625 625 } 626 626 627 /* 627 /* 628 628 * Figure out from URI which format the image of disk has. 629 629 * URI must have inside section <Disk> . 630 * But there aren't strong requirements about correspondence one URI for one disk virtual format. 630 * But there aren't strong requirements about correspondence one URI for one disk virtual format. 631 631 * So possibly, we aren't able to recognize some URIs. 632 632 */ 633 633 Utf8Str vdf = typeOfVirtualDiskFormatFromURI(di.strFormat); 634 634 635 /* 635 /* 636 636 * fallback, if we can't determine virtual disk format using URI from the attribute ovf:format 637 637 * in the corresponding section <Disk> in the OVF file. … … 828 828 { 829 829 throw setError(VBOX_E_FILE_ERROR, 830 tr("Empty directory folder (%s) isn't allowed in the OVA package (%Rrc)"), 830 tr("Empty directory folder (%s) isn't allowed in the OVA package (%Rrc)"), 831 831 pszFilename, 832 832 vrc); … … 1557 1557 1558 1558 size_t cbMfSize = 0; 1559 1559 1560 1560 /* Now import the appliance. */ 1561 1561 importMachines(stack, pShaIo, &storage); … … 1674 1674 { 1675 1675 throw setError(VBOX_E_FILE_ERROR, 1676 tr("Empty directory folder (%s) isn't allowed in the OVA package (%Rrc)"), 1676 tr("Empty directory folder (%s) isn't allowed in the OVA package (%Rrc)"), 1677 1677 pszFilename, 1678 1678 vrc); … … 1691 1691 { 1692 1692 throw setError(VBOX_E_FILE_ERROR, 1693 tr("Empty directory folder (%s) isn't allowed in the OVA package (%Rrc)"), 1693 tr("Empty directory folder (%s) isn't allowed in the OVA package (%Rrc)"), 1694 1694 pszFilename, 1695 1695 vrc); … … 1723 1723 if (FAILED(rc)) throw rc; 1724 1724 1725 /* 1725 /* 1726 1726 * Try to read the certificate file. First try. 1727 * Logic is the same as with manifest file 1728 * Only if the manifest file had been read successfully before 1727 * Logic is the same as with manifest file 1728 * Only if the manifest file had been read successfully before 1729 1729 */ 1730 1730 vrc = RTTarCurrentFile(tar, &pszFilename); … … 2024 2024 2025 2025 bool fOldDigest = pStorage->fCreateDigest;/* Save the old digest property */ 2026 pStorage->fCreateDigest = fCreateDigest; 2026 pStorage->fCreateDigest = fCreateDigest; 2027 2027 int vrc = ShaReadBuf(strFile.c_str(), ppvBuf, pcbSize, pCallbacks, pStorage); 2028 2028 if ( RT_FAILURE(vrc) … … 2245 2245 SystemProperties *pSysProps = mVirtualBox->getSystemProperties(); 2246 2246 2247 /* 2247 /* 2248 2248 * we put strSourceOVF into the stack.llSrcDisksDigest in the end of this 2249 * function like a key for a later validation of the SHA digests 2250 */ 2249 * function like a key for a later validation of the SHA digests 2250 */ 2251 2251 const Utf8Str &strSourceOVF = di.strHref; 2252 2252 … … 2277 2277 else 2278 2278 { 2279 bool fGzipUsed = !(di.strCompression.compare("gzip",Utf8Str::CaseInsensitive)); 2279 bool fGzipUsed = !(di.strCompression.compare("gzip",Utf8Str::CaseInsensitive)); 2280 2280 /* check read file to GZIP compression */ 2281 2281 try … … 2289 2289 * with simple FILE interface because we don't need SHA or TAR interfaces here anymore. 2290 2290 * But we mustn't delete the chain of SHA-TAR or SHA-FILE interfaces. 2291 */ 2291 */ 2292 2292 2293 2293 /* Decompress the GZIP file and save a new file in the target path */ … … 2323 2323 tr("Creation of the VD interface failed (%Rrc)"), vrc); 2324 2324 2325 /* Correct the source and the target with the actual values */ 2325 /* Correct the source and the target with the actual values */ 2326 2326 strSrcFilePath = strTargetDir; 2327 2327 strTargetDir = strTargetDir.stripFilename(); … … 2335 2335 Utf8Str strTrgFormat = "VMDK"; 2336 2336 ULONG lCabs = 0; 2337 char *pszExt = NULL; 2337 char *pszExt = NULL; 2338 2338 2339 2339 if (RTPathHaveExt(strTargetPath->c_str())) … … 2371 2371 else 2372 2372 { 2373 throw setError(VBOX_E_FILE_ERROR, 2374 tr("The target disk '%s' has no extension "), 2373 throw setError(VBOX_E_FILE_ERROR, 2374 tr("The target disk '%s' has no extension "), 2375 2375 strTargetPath->c_str(), VERR_INVALID_NAME); 2376 2376 } … … 2383 2383 { 2384 2384 void *pvTmpBuf = 0; 2385 size_t cbSize = 0;2386 2385 try 2387 2386 { 2388 2387 if (fGzipUsed == true) 2389 2388 { 2390 /* 2391 * The source and target pathes are the same. 2392 * It means that we have the needed file already. 2393 * For example, in GZIP case, we decompress the file and save it in the target path, 2394 * but with some prefix like "temp_". See part "check read file to GZIP compression" earlier 2395 * in this function. 2396 * Just rename the file by deleting "temp_" from it's name 2397 */ 2398 vrc = RTFileRename(strSrcFilePath.c_str(), strTargetPath->c_str(), RTPATHRENAME_FLAGS_NO_REPLACE); 2399 if (RT_FAILURE(vrc)) 2400 throw setError(VBOX_E_FILE_ERROR, 2401 tr("Could not rename the file '%s' (%Rrc)"), 2389 /* 2390 * The source and target pathes are the same. 2391 * It means that we have the needed file already. 2392 * For example, in GZIP case, we decompress the file and save it in the target path, 2393 * but with some prefix like "temp_". See part "check read file to GZIP compression" earlier 2394 * in this function. 2395 * Just rename the file by deleting "temp_" from it's name 2396 */ 2397 vrc = RTFileRename(strSrcFilePath.c_str(), strTargetPath->c_str(), RTPATHRENAME_FLAGS_NO_REPLACE); 2398 if (RT_FAILURE(vrc)) 2399 throw setError(VBOX_E_FILE_ERROR, 2400 tr("Could not rename the file '%s' (%Rrc)"), 2402 2401 RTPathFilename(strSourceOVF.c_str()), vrc); 2403 2402 } 2404 else 2405 { 2406 /* Calculating SHA digest for ISO file while copying one */ 2407 vrc = copyFileAndCalcShaDigest(strSrcFilePath.c_str(), 2408 strTargetPath->c_str(), 2409 pCallbacks, 2410 pRealUsedStorage); 2411 2412 if (RT_FAILURE(vrc)) 2413 throw setError(VBOX_E_FILE_ERROR, 2414 tr("Could not copy ISO file '%s' listed in the OVF file (%Rrc)"), 2415 RTPathFilename(strSourceOVF.c_str()), vrc); 2416 } 2403 else 2404 { 2405 /* Calculating SHA digest for ISO file while copying one */ 2406 vrc = copyFileAndCalcShaDigest(strSrcFilePath.c_str(), 2407 strTargetPath->c_str(), 2408 pCallbacks, 2409 pRealUsedStorage); 2410 2411 if (RT_FAILURE(vrc)) 2412 throw setError(VBOX_E_FILE_ERROR, 2413 tr("Could not copy ISO file '%s' listed in the OVF file (%Rrc)"), 2414 RTPathFilename(strSourceOVF.c_str()), vrc); 2415 } 2417 2416 } 2418 2417 catch (HRESULT arc) … … 2508 2507 waitForAsyncProgress(stack.pProgress, pp); 2509 2508 2510 if (fGzipUsed == true) 2511 { 2512 /* 2513 * Just delete the temporary file 2514 */ 2515 vrc = RTFileDelete(strSrcFilePath.c_str()); 2516 if (RT_FAILURE(vrc)) 2517 setWarning(VBOX_E_FILE_ERROR, 2518 tr("Could not delete the file '%s' (%Rrc)"), 2519 RTPathFilename(strSrcFilePath.c_str()), vrc); 2520 } 2509 if (fGzipUsed == true) 2510 { 2511 /* 2512 * Just delete the temporary file 2513 */ 2514 vrc = RTFileDelete(strSrcFilePath.c_str()); 2515 if (RT_FAILURE(vrc)) 2516 setWarning(VBOX_E_FILE_ERROR, 2517 tr("Could not delete the file '%s' (%Rrc)"), 2518 RTPathFilename(strSrcFilePath.c_str()), vrc); 2519 } 2521 2520 } 2522 2521 } … … 2986 2985 VirtualSystemDescriptionEntry *vsdeTargetHD = 0; 2987 2986 2988 /* 2989 * 2987 /* 2988 * 2990 2989 * Iterate over all given disk images of the virtual system 2991 2990 * disks description. We need to find the target disk path, 2992 * which could be changed by the user. 2991 * which could be changed by the user. 2993 2992 * 2994 2993 */ … … 3049 3048 if(availableImage.compare(diCurrent.strHref, Utf8Str::CaseInsensitive) != 0) 3050 3049 { 3051 /* 3050 /* 3052 3051 * availableImage contains the disk file reference (e.g. "disk1.vmdk"), which should exist 3053 3052 * in the global images map. … … 3075 3074 } 3076 3075 3077 /* 3076 /* 3078 3077 * Again iterate over all given disk images of the virtual system 3079 * disks description using the found disk image 3078 * disks description using the found disk image 3080 3079 */ 3081 3080 { … … 3155 3154 mhda.lDevice); 3156 3155 3157 Log(("Attaching disk %s to port %d on device %d\n", 3156 Log(("Attaching disk %s to port %d on device %d\n", 3158 3157 vsdeTargetHD->strVboxCurrent.c_str(), mhda.lControllerPort, mhda.lDevice)); 3159 3158 … … 3500 3499 diCurrent = *(&itDiskImage->second); 3501 3500 3502 /* 3501 /* 3503 3502 * Again iterate over all given disk images of the virtual system 3504 3503 * disks description using the found disk image … … 3695 3694 const ovf::OVFReader &reader = *m->pReader; 3696 3695 3697 /* 3698 * get the SHA digest version that was set in accordance with the value of attribute "xmlns:ovf" 3696 /* 3697 * get the SHA digest version that was set in accordance with the value of attribute "xmlns:ovf" 3699 3698 * of the element <Envelope> in the OVF file during reading operation. See readFSImpl(). 3700 3699 */ -
trunk/src/VBox/Main/src-server/NATNetworkImpl.cpp
r47869 r47964 478 478 STDMETHODIMP NATNetwork::COMGETTER(LocalMappings)(ComSafeArrayOut(BSTR, aLocalMappings)) 479 479 { 480 NOREF(aLocalMappings); NOREF(aLocalMappingsSize); 480 481 return E_NOTIMPL; 481 482 } … … 483 484 STDMETHODIMP NATNetwork::AddLocalMapping(IN_BSTR aHostId, LONG aOffset) 484 485 { 486 NOREF(aHostId); NOREF(aOffset); 485 487 return E_NOTIMPL; 486 488 } … … 488 490 STDMETHODIMP NATNetwork::COMGETTER(LoopbackIp6)(LONG *aLoopbackIp6) 489 491 { 492 NOREF(aLoopbackIp6); 490 493 return E_NOTIMPL; 491 494 } … … 493 496 STDMETHODIMP NATNetwork::COMSETTER(LoopbackIp6)(LONG aLoopbackIp6) 494 497 { 498 NOREF(aLoopbackIp6); 495 499 return E_NOTIMPL; 496 500 }
Note:
See TracChangeset
for help on using the changeset viewer.