Signed-off-by: Markus Frank <[email protected]>
---
 src/PVE/QemuServer/Virtiofs.pm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/PVE/QemuServer/Virtiofs.pm b/src/PVE/QemuServer/Virtiofs.pm
index ee6cee33..b820ad27 100644
--- a/src/PVE/QemuServer/Virtiofs.pm
+++ b/src/PVE/QemuServer/Virtiofs.pm
@@ -47,6 +47,12 @@ my $virtiofs_fmt = {
         default => 0,
         optional => 1,
     },
+    'readonly' => {
+        type => 'boolean',
+        description => "Prevent write accesses from the guest.",
+        default => 0,
+        optional => 1,
+    },
     'expose-xattr' => {
         type => 'boolean',
         description => "Enable support for extended attributes for this 
mount.",
@@ -192,6 +198,7 @@ sub start_virtiofsd {
                 if $virtiofs->{'thread-pool-size'};
             push @$cmd, '--announce-submounts';
             push @$cmd, '--allow-direct-io' if $virtiofs->{'direct-io'};
+            push @$cmd, '--readonly' if $virtiofs->{readonly};
             push @$cmd, '--cache=' . $virtiofs->{cache} if $virtiofs->{cache};
             push @$cmd, '--inode-file-handles=prefer' if $prefer_inode_fh;
             push @$cmd, '--syslog';
-- 
2.47.3



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to