Skip to content

Commit ea50c66

Browse files
committed
CLOUDSTACK-2729: use spd.getTargetPath instead of mount path to fix issue on local storage
(cherry picked from commit b2ed632)
1 parent caa9d27 commit ea50c66

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,15 +1173,17 @@ private void refreshPool(StoragePool pool) throws LibvirtException {
11731173
pool.refresh(0);
11741174
return;
11751175
}
1176-
String lockFile = _mountPoint + File.separator + pool.getUUIDString() + File.separator + _lockfile;
1176+
String lockFile = spd.getTargetPath() + File.separator + _lockfile;
1177+
s_logger.debug("Attempting to lock pool " + pool.getName() + " with file " + lockFile);
11771178
if (lock(lockFile, 30)) {
11781179
try {
11791180
pool.refresh(0);
11801181
} finally {
1182+
s_logger.debug("Releasing the lock on pool " + pool.getName() + " with file " + lockFile);
11811183
unlock(lockFile);
11821184
}
11831185
} else {
1184-
throw new CloudRuntimeException("Can not get file lock to refresh the pool " + pool.getUUIDString());
1186+
throw new CloudRuntimeException("Can not get file lock to refresh the pool " + pool.getName());
11851187
}
11861188
}
11871189

@@ -1192,14 +1194,16 @@ private void deleteVol(LibvirtStoragePool pool, StorageVol vol) throws LibvirtEx
11921194
return;
11931195
}
11941196
String lockFile = pool.getLocalPath() + File.separator + _lockfile;
1197+
s_logger.debug("Attempting to lock pool " + pool.getName() + " with file " + lockFile);
11951198
if (lock(lockFile, 30)) {
11961199
try {
11971200
vol.delete(0);
11981201
} finally {
1202+
s_logger.debug("Releasing the lock on pool " + pool.getName() + " with file " + lockFile);
11991203
unlock(lockFile);
12001204
}
12011205
} else {
1202-
throw new CloudRuntimeException("Can not get file lock to delete the volume " + vol.getPath());
1206+
throw new CloudRuntimeException("Can not get file lock to delete the volume " + vol.getName());
12031207
}
12041208
}
12051209

0 commit comments

Comments
 (0)