[libvirt PATCH] qemu: virtiofs: cache: use 'never' instead of 'none'

Ján Tomko posted 1 patch 3 months, 1 week ago
src/qemu/qemu_virtiofs.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
[libvirt PATCH] qemu: virtiofs: cache: use 'never' instead of 'none'
Posted by Ján Tomko 3 months, 1 week ago
The new option style renamed one of the cache modes.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
 src/qemu/qemu_virtiofs.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c
index 703f1226a2..db987ddfe1 100644
--- a/src/qemu/qemu_virtiofs.c
+++ b/src/qemu/qemu_virtiofs.c
@@ -147,10 +147,19 @@ qemuVirtioFSBuildCommandLine(virQEMUDriverConfig *cfg,
         virCommandAddArg(cmd, "--shared-dir");
         virCommandAddArg(cmd, fs->src->path);
 
-        if (fs->cache) {
+        switch (fs->cache) {
+        case VIR_DOMAIN_FS_CACHE_MODE_DEFAULT:
+            break;
+        case VIR_DOMAIN_FS_CACHE_MODE_NONE:
+            virCommandAddArg(cmd, "--cache");
+            virCommandAddArg(cmd, "never");
+            break;
+        case VIR_DOMAIN_FS_CACHE_MODE_ALWAYS:
             virCommandAddArg(cmd, "--cache");
             virCommandAddArg(cmd, virDomainFSCacheModeTypeToString(fs->cache));
+            break;
         }
+
         if (fs->sandbox) {
             virCommandAddArg(cmd, "--sandbox");
             virCommandAddArg(cmd, virDomainFSSandboxModeTypeToString(fs->sandbox));
-- 
2.45.2
Re: [libvirt PATCH] qemu: virtiofs: cache: use 'never' instead of 'none'
Posted by Michal Prívozník 3 months, 1 week ago
On 7/23/24 14:24, Ján Tomko wrote:
> The new option style renamed one of the cache modes.
> 
> Signed-off-by: Ján Tomko <jtomko@redhat.com>
> ---
>  src/qemu/qemu_virtiofs.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal