- Timestamp:
- Jun 1, 2017 1:32:35 PM (7 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 6 edited
-
Frontends/VBoxManage/VBoxManageAppliance.cpp (modified) (2 diffs)
-
Frontends/VBoxManage/VBoxManageHelp.cpp (modified) (1 diff)
-
Main/Makefile.kmk (modified) (1 diff)
-
Main/idl/VirtualBox.xidl (modified) (2 diffs)
-
Main/include/ApplianceImpl.h (modified) (1 diff)
-
Main/src-server/ApplianceImplExport.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageAppliance.cpp
r67194 r67208 943 943 { "--ovf10", '1', RTGETOPT_REQ_NOTHING }, 944 944 { "--ovf20", '2', RTGETOPT_REQ_NOTHING }, 945 { "--opc ", 'c', RTGETOPT_REQ_STRING },945 { "--opc10", 'c', RTGETOPT_REQ_NOTHING }, 946 946 { "--manifest", 'm', RTGETOPT_REQ_NOTHING }, // obsoleted by --options 947 947 { "--iso", 'I', RTGETOPT_REQ_NOTHING }, // obsoleted by --options … … 1007 1007 1008 1008 case 'c': // --opc 1009 strOvfFormat = "opc ";1009 strOvfFormat = "opc-1.0"; 1010 1010 break; 1011 1011 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r67194 r67208 926 926 RTStrmPrintf(pStrm, 927 927 "%s export %s <machines> --output|-o <name>.<ovf/ova/tar.gz>\n" 928 " [--legacy09|--ovf09|--ovf10|--ovf20|--opc ]\n"928 " [--legacy09|--ovf09|--ovf10|--ovf20|--opc10]\n" 929 929 " [--manifest]\n" 930 930 " [--iso]\n" -
trunk/src/VBox/Main/Makefile.kmk
r67203 r67208 374 374 $(if $(VBOX_WITH_NEW_USB_CODE_ON_DARWIN),VBOX_WITH_NEW_USB_CODE_ON_DARWIN,) 375 375 endif 376 if defined(VBOX_WITH_NEW_TAR_CREATOR) #|| "$(USERNAME)" == "bird" # temporary376 if defined(VBOX_WITH_NEW_TAR_CREATOR) || "$(USERNAME)" == "bird" # temporary 377 377 VBoxSVC_DEFS += VBOX_WITH_NEW_TAR_CREATOR 378 378 endif -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r67195 r67208 3376 3376 <desc> 3377 3377 Output format, as a string. Currently supported formats are "ovf-0.9", "ovf-1.0", 3378 "ovf-2.0" and "opc "; future versions of VirtualBox may support additional formats.3379 The "opc " format is for creating tarballs for the Oracle Public Cloud.3378 "ovf-2.0" and "opc-1.0"; future versions of VirtualBox may support additional formats. 3379 The "opc-1.0" format is for creating tarballs for the Oracle Public Cloud. 3380 3380 </desc> 3381 3381 </param> … … 3386 3386 <desc> 3387 3387 Name of appliance file to create. There are certain restrictions with regard 3388 to the file name suffix. If the format parameter is "opc " a <tt>.tar.gz</tt>3388 to the file name suffix. If the format parameter is "opc-1.0" a <tt>.tar.gz</tt> 3389 3389 suffix is required. Otherwise the suffix must either be <tt>.ovf</tt> or 3390 3390 <tt>.ova</tt>, depending on whether the appliance is distributed as a set of -
trunk/src/VBox/Main/include/ApplianceImpl.h
r67193 r67208 221 221 HRESULT i_writeFSOPC(TaskOVF *pTask, AutoWriteLockBase& writeLock); 222 222 #ifdef VBOX_WITH_NEW_TAR_CREATOR 223 HRESULT i_writeFSImpl(TaskOVF *pTask, AutoWriteLockBase &writeLock, RTVFSFSSTREAM hVfsFssDst, 224 bool fOvfFile = true, bool fStreamOptimizedVmdk = true); 223 HRESULT i_writeFSImpl(TaskOVF *pTask, AutoWriteLockBase &writeLock, RTVFSFSSTREAM hVfsFssDst); 225 224 HRESULT i_writeBufferToFile(RTVFSFSSTREAM hVfsFssDst, const char *pszFilename, const void *pvContent, size_t cbContent); 226 225 #else -
trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp
r67203 r67208 354 354 355 355 Utf8Str strName = Utf8Str(locInfo.strPath).stripPath().stripSuffix(); 356 if (locInfo.strPath.endsWith(".tar.gz", Utf8Str::CaseSensitive)) 357 strName.stripSuffix(); 356 358 strTargetImageName = Utf8StrFmt("%s-disk%.3d.vmdk", strName.c_str(), ++pAppliance->m->cDisks); 357 359 if (strTargetImageName.length() > RTTAR_NAME_MAX) … … 681 683 else if (aFormat == "ovf-2.0") 682 684 ovfF = ovf::OVFVersion_2_0; 683 else if (aFormat == "opc ")685 else if (aFormat == "opc-1.0") 684 686 ovfF = ovf::OVFVersion_unknown; 685 687 else … … 2327 2329 pDiskEntry->ulSizeMB); // operation's weight, as set up 2328 2330 // with the IProgress originally 2329 ///* 2330 // * We threat the harddisks are raw images, but since they typically 2331 // * require a lot more setup and configuration compares to ISOs, we 2332 // * don't bother trying sharing code here (yet). 2333 // */ 2334 //if (pDiskEntry->type == VirtualSystemDescriptionType_HardDiskImage) 2335 hrc = ptrSourceDisk->i_addRawToFss(strInsideName.c_str(), m->m_pSecretKeyStore, hVfsFssTar /*, pProgress2*/); 2336 //else if (pDiskEntry->type == VirtualSystemDescriptionType_CDROM) 2337 //{ 2338 // /* Open the source image and cast it to a VFS base object. */ 2339 // RTVFSFILE hVfsSrcFile; 2340 // vrc = RTVfsFileOpenNormal(strSrcFilePath.c_str(), 2341 // RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_NONE, 2342 // &hVfsSrcFile); 2343 // if (RT_FAILURE(vrc)) 2344 // throw setErrorBoth(VBOX_E_FILE_ERROR, vrc, 2345 // tr("Could not create or open file '%s' (%Rrc)"), strSrcFilePath.c_str(), vrc); 2346 // 2347 // RTVFSOBJ hVfsSrc = RTVfsObjFromFile(hVfsSrcFile); 2348 // RTVfsFileRelease(hVfsSrcFile); 2349 // AssertStmt(hVfsSrc != NIL_RTVFSOBJ, throw VERR_INTERNAL_ERROR); 2350 // 2351 // /* Add it to the output stream. This will pull in all the data from the object. */ 2352 // vrc = RTVfsFsStrmAdd(hVfsFssTar, strInsideName.c_str(), hVfsSrc, 0 /*fFlags*/); 2353 // RTVfsObjRelease(hVfsSrc); 2354 // if (RT_FAILURE(vrc)) 2355 // throw setErrorBoth(VBOX_E_FILE_ERROR, vrc, tr("Error during copy CD/DVD image '%s' (%Rrc)"), 2356 // strSrcFilePath.c_str(), vrc); 2357 //} 2358 //else 2359 // AssertFailedStmt(throw E_UNEXPECTED); 2331 hrc = ptrSourceDisk->i_addRawToFss(strInsideName.c_str(), m->m_pSecretKeyStore, hVfsFssTar /*, pProgress2*/); 2360 2332 if (FAILED(hrc)) 2361 2333 throw hrc; … … 2407 2379 2408 2380 #ifdef VBOX_WITH_NEW_TAR_CREATOR 2409 HRESULT Appliance::i_writeFSImpl(TaskOVF *pTask, AutoWriteLockBase &writeLock, RTVFSFSSTREAM hVfsFssDst, 2410 bool fOvfFile /*= true*/, bool fStreamOptimizedVmdk /*= true*/) 2381 HRESULT Appliance::i_writeFSImpl(TaskOVF *pTask, AutoWriteLockBase &writeLock, RTVFSFSSTREAM hVfsFssDst) 2411 2382 #else 2412 2383 HRESULT Appliance::i_writeFSImpl(TaskOVF *pTask, AutoWriteLockBase& writeLock, PVDINTERFACEIO pIfIo, PSHASTORAGE pStorage) … … 2446 2417 pTask->enFormat != ovf::OVFVersion_unknown ? pTask->enFormat : ovf::OVFVersion_2_0); 2447 2418 2448 #ifdef VBOX_WITH_NEW_TAR_CREATOR2449 if (fOvfFile)2450 #endif2451 2419 { 2452 2420 void *pvBuf = NULL; … … 2579 2547 #ifdef VBOX_WITH_NEW_TAR_CREATOR 2580 2548 /* For compressed VMDK fun, we let i_exportFile produce the image bytes. */ 2581 if (fStreamOptimizedVmdk) 2582 { 2583 RTVFSIOSTREAM hVfsIosDst; 2584 vrc = RTVfsFsStrmPushFile(hVfsFssDst, strTargetFilePath.c_str(), UINT64_MAX, 2585 NULL /*paObjInfo*/, 0 /*cObjInfo*/, RTVFSFSSTRM_PUSH_F_STREAM, &hVfsIosDst); 2586 if (RT_FAILURE(vrc)) 2587 throw setErrorVrc(vrc, tr("RTVfsFsStrmPushFile failed for '%s' (%Rrc)"), strTargetFilePath.c_str(), vrc); 2588 hVfsIosDst = i_manifestSetupDigestCalculationForGivenIoStream(hVfsIosDst, strTargetFilePath.c_str(), 2589 false /*fRead*/); 2590 if (hVfsIosDst == NIL_RTVFSIOSTREAM) 2591 throw setError(E_FAIL, "i_manifestSetupDigestCalculationForGivenIoStream(%s)", strTargetFilePath.c_str()); 2592 2593 rc = pSourceDisk->i_exportFile(strTargetFilePath.c_str(), 2594 format, 2595 MediumVariant_VmdkStreamOptimized, 2596 m->m_pSecretKeyStore, 2597 hVfsIosDst, 2598 pProgress2); 2599 RTVfsIoStrmRelease(hVfsIosDst); 2600 if (FAILED(rc)) throw rc; 2601 } 2602 /* When creating sparse raw images, the tar creator stream pulls the data 2603 out of the disk image. It will scan for empty space first, then copy 2604 the non-empty segments into the tar stream. */ 2605 else 2606 { 2607 throw E_NOTIMPL; 2608 } 2549 RTVFSIOSTREAM hVfsIosDst; 2550 vrc = RTVfsFsStrmPushFile(hVfsFssDst, strTargetFilePath.c_str(), UINT64_MAX, 2551 NULL /*paObjInfo*/, 0 /*cObjInfo*/, RTVFSFSSTRM_PUSH_F_STREAM, &hVfsIosDst); 2552 if (RT_FAILURE(vrc)) 2553 throw setErrorVrc(vrc, tr("RTVfsFsStrmPushFile failed for '%s' (%Rrc)"), strTargetFilePath.c_str(), vrc); 2554 hVfsIosDst = i_manifestSetupDigestCalculationForGivenIoStream(hVfsIosDst, strTargetFilePath.c_str(), 2555 false /*fRead*/); 2556 if (hVfsIosDst == NIL_RTVFSIOSTREAM) 2557 throw setError(E_FAIL, "i_manifestSetupDigestCalculationForGivenIoStream(%s)", strTargetFilePath.c_str()); 2558 2559 rc = pSourceDisk->i_exportFile(strTargetFilePath.c_str(), 2560 format, 2561 MediumVariant_VmdkStreamOptimized, 2562 m->m_pSecretKeyStore, 2563 hVfsIosDst, 2564 pProgress2); 2565 RTVfsIoStrmRelease(hVfsIosDst); 2566 if (FAILED(rc)) throw rc; 2609 2567 #else 2610 2568 rc = pSourceDisk->i_exportFile(strTargetFilePath.c_str(), … … 2630 2588 2631 2589 #ifdef VBOX_WITH_NEW_TAR_CREATOR 2632 /* Open the source image and cast it to a VFS base object. */ 2633 RTVFSFILE hVfsSrcFile; 2634 vrc = RTVfsFileOpenNormal(strSrcFilePath.c_str(), 2635 RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_NONE, 2636 &hVfsSrcFile); 2637 if (RT_FAILURE(vrc)) 2638 throw setErrorBoth(VBOX_E_FILE_ERROR, vrc, 2639 tr("Could not create or open file '%s' (%Rrc)"), strSrcFilePath.c_str(), vrc); 2640 2641 RTVFSOBJ hVfsSrc = RTVfsObjFromFile(hVfsSrcFile); 2642 RTVfsFileRelease(hVfsSrcFile); 2643 AssertStmt(hVfsSrc != NIL_RTVFSOBJ, throw VERR_INTERNAL_ERROR); 2644 2645 /* Add it to the output stream. This will pull in all the data from the object. */ 2646 vrc = RTVfsFsStrmAdd(hVfsFssDst, strTargetFilePath.c_str(), hVfsSrc, 0 /*fFlags*/); 2647 RTVfsObjRelease(hVfsSrc); 2648 if (RT_FAILURE(vrc)) 2649 throw setErrorBoth(VBOX_E_FILE_ERROR, vrc, tr("Error during copy CD/DVD image '%s' (%Rrc)"), 2650 strSrcFilePath.c_str(), vrc); 2590 rc = pSourceDisk->i_addRawToFss(strTargetFilePath.c_str(), m->m_pSecretKeyStore, hVfsFssDst /*, pProgress2*/); 2591 if (FAILED(rc)) throw rc; 2651 2592 #else 2652 2593 /* Read the ISO file and add one to OVA/OVF package */
Note:
See TracChangeset
for help on using the changeset viewer.

