Skip to content

Commit d3d2716

Browse files
committed
Address review comments
1 parent 2a6fbbe commit d3d2716

File tree

5 files changed

+25
-19
lines changed

5 files changed

+25
-19
lines changed

api/src/main/java/com/cloud/host/Host.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,12 @@ public static String[] toStrings(Host.Type... types) {
5353
return strs;
5454
}
5555
}
56-
public static final String HOST_UEFI_ENABLE = "host.uefi.enable";
57-
public static final String HOST_VOLUME_ENCRYPTION = "host.volume.encryption";
58-
public static final String HOST_INSTANCE_CONVERSION = "host.instance.conversion";
5956

60-
// Vmware to KVM Migration
61-
String KVM_HOST_OVFTOOL_VERSION = "kvm.host.ovftool.version";
62-
String KVM_HOST_VIRTV2V_VERSION = "kvm.host.virtv2v.version";
57+
String HOST_UEFI_ENABLE = "host.uefi.enable";
58+
String HOST_VOLUME_ENCRYPTION = "host.volume.encryption";
59+
String HOST_INSTANCE_CONVERSION = "host.instance.conversion";
60+
String HOST_OVFTOOL_VERSION = "host.ovftool.version";
61+
String HOST_VIRTV2V_VERSION = "host.virtv2v.version";
6362

6463
/**
6564
* @return name of the machine.

engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -704,8 +704,8 @@ protected AgentAttache notifyMonitorsOfConnection(final AgentAttache attache, fi
704704
Map<String, String> detailsMap = readyAnswer.getDetailsMap();
705705
if (detailsMap != null) {
706706
String uefiEnabled = detailsMap.get(Host.HOST_UEFI_ENABLE);
707-
String virtv2vVersion = detailsMap.get(Host.KVM_HOST_VIRTV2V_VERSION);
708-
String ovftoolVersion = detailsMap.get(Host.KVM_HOST_OVFTOOL_VERSION);
707+
String virtv2vVersion = detailsMap.get(Host.HOST_VIRTV2V_VERSION);
708+
String ovftoolVersion = detailsMap.get(Host.HOST_OVFTOOL_VERSION);
709709
logger.debug("Got HOST_UEFI_ENABLE [{}] for host [{}]:", uefiEnabled, host);
710710
if (ObjectUtils.anyNotNull(uefiEnabled, virtv2vVersion, ovftoolVersion)) {
711711
_hostDao.loadDetails(host);
@@ -714,12 +714,12 @@ protected AgentAttache notifyMonitorsOfConnection(final AgentAttache attache, fi
714714
host.getDetails().put(Host.HOST_UEFI_ENABLE, uefiEnabled);
715715
updateNeeded = true;
716716
}
717-
if (StringUtils.isNotBlank(virtv2vVersion) && !virtv2vVersion.equals(host.getDetails().get(Host.KVM_HOST_VIRTV2V_VERSION))) {
718-
host.getDetails().put(Host.KVM_HOST_VIRTV2V_VERSION, virtv2vVersion);
717+
if (StringUtils.isNotBlank(virtv2vVersion) && !virtv2vVersion.equals(host.getDetails().get(Host.HOST_VIRTV2V_VERSION))) {
718+
host.getDetails().put(Host.HOST_VIRTV2V_VERSION, virtv2vVersion);
719719
updateNeeded = true;
720720
}
721-
if (StringUtils.isNotBlank(ovftoolVersion) && !ovftoolVersion.equals(host.getDetails().get(Host.KVM_HOST_OVFTOOL_VERSION))) {
722-
host.getDetails().put(Host.KVM_HOST_OVFTOOL_VERSION, ovftoolVersion);
721+
if (StringUtils.isNotBlank(ovftoolVersion) && !ovftoolVersion.equals(host.getDetails().get(Host.HOST_OVFTOOL_VERSION))) {
722+
host.getDetails().put(Host.HOST_OVFTOOL_VERSION, ovftoolVersion);
723723
updateNeeded = true;
724724
}
725725
if (updateNeeded) {

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
package com.cloud.hypervisor.kvm.resource;
1818

1919
import static com.cloud.host.Host.HOST_INSTANCE_CONVERSION;
20+
import static com.cloud.host.Host.HOST_OVFTOOL_VERSION;
21+
import static com.cloud.host.Host.HOST_VIRTV2V_VERSION;
2022
import static com.cloud.host.Host.HOST_VOLUME_ENCRYPTION;
2123

2224
import java.io.BufferedReader;
@@ -3766,7 +3768,12 @@ public StartupCommand[] initialize() {
37663768
cmd.setIqn(getIqn());
37673769
cmd.getHostDetails().put(HOST_VOLUME_ENCRYPTION, String.valueOf(hostSupportsVolumeEncryption()));
37683770
cmd.setHostTags(getHostTags());
3769-
cmd.getHostDetails().put(HOST_INSTANCE_CONVERSION, String.valueOf(hostSupportsInstanceConversion()));
3771+
boolean instanceConversionSupported = hostSupportsInstanceConversion();
3772+
cmd.getHostDetails().put(HOST_INSTANCE_CONVERSION, String.valueOf(instanceConversionSupported));
3773+
if (instanceConversionSupported) {
3774+
cmd.getHostDetails().put(HOST_VIRTV2V_VERSION, getHostVirtV2vVersion());
3775+
cmd.getHostDetails().put(HOST_OVFTOOL_VERSION, getHostOvfToolVersion());
3776+
}
37703777
HealthCheckResult healthCheckResult = getHostHealthCheckResult();
37713778
if (healthCheckResult != HealthCheckResult.IGNORE) {
37723779
cmd.setHostHealthCheckResult(healthCheckResult == HealthCheckResult.SUCCESS);

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtReadyCommandWrapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ public Answer execute(final ReadyCommand command, final LibvirtComputingResource
4848
}
4949

5050
if (libvirtComputingResource.hostSupportsInstanceConversion()) {
51-
hostDetails.put(Host.KVM_HOST_VIRTV2V_VERSION, libvirtComputingResource.getHostVirtV2vVersion());
51+
hostDetails.put(Host.HOST_VIRTV2V_VERSION, libvirtComputingResource.getHostVirtV2vVersion());
5252
}
5353

5454
if (libvirtComputingResource.hostSupportsOvfExport()) {
55-
hostDetails.put(Host.KVM_HOST_OVFTOOL_VERSION, libvirtComputingResource.getHostOvfToolVersion());
55+
hostDetails.put(Host.HOST_OVFTOOL_VERSION, libvirtComputingResource.getHostOvfToolVersion());
5656
}
5757

5858
return new ReadyAnswer(command, hostDetails);

ui/src/views/tools/ImportUnmanagedInstance.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -944,11 +944,11 @@ export default {
944944
} else {
945945
host.name = host.name + ' (' + this.$t('label.not.supported') + ')'
946946
}
947-
if (host.details['kvm.host.virtv2v.version']) {
948-
host.name = host.name + ' (virt-v2v=' + host.details['kvm.host.virtv2v.version'] + ')'
947+
if (host.details['host.virtv2v.version']) {
948+
host.name = host.name + ' (virt-v2v=' + host.details['host.virtv2v.version'] + ')'
949949
}
950-
if (host.details['kvm.host.ovftool.version']) {
951-
host.name = host.name + ' (ovftool=' + host.details['kvm.host.ovftool.version'] + ')'
950+
if (host.details['host.ovftool.version']) {
951+
host.name = host.name + ' (ovftool=' + host.details['host.ovftool.version'] + ')'
952952
}
953953
})
954954
})

0 commit comments

Comments
 (0)