Skip to content

Commit

Permalink
storage_volume: set direct=on for image_aio=native
Browse files Browse the repository at this point in the history
When setting image_aio to native, cache.direct:on
is required.

Signed-off-by: Aihua Liang <[email protected]>
  • Loading branch information
aliang123 committed Nov 5, 2024
1 parent 9a57983 commit 1301624
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions provider/virt_storage/storage_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ 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":
direct = params.get("image_cache_direct", "on")
no_flush = params.get("image_cache_no_flush", "off")
self.protocol.set_param("cache.direct", direct)
self.protocol.set_param("cache.no-flush", no_flush)

def info(self):
out = dict()
Expand Down

0 comments on commit 1301624

Please sign in to comment.