From 5e067db78ca7a6645a01b0cc52b62eec61b0002a Mon Sep 17 00:00:00 2001 From: Edison Su Date: Mon, 19 Mar 2012 13:58:55 -0700 Subject: [PATCH] in 2.2.x, the absolute path is stored in volume path, while in 3.0.x, only the uuid of volume is used. To be compatible with 2.2.x --- .../src/com/cloud/agent/storage/LibvirtStorageAdaptor.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/agent/src/com/cloud/agent/storage/LibvirtStorageAdaptor.java b/agent/src/com/cloud/agent/storage/LibvirtStorageAdaptor.java index 90db1bd0cf5..fa9543c757c 100644 --- a/agent/src/com/cloud/agent/storage/LibvirtStorageAdaptor.java +++ b/agent/src/com/cloud/agent/storage/LibvirtStorageAdaptor.java @@ -445,7 +445,11 @@ public class LibvirtStorageAdaptor implements StorageAdaptor { public KVMPhysicalDisk getPhysicalDisk(String volumeUuid, KVMStoragePool pool) { LibvirtStoragePool libvirtPool = (LibvirtStoragePool) pool; - + String[] volPaths = volumeUuid.split("/"); + if (volPaths.length == 4) { + //to compatible with 2.2.x, volume path is passed in + volumeUuid = volPaths[3]; + } try { StorageVol vol = this.getVolume(libvirtPool.getPool(), volumeUuid); KVMPhysicalDisk disk;