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

This commit is contained in:
Edison Su 2012-03-19 13:58:55 -07:00
parent 46f09b3c34
commit 5e067db78c
1 changed files with 5 additions and 1 deletions

View File

@ -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;