Bug 2167508

Summary: [4.10] Use consistent cache mode setting logic for hotplugged disks
Product: Container Native Virtualization (CNV) Reporter: Adam Litke <alitke>
Component: StorageAssignee: Alexander Wels <awels>
Status: CLOSED CURRENTRELEASE QA Contact: Yan Du <yadu>
Severity: high Docs Contact:
Priority: urgent    
Version: 4.10.7CC: dholler, fdeutsch, jpeimer, rgertzbe, shaselde, yadu
Target Milestone: ---   
Target Release: 4.10.8   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 4.10.8-30 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-08 10:39:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Adam Litke 2023-02-06 20:37:28 UTC
Description of problem:

When hot plugging a disk the cache mode is not set explicitly which can result in a default cache mode being used.  We would like to use the same logic for hot plugged disks as for conventionally attached disks which is to prefer cache=none when the underlying storage supports direct IO.  


Version-Release number of selected component (if applicable): 4.10.7


How reproducible: Always


Steps to Reproduce:
1. Create VM
2. Start VM
3. Hotplug a disk
4. Use `oc rsh` to connect to the appropriate virt-launcher Pod
5. Execute `virsh dumpxml 1`

Actual results: The xml shows a cache mode other than 'none' for the hotplug disk


Expected results: The cache mode should be set to 'none'


Additional info:

Comment 2 Yan Du 2023-03-01 05:13:47 UTC
Test on CNV-v4.10.8-37, cache mode is none


    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' error_policy='stop' io='native' discard='unmap'/>
      <source dev='/var/run/kubevirt/hotplug-disks/blank-dv' index='3'/>

Comment 3 Itamar Holder 2023-03-28 13:45:36 UTC
*** Bug 2162140 has been marked as a duplicate of this bug. ***