提交 9538dff9 编写于 作者: P Peter Krempa

Revert "storage: For FS pool check for properly formatted target volume"

The check does not work properly (crashes) with netfs filesystems and
also checking that a device is not empty when attempting to mount a
filesystem is not very usefull since the mount will fail anyways.

As the code would improve only a very minor corner case I don't really
see a reason to have this code at all.

This code would also fail if libvirt is compiled without support for
blkid and without parted.

This reverts commit a11fd697.
上级 ecb587e4
......@@ -605,17 +605,8 @@ static int
virStorageBackendFileSystemStart(virConnectPtr conn ATTRIBUTE_UNUSED,
virStoragePoolObjPtr pool)
{
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)
if (pool->def->type != VIR_STORAGE_POOL_DIR &&
virStorageBackendFileSystemMount(pool) < 0)
return -1;
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册