https://bugzilla.redhat.com/show_bug.cgi?id=
1464313
If a Disk pool was defined/created using XML that either didn't
specify a specific format or specified format type='unknown', then
restarting a pool after an initial disk backend build with overwrite
would fail after a libvirtd restart for a non-autostarted pool.
This is because the persistent pool data is not updated during pool
build w/ overwrite processing to have the VIR_STORAGE_POOL_DISK_DOS
default format.
So in addition to the alteration done during disk build processing,
alter the default expectation for disk startup to be DOS if nothing
has been defined yet. That will either succeed if the pool had been
successfully built previously using the default DOS format or fail
with a message indicating the format is something else that does not
match the expect format 'dos'.
virStorageBackendDiskStartPool(virConnectPtr conn ATTRIBUTE_UNUSED,
virStoragePoolObjPtr pool)
{
- const char *format =
- virStoragePoolFormatDiskTypeToString(pool->def->source.format);
+ const char *format;
const char *path = pool->def->source.devices[0].path;
virWaitForDevices();
return -1;
}
+ if (pool->def->source.format == VIR_STORAGE_POOL_DISK_UNKNOWN)
+ pool->def->source.format = VIR_STORAGE_POOL_DISK_DOS;
+ format = virStoragePoolFormatDiskTypeToString(pool->def->source.format);
if (!virStorageBackendDeviceIsEmpty(path, format, false))
return -1;