Skip to content

Commit 1f28e64

Browse files
author
Marcus Sorensen
committed
Summary: Remove unused createFileBasedStoragePool from LibvirtStorageAdaptor
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1363154115 -0600
1 parent 6715f98 commit 1f28e64

1 file changed

Lines changed: 0 additions & 52 deletions

File tree

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

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -293,58 +293,6 @@ public LibvirtStorageVolumeDef getStorageVolumeDef(Connect conn,
293293
return parser.parseStorageVolumeXML(volDefXML);
294294
}
295295

296-
public StoragePool createFileBasedStoragePool(Connect conn,
297-
String localStoragePath, String uuid) {
298-
if (!(_storageLayer.exists(localStoragePath) && _storageLayer
299-
.isDirectory(localStoragePath))) {
300-
return null;
301-
}
302-
303-
File path = new File(localStoragePath);
304-
if (!(path.canWrite() && path.canRead() && path.canExecute())) {
305-
return null;
306-
}
307-
308-
StoragePool pool = null;
309-
310-
try {
311-
pool = conn.storagePoolLookupByUUIDString(uuid);
312-
} catch (LibvirtException e) {
313-
314-
}
315-
316-
if (pool == null) {
317-
LibvirtStoragePoolDef spd = new LibvirtStoragePoolDef(poolType.DIR,
318-
uuid, uuid, null, null, localStoragePath);
319-
try {
320-
pool = conn.storagePoolDefineXML(spd.toString(), 0);
321-
pool.create(0);
322-
} catch (LibvirtException e) {
323-
if (pool != null) {
324-
try {
325-
pool.destroy();
326-
pool.undefine();
327-
} catch (LibvirtException e1) {
328-
}
329-
pool = null;
330-
}
331-
throw new CloudRuntimeException(e.toString());
332-
}
333-
}
334-
335-
try {
336-
StoragePoolInfo spi = pool.getInfo();
337-
if (spi.state != StoragePoolState.VIR_STORAGE_POOL_RUNNING) {
338-
pool.create(0);
339-
}
340-
341-
} catch (LibvirtException e) {
342-
throw new CloudRuntimeException(e.toString());
343-
}
344-
345-
return pool;
346-
}
347-
348296
@Override
349297
public KVMStoragePool getStoragePool(String uuid) {
350298
StoragePool storage = null;

0 commit comments

Comments
 (0)