GeezerVison is showing github.com — Merge branch '4.22' · NetApp/cloudstack@4ce5291
File treeExpand file treeCollapse file tree Open diff view settings org/apache/cloudstack/api
test/java/org/apache/cloudstack/api/response
core/src/main/java/com/cloud/agent/api/storage main/java/org/apache/cloudstack/storage/vmsnapshot test/java/org/apache/cloudstack/storage/vmsnapshot
volume/src/main/java/org/apache/cloudstack/storage/volume
main/java/org/apache/cloudstack/framework/config/impl test/java/org/apache/cloudstack/framework/config/impl
jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl
org/apache/cloudstack/utils/linux
test/java/com/cloud/hypervisor/kvm
storage/sharedfs/storagevm/src main/java/org/apache/cloudstack/storage/sharedfs/lifecycle test/java/org/apache/cloudstack/storage/sharedfs/lifecycle
user-authenticators/saml2/src main/java/org/apache/cloudstack/api/command test/java/org/apache/cloudstack/api/command
services/console-proxy/server/src/main/java/com/cloud/consoleproxy tools/checkstyle/src/main/resources
Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: PendingReleaseNotes +14Lines changed: 14 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -39,3 +39,17 @@ example.ver.1 > example.ver.2: | 39 | 39 | which can now be attached to Instances. This is to prevent the Secondary | 40 | 40 | Storage to grow to enormous sizes as Linux Distributions keep growing in | 41 | 41 | size while a stripped down Linux should fit on a 2.88MB floppy. | | 42 | + | | 43 | +4.22.0.0 > 4.22.0.1: | | 44 | + * Disk-only instance snapshots for KVM UEFI VMs now include a sidecar copy of | | 45 | + the active NVRAM state so revert operations restore both disk and firmware | | 46 | + boot state consistently. | | 47 | + | | 48 | + * UEFI disk-only instance snapshots taken before this change do not contain an | | 49 | + NVRAM sidecar and cannot be safely reverted. Take a new snapshot after | | 50 | + upgrading before relying on revert for UEFI VMs. | | 51 | + | | 52 | + * Taking a disk-only instance snapshot for KVM UEFI VMs now briefly suspends | | 53 | + the guest while the NVRAM sidecar is copied, so that the captured firmware | | 54 | + state is consistent with the disk snapshot. Non-UEFI VMs are unaffected and | | 55 | + continue to snapshot live. |
Collapse file Copy file name to clipboardExpand all lines: api/src/main/java/com/cloud/host/Host.java +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -55,6 +55,7 @@ public static String[] toStrings(Host.Type... types) { | 55 | 55 | } | 56 | 56 |
| 57 | 57 | String HOST_UEFI_ENABLE = "host.uefi.enable"; | | 58 | + String HOST_KVM_DISK_ONLY_VM_SNAPSHOT_NVRAM = "host.kvm.diskonlyvmsnapshot.nvram"; | 58 | 59 | String HOST_VOLUME_ENCRYPTION = "host.volume.encryption"; | 59 | 60 | String HOST_INSTANCE_CONVERSION = "host.instance.conversion"; | 60 | 61 | String HOST_VDDK_SUPPORT = "host.vddk.support"; | |
Collapse file Copy file name to clipboardExpand all lines: api/src/main/java/org/apache/cloudstack/api/command/user/vmsnapshot/CreateVMSnapshotCmd.java +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 36 | 36 | import com.cloud.uservm.UserVm; | 37 | 37 | import com.cloud.vm.snapshot.VMSnapshot; | 38 | 38 |
| 39 | | -@APICommand(name = "createVMSnapshot", description = "Creates Snapshot for an Instance.", responseObject = VMSnapshotResponse.class, since = "4.2.0", entityType = {VMSnapshot.class}, | | 39 | +@APICommand(name = "createVMSnapshot", description = "Creates Snapshot for an Instance. Running KVM UEFI disk-only snapshots briefly suspend the Instance while copying NVRAM state.", | | 40 | + responseObject = VMSnapshotResponse.class, since = "4.2.0", entityType = {VMSnapshot.class}, | 40 | 41 | requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) | 41 | 42 | public class CreateVMSnapshotCmd extends BaseAsyncCreateCmd { | 42 | 43 |
| |
Collapse file Copy file name to clipboardExpand all lines: api/src/main/java/org/apache/cloudstack/api/response/ImageStoreDetailResponse.java +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 16 | 16 | // under the License. | 17 | 17 | package org.apache.cloudstack.api.response; | 18 | 18 |
| | 19 | +import java.util.Objects; | | 20 | + | 19 | 21 | import com.google.gson.annotations.SerializedName; | 20 | 22 |
| 21 | 23 | import org.apache.cloudstack.api.BaseResponse; | @@ -81,7 +83,7 @@ public boolean equals(Object obj) { | 81 | 83 | return false; | 82 | 84 | } else if (!oid.equals(other.getName())) | 83 | 85 | return false; | 84 | | - else if (this.getValue().equals(other.getValue())) | | 86 | + else if (!Objects.equals(this.getValue(), other.getValue())) | 85 | 87 | return false; | 86 | 88 | return true; | 87 | 89 | } | |
Collapse file Copy file name to clipboardExpand all lines: api/src/main/java/org/apache/cloudstack/api/response/NetworkOfferingResponse.java +12Lines changed: 12 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -91,6 +91,10 @@ public class NetworkOfferingResponse extends BaseResponseWithAnnotations { | 91 | 91 | @Param(description = "The ID of the service offering used by virtual router provider") | 92 | 92 | private String serviceOfferingId; | 93 | 93 |
| | 94 | + @SerializedName(ApiConstants.SERVICE_OFFERING_NAME) | | 95 | + @Param(description = "the name of the service offering used by virtual router provider") | | 96 | + private String serviceOfferingName; | | 97 | + | 94 | 98 | @SerializedName(ApiConstants.SERVICE) | 95 | 99 | @Param(description = "The list of supported services", responseObject = ServiceResponse.class) | 96 | 100 | private List<ServiceResponse> services; | @@ -330,4 +334,12 @@ public String getRoutingMode() { | 330 | 334 | public void setRoutingMode(String routingMode) { | 331 | 335 | this.routingMode = routingMode; | 332 | 336 | } | | 337 | + | | 338 | + public String getServiceOfferingName() { | | 339 | + return serviceOfferingName; | | 340 | + } | | 341 | + | | 342 | + public void setServiceOfferingName(String serviceOfferingName) { | | 343 | + this.serviceOfferingName = serviceOfferingName; | | 344 | + } | 333 | 345 | } |
Collapse file Copy file name to clipboardExpand all lines: api/src/main/java/org/apache/cloudstack/api/response/ProjectResponse.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -452,7 +452,7 @@ public void setNetworkAvailable(String networkAvailable) { | 452 | 452 |
| 453 | 453 | @Override | 454 | 454 | public void setVpcLimit(String vpcLimit) { | 455 | | - this.vpcLimit = networkLimit; | | 455 | + this.vpcLimit = vpcLimit; | 456 | 456 | } | 457 | 457 |
| 458 | 458 | @Override | |
Collapse file Copy file name to clipboard +45Lines changed: 45 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +// Licensed to the Apache Software Foundation (ASF) under one | | 2 | +// or more contributor license agreements. See the NOTICE file | | 3 | +// distributed with this work for additional information | | 4 | +// regarding copyright ownership. The ASF licenses this file | | 5 | +// to you under the Apache License, Version 2.0 (the | | 6 | +// "License"); you may not use this file except in compliance | | 7 | +// with the License. You may obtain a copy of the License at | | 8 | +// | | 9 | +// http://www.apache.org/licenses/LICENSE-2.0 | | 10 | +// | | 11 | +// Unless required by applicable law or agreed to in writing, | | 12 | +// software distributed under the License is distributed on an | | 13 | +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | | 14 | +// KIND, either express or implied. See the License for the | | 15 | +// specific language governing permissions and limitations | | 16 | +// under the License. | | 17 | +package org.apache.cloudstack.api.response; | | 18 | + | | 19 | +import org.junit.Assert; | | 20 | +import org.junit.Test; | | 21 | + | | 22 | +public class ImageStoreDetailResponseTest { | | 23 | + | | 24 | + @Test | | 25 | + public void equalsIsTrueForSameNameAndValue() { | | 26 | + ImageStoreDetailResponse a = new ImageStoreDetailResponse("key", "value"); | | 27 | + ImageStoreDetailResponse b = new ImageStoreDetailResponse("key", "value"); | | 28 | + Assert.assertEquals(a, b); | | 29 | + Assert.assertEquals(a.hashCode(), b.hashCode()); | | 30 | + } | | 31 | + | | 32 | + @Test | | 33 | + public void equalsIsFalseWhenValueDiffers() { | | 34 | + ImageStoreDetailResponse a = new ImageStoreDetailResponse("key", "value"); | | 35 | + ImageStoreDetailResponse c = new ImageStoreDetailResponse("key", "other"); | | 36 | + Assert.assertNotEquals(a, c); | | 37 | + } | | 38 | + | | 39 | + @Test | | 40 | + public void equalsIsFalseWhenNameDiffers() { | | 41 | + ImageStoreDetailResponse a = new ImageStoreDetailResponse("key", "value"); | | 42 | + ImageStoreDetailResponse d = new ImageStoreDetailResponse("other", "value"); | | 43 | + Assert.assertNotEquals(a, d); | | 44 | + } | | 45 | +} |
Collapse file Copy file name to clipboard +34Lines changed: 34 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +// Licensed to the Apache Software Foundation (ASF) under one | | 2 | +// or more contributor license agreements. See the NOTICE file | | 3 | +// distributed with this work for additional information | | 4 | +// regarding copyright ownership. The ASF licenses this file | | 5 | +// to you under the Apache License, Version 2.0 (the | | 6 | +// "License"); you may not use this file except in compliance | | 7 | +// with the License. You may obtain a copy of the License at | | 8 | +// | | 9 | +// http://www.apache.org/licenses/LICENSE-2.0 | | 10 | +// | | 11 | +// Unless required by applicable law or agreed to in writing, | | 12 | +// software distributed under the License is distributed on an | | 13 | +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | | 14 | +// KIND, either express or implied. See the License for the | | 15 | +// specific language governing permissions and limitations | | 16 | +// under the License. | | 17 | +package org.apache.cloudstack.api.response; | | 18 | + | | 19 | +import org.junit.Assert; | | 20 | +import org.junit.Test; | | 21 | +import org.springframework.test.util.ReflectionTestUtils; | | 22 | + | | 23 | +public class ProjectResponseTest { | | 24 | + | | 25 | + @Test | | 26 | + public void setVpcLimitStoresItsOwnParameterNotTheNetworkLimit() { | | 27 | + ProjectResponse response = new ProjectResponse(); | | 28 | + response.setNetworkLimit("5"); | | 29 | + response.setVpcLimit("10"); | | 30 | + | | 31 | + Assert.assertEquals("10", ReflectionTestUtils.getField(response, "vpcLimit")); | | 32 | + Assert.assertEquals("5", ReflectionTestUtils.getField(response, "networkLimit")); | | 33 | + } | | 34 | +} |
Collapse file Copy file name to clipboardExpand all lines: core/src/main/java/com/cloud/agent/api/storage/CreateDiskOnlyVmSnapshotAnswer.java +11Lines changed: 11 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 26 | 26 | public class CreateDiskOnlyVmSnapshotAnswer extends Answer { | 27 | 27 |
| 28 | 28 | protected Map<String, Long> mapVolumeToSnapshotSize; | | 29 | + private String nvramSnapshotPath; | 29 | 30 |
| 30 | 31 | public CreateDiskOnlyVmSnapshotAnswer(Command command, boolean success, String details, Map<String, Long> mapVolumeToSnapshotSize) { | | 32 | + this(command, success, details, mapVolumeToSnapshotSize, null); | | 33 | + } | | 34 | + | | 35 | + public CreateDiskOnlyVmSnapshotAnswer(Command command, boolean success, String details, Map<String, Long> mapVolumeToSnapshotSize, | | 36 | + String nvramSnapshotPath) { | 31 | 37 | super(command, success, details); | 32 | 38 | this.mapVolumeToSnapshotSize = mapVolumeToSnapshotSize; | | 39 | + this.nvramSnapshotPath = nvramSnapshotPath; | 33 | 40 | } | 34 | 41 |
| 35 | 42 | public Map<String, Long> getMapVolumeToSnapshotSize() { | 36 | 43 | return mapVolumeToSnapshotSize; | 37 | 44 | } | | 45 | + | | 46 | + public String getNvramSnapshotPath() { | | 47 | + return nvramSnapshotPath; | | 48 | + } | 38 | 49 | } |
Collapse file Copy file name to clipboardExpand all lines: core/src/main/java/com/cloud/agent/api/storage/CreateDiskOnlyVmSnapshotCommand.java +17Lines changed: 17 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 30 | 30 | public class CreateDiskOnlyVmSnapshotCommand extends VMSnapshotBaseCommand { | 31 | 31 |
| 32 | 32 | protected VirtualMachine.State vmState; | | 33 | + private final String vmUuid; | | 34 | + private final boolean uefiEnabled; | 33 | 35 |
| 34 | 36 | List<Pair<VolumeObjectTO, String>> volumeTosAndNewPaths; | 35 | 37 |
| 36 | 38 | public CreateDiskOnlyVmSnapshotCommand(String vmName, VMSnapshotTO snapshot, List<Pair<VolumeObjectTO, String>> volumeTosAndNewPaths, String guestOSType, VirtualMachine.State vmState) { | | 39 | + this(vmName, null, snapshot, volumeTosAndNewPaths, guestOSType, vmState, false); | | 40 | + } | | 41 | + | | 42 | + public CreateDiskOnlyVmSnapshotCommand(String vmName, String vmUuid, VMSnapshotTO snapshot, List<Pair<VolumeObjectTO, String>> volumeTosAndNewPaths, String guestOSType, | | 43 | + VirtualMachine.State vmState, boolean uefiEnabled) { | 37 | 44 | super(vmName, snapshot, null, guestOSType); | | 45 | + this.vmUuid = vmUuid; | 38 | 46 | this.vmState = vmState; | 39 | 47 | this.volumeTosAndNewPaths = volumeTosAndNewPaths; | | 48 | + this.uefiEnabled = uefiEnabled; | 40 | 49 | } | 41 | 50 |
| 42 | 51 | public VirtualMachine.State getVmState() { | @@ -46,4 +55,12 @@ public VirtualMachine.State getVmState() { | 46 | 55 | public List<Pair<VolumeObjectTO, String>> getVolumeTosAndNewPaths() { | 47 | 56 | return volumeTosAndNewPaths; | 48 | 57 | } | | 58 | + | | 59 | + public String getVmUuid() { | | 60 | + return vmUuid; | | 61 | + } | | 62 | + | | 63 | + public boolean isUefiEnabled() { | | 64 | + return uefiEnabled; | | 65 | + } | 49 | 66 | } |
|