Skip to content

Commit 73c4e83

Browse files
author
Anthony Xu
committed
make sure volumeUuid is not full path
1 parent 7cd4319 commit 73c4e83

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,13 @@ public KVMPhysicalDisk createPhysicalDisk(String name, long size) {
123123
}
124124

125125
@Override
126-
public KVMPhysicalDisk getPhysicalDisk(String volumeUuid) {
126+
public KVMPhysicalDisk getPhysicalDisk(String volumeUid) {
127127
KVMPhysicalDisk disk = null;
128+
String volumeUuid = volumeUid;
129+
if ( volumeUid.contains("/") ) {
130+
String[] tokens = volumeUid.split("/");
131+
volumeUuid = tokens[tokens.length -1];
132+
}
128133
try {
129134
disk = this._storageAdaptor.getPhysicalDisk(volumeUuid, this);
130135
} catch (CloudRuntimeException e) {

0 commit comments

Comments
 (0)