From 31d3af6fea43c4dff67368414a23c3c856c9a4f0 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Mon, 8 Jun 2015 08:16:58 -0400 Subject: [PATCH] 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. --- src/storage/storage_backend_disk.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backend_disk.c index a283a86bb4..ba70a5a4be 100644 --- a/src/storage/storage_backend_disk.c +++ b/src/storage/storage_backend_disk.c @@ -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);