VirtualBox

Changeset 81084 in vbox


Ignore:
Timestamp:
Sep 30, 2019 3:55:04 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
133690
Message:

bugref:9555. Added ability to create an instance from a boot volume.

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageCloud.cpp

    r80948 r81084  
    470470    {
    471471        { "--image-id",       'i', RTGETOPT_REQ_STRING },
     472        { "--boot-volume-id", 'v', RTGETOPT_REQ_STRING },
    472473        { "--display-name",   'n', RTGETOPT_REQ_STRING },
    473474        { "--launch-mode",    'm', RTGETOPT_REQ_STRING },
     
    495496    ComPtr<IVirtualSystemDescription> pVSD = virtualSystemDescriptions[0];
    496497
    497     Utf8Str strDisplayName, strImageId;
     498    Utf8Str strDisplayName, strImageId, strBootVolumeId;
    498499    int c;
    499500    while ((c = RTGetOpt(&GetState, &ValueUnion)) != 0)
     
    504505                strImageId = ValueUnion.psz;
    505506                pVSD->AddDescription(VirtualSystemDescriptionType_CloudImageId,
     507                                     Bstr(ValueUnion.psz).raw(),
     508                                     Bstr(ValueUnion.psz).raw());
     509                break;
     510
     511            case 'v':
     512                strBootVolumeId = ValueUnion.psz;
     513                pVSD->AddDescription(VirtualSystemDescriptionType_CloudBootVolumeId,
    506514                                     Bstr(ValueUnion.psz).raw(),
    507515                                     Bstr(ValueUnion.psz).raw());
     
    564572    }
    565573
    566     if (strImageId.isEmpty())
    567         return errorArgument("Missing parameter --image-id.");
     574    if (strImageId.isNotEmpty() && strBootVolumeId.isNotEmpty())
     575        return errorArgument("Parameters --image-id and --boot-volume-id are mutually exclusive. "
     576                             "Only one of them must be presented.");
     577
     578    if (strImageId.isEmpty() && strBootVolumeId.isEmpty())
     579        return errorArgument("Missing parameter --image-id or --boot-volume-id. One of them must be presented.");
    568580
    569581    ComPtr<ICloudProfile> pCloudProfile = pCommonOpts->profile.pCloudProfile;
     
    600612#endif
    601613
    602     RTPrintf("Creating cloud instance with name \'%s\' from the image \'%s\'...\n",
    603              strDisplayName.c_str(), strImageId.c_str());
    604 
     614    if (strImageId.isNotEmpty())
     615        RTPrintf("Creating cloud instance with name \'%s\' from the image \'%s\'...\n",
     616                 strDisplayName.c_str(), strImageId.c_str());
     617    else
     618        RTPrintf("Creating cloud instance with name \'%s\' from the boot volume \'%s\'...\n",
     619                 strDisplayName.c_str(), strBootVolumeId.c_str());
    605620
    606621    CHECK_ERROR2_RET(hrc, oCloudClient, LaunchVM(pVSD, pProgress.asOutParam()), RTEXITCODE_FAILURE);
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r80824 r81084  
    40354035  <enum
    40364036    name="VirtualSystemDescriptionType"
    4037     uuid="6d85a5f8-d305-11e9-986e-f3fb16e309d4"
     4037    uuid="eca6989c-1de0-456b-8c4f-49c609791156"
    40384038    >
    40394039    <desc>Used with <link to="IVirtualSystemDescription" /> to describe the type of
     
    40984098    <const name="CloudOCILaunchMode" value="43" />
    40994099    <const name="CloudPrivateIP" value="44" />
     4100    <const name="CloudBootVolumeId" value="45" />
    41004101  </enum>
    41014102
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