From 9e133de21af7368c64f1fc651207ac48b82770f2 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 19 Jan 2022 14:19:56 -0500 Subject: diskbackend: Restrict format->driver_type even more We should only be returning a driver_type value for volumes that report support_format(), meaning they support file type formats like qcow2. Any other reported format should be ignored Dropping the check for 'unknown' value changes one test case a bit, but it hardcodes raw which is what libvirt gives us anyways, so it's okay Signed-off-by: Cole Robinson --- tests/data/cli/compare/virt-install-many-devices.xml | 2 +- virtinst/diskbackend.py | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml index f68ae2c2..438c5375 100644 --- a/tests/data/cli/compare/virt-install-many-devices.xml +++ b/tests/data/cli/compare/virt-install-many-devices.xml @@ -206,7 +206,7 @@ - + diff --git a/virtinst/diskbackend.py b/virtinst/diskbackend.py index eaa9d2f6..0c0620cf 100644 --- a/virtinst/diskbackend.py +++ b/virtinst/diskbackend.py @@ -787,12 +787,9 @@ class StorageBackend(_StorageBase): def get_driver_type(self): if self._vol_object: - if self.get_parent_pool_xml().type != "disk": - ret = self.get_vol_xml().format - if ret != "unknown": - return ret - else: - return "raw" + if self.get_vol_xml().supports_format(): + return self.get_vol_xml().format + return "raw" return None def validate(self): -- cgit v1.2.1