mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-22 13:34:07 +03:00
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 <crobinso@redhat.com>
This commit is contained in:
parent
2676640979
commit
9e133de21a
@ -206,7 +206,7 @@
|
||||
<target dev="sdae" bus="scsi" rotation_rate="6000"/>
|
||||
</disk>
|
||||
<disk type="network" device="disk">
|
||||
<driver name="qemu"/>
|
||||
<driver name="qemu" type="raw"/>
|
||||
<source protocol="iscsi" name="iqn.2017-12.com.virttest:emulated-iscsi-noauth.target2-lun-1">
|
||||
<host name="10.66.144.87"/>
|
||||
</source>
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user