You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/06/18 21:17:31 UTC

[GitHub] [cloudstack] slavkap commented on a change in pull request #4572: fix of detach volume while OS is in boot state

slavkap commented on a change in pull request #4572:
URL: https://github.com/apache/cloudstack/pull/4572#discussion_r654210477



##########
File path: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
##########
@@ -1166,6 +1167,14 @@ protected synchronized String attachOrDetachDevice(final Connect conn, final boo
             } else {
                 s_logger.debug("Detaching device: " + xml);
                 dm.detachDevice(xml);
+                LibvirtDomainXMLParser parser = new LibvirtDomainXMLParser();
+                parser.parseDomainXML(dm.getXMLDesc(0));
+                List<DiskDef> disks = parser.getDisks();
+                for (DiskDef diskDef : disks) {
+                    if (StringUtils.contains(xml, diskDef.getDiskPath())) {

Review comment:
       @sureshanaparti, sorry for the late response, but I didn't have time to check it yesterday! The change is applied only to detach a volume when the VM is in Running or Stopped state




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org