weizhouapache commented on code in PR #9212:
URL: https://github.com/apache/cloudstack/pull/9212#discussion_r1634499005
##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java:
##########
@@ -702,6 +711,81 @@ private String
getNewVolumePathIfDatastoreHasChanged(LibvirtComputingResource li
return newIsoVolumePath;
}
+ private String getOldVolumePathForCdrom(List<DiskDef> disks, String
vmName) {
+ String oldIsoVolumePath = null;
+ for (DiskDef disk : disks) {
+ if (DiskDef.DeviceType.CDROM.equals(disk.getDeviceType())
+ && CDROM_LABEL.equals(disk.getDiskLabel())
+ && disk.getDiskPath() != null) {
+ oldIsoVolumePath = disk.getDiskPath();
+ break;
+ }
+ }
+ return oldIsoVolumePath;
+ }
+
+ private String getNewVolumePathForCdrom(LibvirtComputingResource
libvirtComputingResource, Connect conn, VirtualMachineTO to) throws
LibvirtException, URISyntaxException {
+ DiskTO newDisk = null;
+ for (DiskTO disk : to.getDisks()) {
+ DataTO data = disk.getData();
+ if (disk.getDiskSeq() == 3 && data != null && data.getPath() !=
null) {
+ newDisk = disk;
+ break;
+ }
+ }
+
+ String newIsoVolumePath = null;
+ if (newDisk != null) {
+ newIsoVolumePath = libvirtComputingResource.getVolumePath(conn,
newDisk);
+ }
+ return newIsoVolumePath;
+ }
+
+ protected String replaceCdromIsoPath(String xmlDesc, String vmName, String
oldIsoVolumePath, String newIsoVolumePath) throws IOException,
ParserConfigurationException, TransformerException, SAXException {
Review Comment:
right, it is complex ..
the other replacements in same java file use the similar way ...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]