From f691b4eead9b38e9b72e869121a094640dec8027 Mon Sep 17 00:00:00 2001 From: Aihua Liang Date: Fri, 1 Nov 2024 14:56:28 +0800 Subject: [PATCH] storage_volume: set direct=on for image_aio=native When setting image_aio to native, cache.direct:on is required. Signed-off-by: Aihua Liang --- provider/virt_storage/storage_volume.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/provider/virt_storage/storage_volume.py b/provider/virt_storage/storage_volume.py index c4350c1b6b..76ac6b07f6 100644 --- a/provider/virt_storage/storage_volume.py +++ b/provider/virt_storage/storage_volume.py @@ -191,6 +191,10 @@ def refresh_protocol_by_params(self, params): discard = params.get("image_discard_request", "unmap") self.protocol.set_param("auto-read-only", auto_readonly) self.protocol.set_param("discard", discard) + # image_aio:native requires cache.direct:on + if params.get("image_aio") == "native": + self.protocol.set_param("cache.direct", "on") + self.protocol.set_param("cache.no-flush", "off") def info(self): out = dict()