all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Markus Frank <m.frank@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH manager v2 11/11] directory mapping: add live-migration-method option for virtiofs
Date: Mon, 23 Feb 2026 16:40:08 +0100	[thread overview]
Message-ID: <20260223155951.468572-12-m.frank@proxmox.com> (raw)
In-Reply-To: <20260223155951.468572-1-m.frank@proxmox.com>

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





      parent reply	other threads:[~2026-02-23 16:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` [PATCH qemu-server v2 3/11] virtiofs: add readonly option Markus Frank
2026-02-23 15:40 ` [PATCH qemu-server v2 4/11] virtiofs: add live migration support Markus Frank
2026-02-23 15:40 ` [PATCH docs v2 5/11] virtiofs: add explanation for cache=metadata behavior Markus Frank
2026-02-23 15:40 ` [PATCH docs v2 6/11] virtiofs: add table for optional parameters Markus Frank
2026-02-23 15:40 ` [PATCH docs v2 7/11] virtiofs: add thread-pool-size description Markus Frank
2026-02-23 15:40 ` [PATCH docs v2 8/11] virtiofs: add documentation for live migration 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
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260223155951.468572-12-m.frank@proxmox.com \
    --to=m.frank@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal