Changeset 86153 in vbox for trunk/src/VBox
- Timestamp:
- Sep 17, 2020 12:35:47 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageCloud.cpp
r85650 r86153 2188 2188 } 2189 2189 2190 static HRESULT localGatewayImagePath(const Bstr &aDefaultMachineFolder, Bstr &aLgwImage) 2191 { 2192 com::Utf8Str strPath(aDefaultMachineFolder); 2193 int rc = RTPathAppendCxx(strPath, "gateways"); 2194 if (RT_SUCCESS(rc)) 2195 rc = RTPathAppendCxx(strPath, "lgw.vdi"); 2196 if (RT_SUCCESS(rc)) 2197 aLgwImage = strPath; 2198 2199 return rc; 2200 } 2201 2190 2202 static HRESULT createLocalGatewayImage(ComPtr<IVirtualBox> virtualBox, const Bstr& aGatewayIso, const Bstr& aGuestAdditionsIso, const Bstr& aProxy) 2191 2203 { … … 2259 2271 guestAdditionsISO = aGuestAdditionsIso; 2260 2272 2261 BstrFmt strGatewayImage("%ls\\gateways\\lgw.vdi", defaultMachineFolder.raw()); 2273 Bstr strGatewayImage; 2274 int rc = localGatewayImagePath(defaultMachineFolder, strGatewayImage); 2275 if (RT_FAILURE(rc)) 2276 { 2277 RTStrmPrintf(g_pStdErr, "Failed to compose a path to the local gateway image (%Rrc)", rc); 2278 RTStrmFlush(g_pStdErr); 2279 return E_FAIL; 2280 } 2262 2281 hrc = virtualBox->OpenMedium(strGatewayImage.raw(), DeviceType_HardDisk, AccessMode_ReadWrite, FALSE, hd.asOutParam()); 2263 2282 /* If the image is already in place, there is nothing for us to do. */ … … 2565 2584 { "--guest-additions-iso", 'a', RTGETOPT_REQ_STRING }, 2566 2585 { "--local-gateway-iso", 'l', RTGETOPT_REQ_STRING }, 2567 { "--proxy", 'p', RTGETOPT_REQ_STRING } 2586 { "--proxy", 'p', RTGETOPT_REQ_STRING }, 2587 { "--compartment-id", 'c', RTGETOPT_REQ_STRING } 2568 2588 }; 2569 2589 RTGETOPTSTATE GetState; … … 2580 2600 Bstr strGuestAdditionsIso; 2581 2601 Bstr strProxy; 2602 Bstr strCompartmentId; 2582 2603 2583 2604 int c; … … 2609 2630 case 'p': 2610 2631 strProxy=ValueUnion.psz; 2632 break; 2633 case 'c': 2634 strCompartmentId=ValueUnion.psz; 2611 2635 break; 2612 2636 case VINF_GETOPT_NOT_OPTION: … … 2634 2658 2635 2659 ComPtr<ICloudProfile> pCloudProfile = pCommonOpts->profile.pCloudProfile; 2660 2661 /* Use user-specified profile instead of default one. */ 2662 if (strCompartmentId.isNotEmpty()) 2663 { 2664 CHECK_ERROR2_RET(hrc, pCloudProfile, 2665 SetProperty(Bstr("compartment").raw(), Bstr(strCompartmentId).raw()), 2666 RTEXITCODE_FAILURE); 2667 } 2636 2668 2637 2669 ComObjPtr<ICloudClient> oCloudClient;
Note:
See TracChangeset
for help on using the changeset viewer.