1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

storage: Force setting of disk format type

Commit id '832a9256' adjusted the code to recognize when the default
type of "unknown" was provided as the format type and to use "dos" if
found. Since the pool is built with "dos" and it could cause some
confusion when formatting the XML after building by seeing "unknown"
in the output, let's just adjust the pool's setting to "dos" so that
subsequent formats will see the value.
This commit is contained in:
John Ferlan 2015-06-08 08:16:58 -04:00
parent f153832266
commit 31d3af6fea

View File

@ -472,8 +472,9 @@ virStorageBackendDiskBuildPool(virConnectPtr conn ATTRIBUTE_UNUSED,
/* eg parted /dev/sda mklabel --script msdos */
int format = pool->def->source.format;
const char *fmt;
if (format == VIR_STORAGE_POOL_DISK_UNKNOWN ||
format == VIR_STORAGE_POOL_DISK_DOS)
if (format == VIR_STORAGE_POOL_DISK_UNKNOWN)
format = pool->def->source.format = VIR_STORAGE_POOL_DISK_DOS;
if (format == VIR_STORAGE_POOL_DISK_DOS)
fmt = "msdos";
else
fmt = virStoragePoolFormatDiskTypeToString(format);