* [PATCH guest-common v2 1/11] mapping: dir: add 'live-migration-method' parameter
2026-02-23 15:39 [PATCH guest-common/qemu-server/docs/manager v2 0/11] Virtiofs improvements Markus Frank
@ 2026-02-23 15:39 ` Markus Frank
2026-02-23 15:39 ` [PATCH qemu-server v2 2/11] fix #6370: virtiofs: add support for thread-pool-size option Markus Frank
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Markus Frank @ 2026-02-23 15:39 UTC (permalink / raw)
To: pve-devel
If a live migration method is selected, qemu-server starts virtiofsd
with the flags to enable live migration using the chosen method.
Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
src/PVE/Mapping/Dir.pm | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/PVE/Mapping/Dir.pm b/src/PVE/Mapping/Dir.pm
index 5ff02d1..a7d4c05 100644
--- a/src/PVE/Mapping/Dir.pm
+++ b/src/PVE/Mapping/Dir.pm
@@ -74,6 +74,15 @@ my $defaultData = {
description => "The ID of the directory mapping",
format => 'pve-configid',
},
+ 'live-migration-method' => {
+ description => "Allow live-migration when using the directory with a virtiofs device."
+ ." Ensure you are using the same shared directory on all hosts."
+ ." Available migration methods are 'file-handles' and 'find-path'.",
+ type => 'string',
+ optional => 1,
+ default => 'file-handles',
+ enum => ['file-handles', 'find-paths'],
+ },
description => {
type => 'string',
description => "Description of the directory mapping",
@@ -99,6 +108,7 @@ sub private {
sub options {
return {
description => { optional => 1 },
+ 'live-migration-method' => { optional => 1 },
map => {},
};
}
--
2.47.3
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH qemu-server v2 2/11] fix #6370: virtiofs: add support for thread-pool-size option
2026-02-23 15:39 [PATCH guest-common/qemu-server/docs/manager v2 0/11] Virtiofs improvements Markus Frank
2026-02-23 15:39 ` [PATCH guest-common v2 1/11] mapping: dir: add 'live-migration-method' parameter Markus Frank
@ 2026-02-23 15:39 ` Markus Frank
2026-02-23 15:40 ` [PATCH qemu-server v2 3/11] virtiofs: add readonly option Markus Frank
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Markus Frank @ 2026-02-23 15:39 UTC (permalink / raw)
To: pve-devel
Allows tuning the number of worker threads used by virtiofsd.
Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
src/PVE/QemuServer/Virtiofs.pm | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/PVE/QemuServer/Virtiofs.pm b/src/PVE/QemuServer/Virtiofs.pm
index b181db5f..cd95470d 100644
--- a/src/PVE/QemuServer/Virtiofs.pm
+++ b/src/PVE/QemuServer/Virtiofs.pm
@@ -60,6 +60,14 @@ my $virtiofs_fmt = {
default => 0,
optional => 1,
},
+ 'thread-pool-size' => {
+ type => 'integer',
+ description => "Controls the maximum number of worker threads used by virtiofsd to"
+ . " handle requests. A value of '0' disables the thread pool.",
+ default => 0,
+ minimum => 0,
+ optional => 1,
+ },
};
PVE::JSONSchema::register_format('pve-qm-virtiofs', $virtiofs_fmt);
@@ -180,6 +188,8 @@ sub start_virtiofsd {
my $cmd = [$virtiofsd_bin, "--fd=$fd", "--shared-dir=$path"];
push @$cmd, '--xattr' if $virtiofs->{'expose-xattr'};
push @$cmd, '--posix-acl' if $virtiofs->{'expose-acl'};
+ push @$cmd, '--thread-pool-size=' . $virtiofs->{'thread-pool-size'}
+ if $virtiofs->{'thread-pool-size'};
push @$cmd, '--announce-submounts';
push @$cmd, '--allow-direct-io' if $virtiofs->{'direct-io'};
push @$cmd, '--cache=' . $virtiofs->{cache} if $virtiofs->{cache};
--
2.47.3
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH qemu-server v2 3/11] virtiofs: add readonly option
2026-02-23 15:39 [PATCH guest-common/qemu-server/docs/manager v2 0/11] Virtiofs improvements Markus Frank
2026-02-23 15:39 ` [PATCH guest-common v2 1/11] mapping: dir: add 'live-migration-method' parameter Markus Frank
2026-02-23 15:39 ` [PATCH qemu-server v2 2/11] fix #6370: virtiofs: add support for thread-pool-size option Markus Frank
@ 2026-02-23 15:40 ` Markus Frank
2026-02-23 15:40 ` [PATCH qemu-server v2 4/11] virtiofs: add live migration support Markus Frank
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Markus Frank @ 2026-02-23 15:40 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
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 cd95470d..db4b9c78 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
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH qemu-server v2 4/11] virtiofs: add live migration support
2026-02-23 15:39 [PATCH guest-common/qemu-server/docs/manager v2 0/11] Virtiofs improvements Markus Frank
` (2 preceding siblings ...)
2026-02-23 15:40 ` [PATCH qemu-server v2 3/11] virtiofs: add readonly option Markus Frank
@ 2026-02-23 15:40 ` Markus Frank
2026-02-23 15:40 ` [PATCH docs v2 5/11] virtiofs: add explanation for cache=metadata behavior Markus Frank
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Markus Frank @ 2026-02-23 15:40 UTC (permalink / raw)
To: pve-devel
There are two migration methods with virtiofsd.
Virtiofsd in the 'find-paths' migration mode, tries to find the path
inside of the shared directory for every filesystem object that must be
transferred to the destination.
Add two extra parameters that verify file handles and confirm paths.
In the 'file-handles' migration mode every filesystem object is
converted to a file handle. This migration mode requires the
DAC_READ_SEARCH capability.
Add a parameter so that migration does not abort if an error occurs.
Aborting on error would result in a stopped VM on the destination node.
Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
v2:
* fixed broken file-handles migration method by adding
'--modcaps=+dac_read_search' to the virtiofsd command as stated in the
virtiofsd documentation
src/PVE/QemuMigrate/Helpers.pm | 14 +++++++++++---
src/PVE/QemuServer/Virtiofs.pm | 18 ++++++++++++++++++
2 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/src/PVE/QemuMigrate/Helpers.pm b/src/PVE/QemuMigrate/Helpers.pm
index 466517da..9b577704 100644
--- a/src/PVE/QemuMigrate/Helpers.pm
+++ b/src/PVE/QemuMigrate/Helpers.pm
@@ -21,7 +21,6 @@ sub check_non_migratable_resources {
if ($state) {
push @blockers, "amd-sev" if $conf->{"amd-sev"};
push @blockers, "intel-tdx" if $conf->{"intel-tdx"};
- push @blockers, "virtiofs" if PVE::QemuServer::Virtiofs::virtiofs_enabled($conf);
}
if (scalar(@blockers) && !$noerr) {
@@ -100,8 +99,17 @@ sub check_local_resources {
}
if ($k =~ m/^virtiofs/) {
my $entry = parse_property_string('pve-qm-virtiofs', $conf->{$k});
- $add_missing_mapping->('dir', $k, $entry->{dirid});
- $mapped_res->{$k} = { name => $entry->{dirid} };
+ if (my $dirid = $entry->{dirid}) {
+ $add_missing_mapping->('dir', $k, $dirid);
+ my $mapped_device = { name => $dirid };
+ $mapped_res->{$k} = $mapped_device;
+
+ if ($dir_map->{ids}->{$dirid}->{'live-migration-method'}) {
+ $mapped_device->{'live-migration'} = 1;
+ # don't add mapped device with live migration as blocker
+ next;
+ }
+ }
}
# sockets are safe: they will recreated be on the target side post-migrate
next if $k =~ m/^serial/ && ($conf->{$k} eq 'socket');
diff --git a/src/PVE/QemuServer/Virtiofs.pm b/src/PVE/QemuServer/Virtiofs.pm
index db4b9c78..1a3db50b 100644
--- a/src/PVE/QemuServer/Virtiofs.pm
+++ b/src/PVE/QemuServer/Virtiofs.pm
@@ -177,6 +177,9 @@ sub start_virtiofsd {
my $dir_cfg = PVE::Mapping::Dir::find_on_current_node($virtiofs->{dirid});
+ my $dirid = $virtiofs->{dirid};
+ my $dir_properties = PVE::Mapping::Dir::config()->{ids}->{$dirid};
+
my $virtiofsd_bin = '/usr/libexec/virtiofsd';
if (!-f $virtiofsd_bin) {
die "virtiofsd is not installed. To use virtio-fs, install virtiofsd via apt.\n";
@@ -201,6 +204,21 @@ sub start_virtiofsd {
push @$cmd, '--readonly' if $virtiofs->{readonly};
push @$cmd, '--cache=' . $virtiofs->{cache} if $virtiofs->{cache};
push @$cmd, '--inode-file-handles=prefer' if $prefer_inode_fh;
+
+ if (my $method = $dir_properties->{'live-migration-method'}) {
+ # migration-on-error=abort would result in a stopped VM on the target node
+ push @$cmd, '--migration-on-error=guest-error';
+ if ($method eq 'find-paths') {
+ push @$cmd, '--migration-mode=find-paths';
+ push @$cmd, '--migration-verify-handles';
+ push @$cmd, '--migration-confirm-paths';
+ }
+ if ($method eq 'file-handles') {
+ push @$cmd, '--migration-mode=file-handles';
+ push @$cmd, '--modcaps=+dac_read_search';
+ }
+ }
+
push @$cmd, '--syslog';
exec(@$cmd);
} elsif (!defined($pid2)) {
--
2.47.3
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH docs v2 5/11] virtiofs: add explanation for cache=metadata behavior
2026-02-23 15:39 [PATCH guest-common/qemu-server/docs/manager v2 0/11] Virtiofs improvements Markus Frank
` (3 preceding siblings ...)
2026-02-23 15:40 ` [PATCH qemu-server v2 4/11] virtiofs: add live migration support Markus Frank
@ 2026-02-23 15:40 ` Markus Frank
2026-02-23 15:40 ` [PATCH docs v2 6/11] virtiofs: add table for optional parameters Markus Frank
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Markus Frank @ 2026-02-23 15:40 UTC (permalink / raw)
To: pve-devel
Adds a description of the `cache=metadata` mode and references the
upstream patch that introduced it.
Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
qm.adoc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/qm.adoc b/qm.adoc
index 667fd56..4843d82 100644
--- a/qm.adoc
+++ b/qm.adoc
@@ -1323,7 +1323,9 @@ has been configured in the resource mapping. Additionally, you can set the
`cache` option to either `always`, `never`, `metadata`, or `auto` (default:
`auto`), depending on your requirements. How the different caching modes behave
can be read https://lwn.net/Articles/774495/[here under the "Caching Modes"
-section].
+section]. The https://gitlab.com/virtio-fs/virtiofsd/-/commit/598ca8e[`metadata`]
+policy is similar to `never`, but it allows guests to cache filesystem metadata,
+such as dcache and attr.
The `virtiofsd` supports ACL and xattr passthrough (can be enabled with the
`expose-acl` and `expose-xattr` options), allowing the guest to access ACLs and
--
2.47.3
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH docs v2 6/11] virtiofs: add table for optional parameters
2026-02-23 15:39 [PATCH guest-common/qemu-server/docs/manager v2 0/11] Virtiofs improvements Markus Frank
` (4 preceding siblings ...)
2026-02-23 15:40 ` [PATCH docs v2 5/11] virtiofs: add explanation for cache=metadata behavior Markus Frank
@ 2026-02-23 15:40 ` Markus Frank
2026-02-23 15:40 ` [PATCH docs v2 7/11] virtiofs: add thread-pool-size description Markus Frank
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Markus Frank @ 2026-02-23 15:40 UTC (permalink / raw)
To: pve-devel
Removes redundant explanatory text now covered by the table.
Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
qm.adoc | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/qm.adoc b/qm.adoc
index 4843d82..46217a6 100644
--- a/qm.adoc
+++ b/qm.adoc
@@ -1333,12 +1333,16 @@ xattrs if the underlying host filesystem supports them, but they must also be
compatible with the guest filesystem (for example most Linux filesystems support
ACLs, while Windows filesystems do not).
-The `expose-acl` option automatically implies `expose-xattr`, that is, it makes
-no difference if you set `expose-xattr` to `0` if `expose-acl` is set to `1`.
-
-If you want virtiofs to honor the `O_DIRECT` flag, you can set the `direct-io`
-parameter to `1` (default: `0`). This will degrade performance, but is useful if
-applications do their own caching.
+All Optional Parameters:
+
+[cols="1,3,1", options="header"]
+|===
+|Parameter |Description |Default
+|`cache` |Sets caching mode: `always`, `never`, `metadata`, or `auto`. |`auto`
+|`expose-acl` |Enables ACL passthrough; implies `expose-xattr`. Supported only on compatible filesystems. |`0`
+|`expose-xattr` |Enables xattr passthrough; redundant if `expose-acl` is `1`. |`0`
+|`direct-io` |Enables support for the `O_DIRECT` flag. May degrade performance, but is useful if applications perform their own caching. |`0`
+|===
----
qm set <vmid> -virtiofs0 dirid=<dirid>,cache=always,direct-io=1
--
2.47.3
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH docs v2 7/11] virtiofs: add thread-pool-size description
2026-02-23 15:39 [PATCH guest-common/qemu-server/docs/manager v2 0/11] Virtiofs improvements Markus Frank
` (5 preceding siblings ...)
2026-02-23 15:40 ` [PATCH docs v2 6/11] virtiofs: add table for optional parameters Markus Frank
@ 2026-02-23 15:40 ` Markus Frank
2026-02-23 15:40 ` [PATCH docs v2 8/11] virtiofs: add documentation for live migration Markus Frank
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Markus Frank @ 2026-02-23 15:40 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
qm.adoc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/qm.adoc b/qm.adoc
index 46217a6..09fbd20 100644
--- a/qm.adoc
+++ b/qm.adoc
@@ -1342,12 +1342,13 @@ All Optional Parameters:
|`expose-acl` |Enables ACL passthrough; implies `expose-xattr`. Supported only on compatible filesystems. |`0`
|`expose-xattr` |Enables xattr passthrough; redundant if `expose-acl` is `1`. |`0`
|`direct-io` |Enables support for the `O_DIRECT` flag. May degrade performance, but is useful if applications perform their own caching. |`0`
+|`thread-pool-size` |Controls the maximum number of worker threads used by virtiofsd to handle requests. Adjust for performance tuning. `0` disables the thread pool. |`0`
|===
----
qm set <vmid> -virtiofs0 dirid=<dirid>,cache=always,direct-io=1
qm set <vmid> -virtiofs1 <dirid>,cache=never,expose-xattr=1
-qm set <vmid> -virtiofs2 <dirid>,expose-acl=1
+qm set <vmid> -virtiofs2 <dirid>,expose-acl=1,thread-pool-size=16
----
To temporarily mount virtiofs in a guest VM with the Linux kernel virtiofs
--
2.47.3
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH docs v2 8/11] virtiofs: add documentation for live migration
2026-02-23 15:39 [PATCH guest-common/qemu-server/docs/manager v2 0/11] Virtiofs improvements Markus Frank
` (6 preceding siblings ...)
2026-02-23 15:40 ` [PATCH docs v2 7/11] virtiofs: add thread-pool-size description Markus Frank
@ 2026-02-23 15:40 ` Markus Frank
2026-02-23 15:40 ` [PATCH manager v2 09/11] fix #6370: ui: virtiofs edit: add support for thread-pool-size option Markus Frank
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Markus Frank @ 2026-02-23 15:40 UTC (permalink / raw)
To: pve-devel
Also update the virtiofs known limitations.
Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
v2 changes:
* added link for further information about virtiofs limitations.
qm.adoc | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/qm.adoc b/qm.adoc
index 09fbd20..03224a7 100644
--- a/qm.adoc
+++ b/qm.adoc
@@ -1297,10 +1297,12 @@ Known Limitations
* Memory hotplug does not work in combination with virtiofs (also results in
hanging access).
* Memory related features such as live migration, snapshots, and hibernate are
- not available with virtiofs devices.
+ not available with virtiofs devices on {pve} 8.
* Windows cannot understand ACLs in the context of virtiofs. Therefore, do not
expose ACLs for Windows VMs, otherwise the virtiofs device will not be visible
within the VM.
+* For further limitations, see the
+ https://gitlab.com/virtio-fs/virtiofsd#limitations[GitLab page of virtiofsd].
Add Mapping for Shared Directories
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1314,6 +1316,29 @@ pvesh create /cluster/mapping/dir --id dir1 \
--map node=node2,path=/path/to/share2 \
----
+Live Migration
+^^^^^^^^^^^^^^
+
+Live migration is possible on {pve} 9 (Debian Trixie) because versions of
+Virtiofsd starting with v1.11.0 support live migration. To enable live
+migration, select a method using the `live-migration-method` parameter in the
+Directory Mapping (xref:resource_mapping[Resource Mapping]). If a live migration
+method is selected, virtiofsd will start with the flags to enable live migration
+using the chosen method. Ensure you are using the same shared directory on both
+hosts before migrating.
+
+Available migration methods are `file-handles` and `find-path`:
+
+* In the `find-paths` migration mode, virtiofsd tries to find the path inside of
+ the shared directory for every filesystem object that must be transferred to
+ the destination.
+* In the `file-handles` migration mode every filesystem object is converted to a
+ file handle.
+
+For more information about the live migration methods, see the
+https://gitlab.com/virtio-fs/virtiofsd/-/blob/main/doc/migration.md[virtiofsd
+migration page on GitLab].
+
Add virtiofs to a VM
^^^^^^^^^^^^^^^^^^^^
@@ -2162,6 +2187,10 @@ Currently there are the following options:
migrating passed through devices is an experimental feature and may not work
or cause issues.
+* `live-migration-method` (Directory): This sets the live migration mode for
+ virtiofs. If a live migration method is selected, virtiofsd will start with
+ the flags to enable live migration using the chosen method. Available
+ migration methods are `file-handles` and `find-path`.
Managing Virtual Machines with `qm`
------------------------------------
--
2.47.3
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH manager v2 09/11] fix #6370: ui: virtiofs edit: add support for thread-pool-size option
2026-02-23 15:39 [PATCH guest-common/qemu-server/docs/manager v2 0/11] Virtiofs improvements Markus Frank
` (7 preceding siblings ...)
2026-02-23 15:40 ` [PATCH docs v2 8/11] virtiofs: add documentation for live migration Markus Frank
@ 2026-02-23 15:40 ` Markus Frank
2026-02-23 15:40 ` [PATCH manager v2 10/11] virtiofs edit: add support for readonly option Markus Frank
2026-02-23 15:40 ` [PATCH manager v2 11/11] directory mapping: add live-migration-method option for virtiofs Markus Frank
10 siblings, 0 replies; 12+ messages in thread
From: Markus Frank @ 2026-02-23 15:40 UTC (permalink / raw)
To: pve-devel
Requires the qemu-server commit named "fix #6370: virtiofs: add support
for thread-pool-size option".
Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
www/manager6/qemu/VirtiofsEdit.js | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/www/manager6/qemu/VirtiofsEdit.js b/www/manager6/qemu/VirtiofsEdit.js
index d51ca255..1b70b447 100644
--- a/www/manager6/qemu/VirtiofsEdit.js
+++ b/www/manager6/qemu/VirtiofsEdit.js
@@ -83,6 +83,16 @@ Ext.define('PVE.qemu.VirtiofsInputPanel', {
name: 'direct-io',
fieldLabel: gettext('Allow Direct IO'),
},
+ {
+ xtype: 'proxmoxintegerfield',
+ name: 'thread-pool-size',
+ minValue: 0,
+ maxValue: 256,
+ value: '',
+ emptyText: '0',
+ allowBlank: true,
+ fieldLabel: gettext('thread-pool-size'),
+ },
];
me.virtiofs = {};
--
2.47.3
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH manager v2 10/11] virtiofs edit: add support for readonly option
2026-02-23 15:39 [PATCH guest-common/qemu-server/docs/manager v2 0/11] Virtiofs improvements Markus Frank
` (8 preceding siblings ...)
2026-02-23 15:40 ` [PATCH manager v2 09/11] fix #6370: ui: virtiofs edit: add support for thread-pool-size option Markus Frank
@ 2026-02-23 15:40 ` Markus Frank
2026-02-23 15:40 ` [PATCH manager v2 11/11] directory mapping: add live-migration-method option for virtiofs Markus Frank
10 siblings, 0 replies; 12+ messages in thread
From: Markus Frank @ 2026-02-23 15:40 UTC (permalink / raw)
To: pve-devel
Requires the qemu-server commit named "virtiofs: add readonly option".
Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
www/manager6/qemu/VirtiofsEdit.js | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/www/manager6/qemu/VirtiofsEdit.js b/www/manager6/qemu/VirtiofsEdit.js
index 1b70b447..ce679b8b 100644
--- a/www/manager6/qemu/VirtiofsEdit.js
+++ b/www/manager6/qemu/VirtiofsEdit.js
@@ -83,6 +83,11 @@ Ext.define('PVE.qemu.VirtiofsInputPanel', {
name: 'direct-io',
fieldLabel: gettext('Allow Direct IO'),
},
+ {
+ xtype: 'proxmoxcheckbox',
+ name: 'readonly',
+ fieldLabel: gettext('Read Only'),
+ },
{
xtype: 'proxmoxintegerfield',
name: 'thread-pool-size',
--
2.47.3
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH manager v2 11/11] directory mapping: add live-migration-method option for virtiofs
2026-02-23 15:39 [PATCH guest-common/qemu-server/docs/manager v2 0/11] Virtiofs improvements Markus Frank
` (9 preceding siblings ...)
2026-02-23 15:40 ` [PATCH manager v2 10/11] virtiofs edit: add support for readonly option Markus Frank
@ 2026-02-23 15:40 ` Markus Frank
10 siblings, 0 replies; 12+ messages in thread
From: Markus Frank @ 2026-02-23 15:40 UTC (permalink / raw)
To: pve-devel
Display a warning indicating that this feature is experimental.
Add the Messages.js file to reuse warnings, hints, and other messages
in different locations. Display the virtiofs warnings from the
Messages.js file in the migration and directory edit windows.
Requires the qemu-server commit named "virtiofs: add live migration
support".
Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
v2 changes:
* show more warnings/hints and add them to Messages.js so that they can
be reused in multiple locations
I discussed with Dominik Csapak off-list what a good place for common
log messages or texts that can be reused would be.
We both agreed that Utils.js is already big enough, so I added
Messages.js. What do you think?
www/manager6/Makefile | 1 +
www/manager6/Messages.js | 24 +++++++++++++++
www/manager6/dc/DirMapView.js | 8 +++++
www/manager6/window/DirMapEdit.js | 49 +++++++++++++++++++++++++++++++
www/manager6/window/Migrate.js | 6 ++++
5 files changed, 88 insertions(+)
create mode 100644 www/manager6/Messages.js
diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 4558d53e..79356b2a 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -7,6 +7,7 @@ JSSRC= \
StateProvider.js \
Utils.js \
UIOptions.js \
+ Messages.js \
Toolkit.js \
VNCConsole.js \
button/ConsoleButton.js \
diff --git a/www/manager6/Messages.js b/www/manager6/Messages.js
new file mode 100644
index 00000000..2af81e83
--- /dev/null
+++ b/www/manager6/Messages.js
@@ -0,0 +1,24 @@
+Ext.define('PVE.Messages', {
+ singleton: true,
+
+ virtiofs: {
+ same_shared_dir: {
+ text: gettext(
+ 'Ensure you are using the same shared directory on all hosts before migrating with a virtiofs device.',
+ ),
+ severity: 'warning',
+ },
+ umount: {
+ text: gettext(
+ 'The safest way to migrate a VM with a virtiofs device is to either unmount or mount the device as read-only.',
+ ),
+ severity: 'warning',
+ },
+ migration_method_change: {
+ text: gettext(
+ 'Changes to the migration method will take effect when the VM is restarted.',
+ ),
+ severity: 'info',
+ },
+ },
+});
diff --git a/www/manager6/dc/DirMapView.js b/www/manager6/dc/DirMapView.js
index f0dfe28f..26f938e9 100644
--- a/www/manager6/dc/DirMapView.js
+++ b/www/manager6/dc/DirMapView.js
@@ -26,6 +26,14 @@ Ext.define('PVE.dc.DirMapView', {
dataIndex: 'text',
width: 200,
},
+ {
+ header: gettext('Live Migration Method'),
+ dataIndex: 'live-migration',
+ renderer: function (value, _meta, record) {
+ return Ext.String.htmlEncode(value ?? record.data['live-migration-method']);
+ },
+ width: 150,
+ },
{
header: gettext('Comment'),
dataIndex: 'description',
diff --git a/www/manager6/window/DirMapEdit.js b/www/manager6/window/DirMapEdit.js
index 841ff1fe..56f0be06 100644
--- a/www/manager6/window/DirMapEdit.js
+++ b/www/manager6/window/DirMapEdit.js
@@ -39,8 +39,10 @@ Ext.define('PVE.window.DirMapEditWindow', {
let name = values.name;
let description = values.description;
+ let liveMigration = values['live-migration-method'];
let deletes = values.delete;
+ delete values['live-migration-method'];
delete values.description;
delete values.name;
delete values.delete;
@@ -69,6 +71,9 @@ Ext.define('PVE.window.DirMapEditWindow', {
if (description) {
values.description = description;
}
+ if (liveMigration) {
+ values['live-migration-method'] = liveMigration;
+ }
if (deletes && !view.isCreate) {
values.delete = deletes;
}
@@ -181,6 +186,37 @@ Ext.define('PVE.window.DirMapEditWindow', {
},
],
},
+ {
+ xtype: 'proxmoxKVComboBox',
+ fieldLabel: `<i class="fa fa-exclamation-triangle warning"></i> ${gettext('Experimental')}:
+ ${gettext('Live Migration Method')}`,
+ reference: 'live-migration-method',
+ name: 'live-migration-method',
+ value: '__default__',
+ comboItems: [
+ [
+ '__default__',
+ Proxmox.Utils.defaultText + ' (' + Proxmox.Utils.disabledText + ')',
+ ],
+ ['find-paths', 'find-paths'],
+ ['file-handles', 'file-handles'],
+ ],
+ cbind: {
+ deleteEmpty: '{!isCreate}',
+ disabled: '{hideComment}',
+ hidden: '{hideComment}',
+ },
+ },
+ {
+ xtype: 'displayfield',
+ reference: 'migration-method-change-hint',
+ columnWidth: 1,
+ value: PVE.Messages.virtiofs.migration_method_change.text,
+ cbind: {
+ hidden: '{hideComment}',
+ },
+ userCls: 'pmx-hint',
+ },
],
columnB: [
@@ -202,6 +238,19 @@ Ext.define('PVE.window.DirMapEditWindow', {
},
],
},
+ {
+ xtype: 'displayfield',
+ reference: 'migration-hint',
+ columnWidth: 1,
+ value:
+ PVE.Messages.virtiofs.same_shared_dir.text +
+ ' ' +
+ PVE.Messages.virtiofs.umount.text,
+ cbind: {
+ hidden: '{hideComment}',
+ },
+ userCls: 'pmx-hint',
+ },
],
},
],
diff --git a/www/manager6/window/Migrate.js b/www/manager6/window/Migrate.js
index ff80c70c..c91f3dd7 100644
--- a/www/manager6/window/Migrate.js
+++ b/www/manager6/window/Migrate.js
@@ -335,8 +335,14 @@ Ext.define('PVE.window.Migrate', {
if (vm.get('running')) {
let allowed = [];
let notAllowed = [];
+ let print_virtiofs_migration_warn_ones = true;
for (const [key, resource] of Object.entries(mappedResources)) {
if (resource['live-migration']) {
+ if (key.match(/^virtiofs\d+/) && print_virtiofs_migration_warn_ones) {
+ migration.preconditions.push(PVE.Messages.virtiofs.same_shared_dir);
+ migration.preconditions.push(PVE.Messages.virtiofs.umount);
+ print_virtiofs_migration_warn_ones = false;
+ }
allowed.push(key);
} else {
notAllowed.push(key);
--
2.47.3
^ permalink raw reply [flat|nested] 12+ messages in thread