[libvirt] [PATCH 2/2] storage: Force setting of disk format type
Pavel Hrdina
phrdina at redhat.com
Tue Jun 23 13:23:46 UTC 2015
On Mon, Jun 08, 2015 at 08:25:22AM -0400, John Ferlan wrote:
> 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.
>
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
> 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 c4bd6fe..b016c4f 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);
> --
> 2.1.0
>
ACK
Pavel
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
More information about the libvir-list
mailing list