mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
storage: For FS pool check for properly formatted target volume
Prior to starting up, let's be sure the target volume device is formatted as we expect; otherwise, inhibit the start. Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
19ced38f1c
commit
a11fd69735
@ -605,8 +605,17 @@ static int
|
||||
virStorageBackendFileSystemStart(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
virStoragePoolObjPtr pool)
|
||||
{
|
||||
if (pool->def->type != VIR_STORAGE_POOL_DIR &&
|
||||
virStorageBackendFileSystemMount(pool) < 0)
|
||||
const char *format =
|
||||
virStoragePoolFormatFileSystemTypeToString(pool->def->source.format);
|
||||
const char *path = pool->def->source.devices[0].path;
|
||||
|
||||
if (pool->def->type == VIR_STORAGE_POOL_DIR)
|
||||
return 0;
|
||||
|
||||
if (!virStorageBackendDeviceIsEmpty(path, format, false))
|
||||
return -1;
|
||||
|
||||
if (virStorageBackendFileSystemMount(pool) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user