From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id D42E61FF13B for ; Wed, 25 Feb 2026 11:46:41 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7FE3934C59; Wed, 25 Feb 2026 11:47:38 +0100 (CET) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 25 Feb 2026 11:46:59 +0100 Message-Id: Subject: Re: [PATCH manager v2 11/11] directory mapping: add live-migration-method option for virtiofs From: "Daniel Kral" To: "Markus Frank" , X-Mailer: aerc 0.21.0-38-g7088c3642f2c-dirty References: <20260223155951.468572-1-m.frank@proxmox.com> <20260223155951.468572-12-m.frank@proxmox.com> In-Reply-To: <20260223155951.468572-12-m.frank@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1772016403216 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.025 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: DL6FARSB7FUVBHBLRUGOZ7ZORFWV64RR X-Message-ID-Hash: DL6FARSB7FUVBHBLRUGOZ7ZORFWV64RR X-MailFrom: d.kral@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Mon Feb 23, 2026 at 4:40 PM CET, Markus Frank wrote: > 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 > --- > 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=3D \ > 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 h= osts before migrating with a virtiofs device.', > + ), > + severity: 'warning', If the Messages module should only be for messages, then this shouldn't hold the 'severity' properties, but only the translated text strings, as the 'severity' property is very specific to the migration preconditions modal. > + }, > + umount: { > + text: gettext( > + 'The safest way to migrate a VM with a virtiofs device i= s 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 t= he VM is restarted.', > + ), > + severity: 'info', > + }, > + }, > +}); > diff --git a/www/manager6/dc/DirMapView.js b/www/manager6/dc/DirMapView.j= s > 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/DirM= apEdit.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', { > =20 > let name =3D values.name; > let description =3D values.description; > + let liveMigration =3D values['live-migration-method']; > let deletes =3D values.delete; > =20 > + 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 =3D description; > } > + if (liveMigration) { > + values['live-migration-method'] =3D liveMigration; > + } > if (deletes && !view.isCreate) { > values.delete =3D deletes; > } > @@ -181,6 +186,37 @@ Ext.define('PVE.window.DirMapEditWindow', { > }, > ], > }, > + { > + xtype: 'proxmoxKVComboBox', > + fieldLabel: ` ${gettext('Experimental')}: > + ${gettext('Live Migration Method')}`, > + reference: 'live-migration-method', > + name: 'live-migration-method', > + value: '__default__', > + comboItems: [ > + [ > + '__default__', > + Proxmox.Utils.defaultText + ' (' + Proxmox.U= tils.disabledText + ')', > + ], > + ['find-paths', 'find-paths'], > + ['file-handles', 'file-handles'], nit: these should be translatable and use human-readable strings if possible. > + ], > + cbind: { > + deleteEmpty: '{!isCreate}', > + disabled: '{hideComment}', > + hidden: '{hideComment}', nit: it would make sense to rename hideComment to something more generic now (maybe even in a patch before that) as the scope of what is hidden for sub-entries has changed with this patch. > + }, > + }, > + { > + xtype: 'displayfield', > + reference: 'migration-method-change-hint', > + columnWidth: 1, > + value: PVE.Messages.virtiofs.migration_method_change= .text, > + cbind: { > + hidden: '{hideComment}', > + }, > + userCls: 'pmx-hint', > + }, This seems a little crammed in the web interface, maybe it would be better to make it its own whole row rather than a half-column? > ], > =20 > 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', > + }, This should probably also go together with the 'live-migration-method' field so they are close together, maybe move all of those fields to columnB right before the comment? The 'migration-hint' could also only be displayed if the setting !=3D disabled. > ], > }, > ], > 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 =3D []; > let notAllowed =3D []; > + let print_virtiofs_migration_warn_ones =3D true; > for (const [key, resource] of Object.entries(mappedResou= rces)) { > if (resource['live-migration']) { > + if (key.match(/^virtiofs\d+/) && print_virtiofs_= migration_warn_ones) { > + migration.preconditions.push(PVE.Messages.vi= rtiofs.same_shared_dir); > + migration.preconditions.push(PVE.Messages.vi= rtiofs.umount); > + print_virtiofs_migration_warn_ones =3D false= ; > + } nit: could also be something like let has_virtiofs_live_migration =3D Object.entries(mappedResources) .some(([key, resource]) =3D> key.match(/^virtiofs\d+/) && resou= rce['live-migration']); to make this a little bit shorter. > allowed.push(key); > } else { > notAllowed.push(key);