diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backend_disk.c index 80f9dd1ff49ea76cc2142f470c102e7a22824b12..82d6e8a5b443f38fdbd8eb869de17fb87e4525e1 100644 --- a/src/storage/storage_backend_disk.c +++ b/src/storage/storage_backend_disk.c @@ -262,7 +262,6 @@ static int virStorageBackendDiskReadPartitions(virStoragePoolObjPtr pool, virStorageVolDefPtr vol) { - /* * # libvirt_parthelper DEVICE * /dev/sda1 normal data 32256 106928128 106896384 @@ -320,6 +319,13 @@ virStorageBackendDiskRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED, virFileWaitForDevices(); + if (!virFileExists(pool->def->source.devices[0].path)) { + virStorageReportError(VIR_ERR_INVALID_ARG, + _("device path '%s' doesn't exist"), + pool->def->source.devices[0].path); + return -1; + } + if (virStorageBackendDiskReadGeometry(pool) != 0) { return -1; }