VirtualBox

Ignore:
Timestamp:
Jun 7, 2019 9:22:06 AM (6 years ago)
Author:
vboxsync
Message:

bugref:9404. Changed the command \'list instances\'. Now the requested states can be combined together in the array.

File:
1 edited

Legend:

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

    r78841 r79033  
    183183    com::SafeArray<BSTR> arrayVMIds;
    184184    ComPtr<IProgress> pProgress;
    185 
    186     RTPrintf("Getting a list of available cloud instances...\n");
     185    com::SafeArray<CloudMachineState_T> machimeStates;
     186
    187187    RTPrintf("Reply is in the form \'instance name\' = \'instance id\'\n");
     188
    188189    CHECK_ERROR2_RET(hrc, oCloudClient,
    189                      ListInstances(CloudMachineState_Running,
     190                     ListInstances(ComSafeArrayAsInParam(machimeStates),
    190191                                   pVMNamesHolder.asOutParam(),
    191192                                   pVMIdsHolder.asOutParam(),
     
    202203            RTEXITCODE_FAILURE);
    203204
    204     RTPrintf("List of running instances for the cloud profile \'%ls\' \nand compartment \'%s\':\n",
     205    RTPrintf("List of instances for the cloud profile \'%ls\' \nand compartment \'%s\':\n",
    205206             bstrProfileName.raw(), strCompartmentId.c_str());
    206207    size_t cIds = arrayVMIds.size();
     
    212213            value = arrayVMIds[k];
    213214        RTPrintf("\t%ls = %ls\n", arrayVMNames[k], value.raw());
    214     }
    215 
    216     pVMNamesHolder.setNull();
    217     pVMIdsHolder.setNull();
    218     arrayVMNames.setNull();
    219     arrayVMIds.setNull();
    220     pProgress.setNull();
    221     CHECK_ERROR2_RET(hrc, oCloudClient,
    222                      ListInstances(CloudMachineState_Stopped,
    223                                    pVMNamesHolder.asOutParam(),
    224                                    pVMIdsHolder.asOutParam(),
    225                                    pProgress.asOutParam()),
    226                      RTEXITCODE_FAILURE);
    227     showProgress(pProgress);
    228     CHECK_PROGRESS_ERROR_RET(pProgress, ("Failed to list instances"), RTEXITCODE_FAILURE);
    229 
    230     CHECK_ERROR2_RET(hrc,
    231         pVMNamesHolder, COMGETTER(Values)(ComSafeArrayAsOutParam(arrayVMNames)),
    232             RTEXITCODE_FAILURE);
    233     CHECK_ERROR2_RET(hrc,
    234         pVMIdsHolder, COMGETTER(Values)(ComSafeArrayAsOutParam(arrayVMIds)),
    235             RTEXITCODE_FAILURE);
    236 
    237     RTPrintf("List of paused instances for the cloud profile \'%ls\' \nand compartment \'%s\':\n",
    238              bstrProfileName.raw(), strCompartmentId.c_str());
    239     cNames = arrayVMNames.size();
    240     cIds = arrayVMIds.size();
    241     for (size_t k = 0; k < cNames; k++)
    242     {
    243         Bstr value;
    244         if (k < cIds)
    245             value = arrayVMIds[k];
    246         RTPrintf("\t%ls=%ls\n", arrayVMNames[k], value.raw());
    247215    }
    248216
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