add logging for debugging.

The default value for local.storage.path does not exists by
default in CentOS 6. By default, this results in NullPointerException
silently. Without this log message, administrator can't figure out
the reason at all.

Signed-off-by: Edison Su <sudison@gmail.com>
This commit is contained in:
Hiroaki Kawai 2012-09-18 18:26:34 -07:00 committed by Edison Su
parent e662790985
commit a6aebe098e

View File

@ -213,10 +213,11 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
}
}
private StoragePool CreateSharedStoragePool(Connect conn, String uuid,
private StoragePool createSharedStoragePool(Connect conn, String uuid,
String host, String path) {
String mountPoint = path;
if (!_storageLayer.exists(mountPoint)) {
s_logger.error(mountPath + " does not exists. Check local.storage.path in agent.properties.");
return null;
}
LibvirtStoragePoolDef spd = new LibvirtStoragePoolDef(poolType.DIR,
@ -550,7 +551,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
sp = createNfsStoragePool(conn, name, host, path);
} else if (type == StoragePoolType.SharedMountPoint
|| type == StoragePoolType.Filesystem) {
sp = CreateSharedStoragePool(conn, name, host, path);
sp = createSharedStoragePool(conn, name, host, path);
} else if (type == StoragePoolType.RBD) {
sp = createRBDStoragePool(conn, name, host, port, userInfo, path);
} else if (type == StoragePoolType.CLVM) {