Changeset 79869 in vbox
- Timestamp:
- Jul 18, 2019 11:29:25 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageCloud.cpp
r79797 r79869 95 95 } 96 96 97 97 98 /** 98 99 * List all available cloud instances for the specified cloud provider. … … 118 119 119 120 Utf8Str strCompartmentId; 120 Utf8Str strState;121 com::SafeArray<CloudMachineState_T> machineStates; 121 122 122 123 int c; … … 128 129 strCompartmentId = ValueUnion.psz; 129 130 break; 131 130 132 case 's': 131 strState = ValueUnion.psz; 132 break; 133 case VINF_GETOPT_NOT_OPTION: 134 return errorUnknownSubcommand(ValueUnion.psz); 135 default: 136 return errorGetOpt(c, &ValueUnion); 137 } 138 } 139 140 com::SafeArray<CloudMachineState_T> machineStates; 141 if (strState.isNotEmpty()) 142 { 143 if (strState.equals("running")) 144 machineStates.push_back(CloudMachineState_Running); 145 else if (strState.equals("paused")) 146 machineStates.push_back(CloudMachineState_Stopped); 147 else if (strState.equals("terminated")) 148 machineStates.push_back(CloudMachineState_Terminated); 133 { 134 const char * const pszState = ValueUnion.psz; 135 136 if (RTStrICmp(pszState, "creatingimage") == 0) 137 machineStates.push_back(CloudMachineState_CreatingImage); 138 else if (RTStrICmp(pszState, "paused") == 0) /* XXX */ 139 machineStates.push_back(CloudMachineState_Stopped); 140 else if (RTStrICmp(pszState, "provisioning") == 0) 141 machineStates.push_back(CloudMachineState_Provisioning); 142 else if (RTStrICmp(pszState, "running") == 0) 143 machineStates.push_back(CloudMachineState_Running); 144 else if (RTStrICmp(pszState, "starting") == 0) 145 machineStates.push_back(CloudMachineState_Starting); 146 else if (RTStrICmp(pszState, "stopped") == 0) 147 machineStates.push_back(CloudMachineState_Stopped); 148 else if (RTStrICmp(pszState, "stopping") == 0) 149 machineStates.push_back(CloudMachineState_Stopping); 150 else if (RTStrICmp(pszState, "terminated") == 0) 151 machineStates.push_back(CloudMachineState_Terminated); 152 else if (RTStrICmp(pszState, "terminating") == 0) 153 machineStates.push_back(CloudMachineState_Terminating); 154 else 155 return errorArgument("Unknown cloud instance state \"%s\"", pszState); 156 break; 157 } 158 159 case VINF_GETOPT_NOT_OPTION: 160 return errorUnknownSubcommand(ValueUnion.psz); 161 162 default: 163 return errorGetOpt(c, &ValueUnion); 164 } 149 165 } 150 166 151 167 HRESULT hrc = S_OK; 152 168 ComPtr<IVirtualBox> pVirtualBox = a->virtualBox; 169 153 170 ComPtr<ICloudProviderManager> pCloudProviderManager; 154 171 CHECK_ERROR2_RET(hrc, pVirtualBox, 155 172 COMGETTER(CloudProviderManager)(pCloudProviderManager.asOutParam()), 156 173 RTEXITCODE_FAILURE); 174 157 175 ComPtr<ICloudProvider> pCloudProvider; 158 159 176 CHECK_ERROR2_RET(hrc, pCloudProviderManager, 160 177 GetProviderByShortName(Bstr(pCommonOpts->provider.pszProviderName).raw(), pCloudProvider.asOutParam()), 161 178 RTEXITCODE_FAILURE); 179 162 180 ComPtr<ICloudProfile> pCloudProfile; 163 164 181 CHECK_ERROR2_RET(hrc, pCloudProvider, 165 182 GetProfileByName(Bstr(pCommonOpts->profile.pszProfileName).raw(), pCloudProfile.asOutParam()), … … 234 251 } 235 252 253 236 254 /** 237 255 * List all available cloud images for the specified cloud provider. … … 255 273 AssertRCReturn(vrc, RTEXITCODE_FAILURE); 256 274 275 Utf8Str strCompartmentId; 257 276 com::SafeArray<CloudImageState_T> imageStates; 258 277 259 Utf8Str strCompartmentId;260 278 int c; 261 279 while ((c = RTGetOpt(&GetState, &ValueUnion)) != 0)
Note:
See TracChangeset
for help on using the changeset viewer.