From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 94F4A1FF0B7 for ; Fri, 30 Oct 2026 15:06:58 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 6D11B21665; Fri, 30 Oct 2026 15:06:49 +0100 (CET) Message-ID: <9a0b4eff-79bf-4921-90ee-2f5f3e709f87@proxmox.com> Date: Fri, 30 Oct 2026 15:06:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH manager v3 3/3] ui: qemu: add pvpanic device support To: Kaiyang Wu , pve-devel@lists.proxmox.com References: <20261009065813.109006-1-wukaiyang@loongfans.cn> <20261009065813.109006-4-wukaiyang@loongfans.cn> Content-Language: en-US From: Dominik Csapak In-Reply-To: <20261009065813.109006-4-wukaiyang@loongfans.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1793369204947 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.339 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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: 6SHHJGMJVGEHZ7A67DWRTEMRZYDGGYI6 X-Message-ID-Hash: 6SHHJGMJVGEHZ7A67DWRTEMRZYDGGYI6 X-MailFrom: d.csapak@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 CC: Kaiyang Wu X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: comments inline On 10/9/26 8:59 AM, Kaiyang Wu wrote: > Add basic structure for adding a pvpanic PCI device, allowing to monitor > guest system panics through the pvpanic device, and specify panic action > to execute when guest system panics. > > Suggested-by: Dominik Csapak > Signed-off-by: Kaiyang Wu > --- > www/manager6/Makefile | 1 + > www/manager6/Utils.js | 18 +++++++++ > www/manager6/form/PvpanicSelector.js | 56 ++++++++++++++++++++++++++++ > www/manager6/qemu/Options.js | 16 ++++++++ > 4 files changed, 91 insertions(+) > create mode 100644 www/manager6/form/PvpanicSelector.js > > diff --git a/www/manager6/Makefile b/www/manager6/Makefile > index d2ea786b..d3c15c29 100644 > --- a/www/manager6/Makefile > +++ b/www/manager6/Makefile > @@ -65,6 +65,7 @@ JSSRC= \ > form/PoolSelector.js \ > form/PreallocationSelector.js \ > form/PrivilegesSelector.js \ > + form/PvpanicSelector.js \ > form/QemuBiosSelector.js \ > form/QemuMachineSelector.js \ > form/RecordSearchField.js \ > diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js > index 8b99371d..8263eea7 100644 > --- a/www/manager6/Utils.js > +++ b/www/manager6/Utils.js > @@ -557,6 +557,24 @@ Ext.define('PVE.Utils', { > } > }, > > + render_pvpanic: function (value) { > + if (!value) { > + return Proxmox.Utils.defaultText + ' (' + Proxmox.Utils.disabledText + ')'; > + } > + > + let pvpanic = PVE.Parser.parsePropertyString(value, 'enabled'); > + > + if (!PVE.Parser.parseBoolean(pvpanic.enabled)) { > + return Proxmox.Utils.disabledText; > + } > + > + if (pvpanic.action) { > + return Proxmox.Utils.enabledText + `, Panic Action: ${pvpanic.action}`; > + } else { > + return Proxmox.Utils.enabledText + ', Panic Action: ' + Proxmox.Utils.defaultText + ' (shutdown)'; > + } > + }, > + > render_dc_ha_opts: function (value) { > if (!value) { > return Proxmox.Utils.defaultText; > diff --git a/www/manager6/form/PvpanicSelector.js b/www/manager6/form/PvpanicSelector.js > new file mode 100644 > index 00000000..eda5795d > --- /dev/null > +++ b/www/manager6/form/PvpanicSelector.js > @@ -0,0 +1,56 @@ > +Ext.define('PVE.form.PvpanicSelector', { > + extend: 'Proxmox.panel.InputPanel', > + alias: 'widget.pvePvpanicSelector', > + > + viewModel: {}, > + > + items: [ > + { > + xtype: 'proxmoxcheckbox', > + fieldLabel: gettext('Enable'), > + name: 'enabled', > + reference: 'enabled', > + uncheckedValue: 0, > + }, > + { > + xtype: 'proxmoxKVComboBox', > + fieldLabel: gettext('Panic Action'), > + name: 'action', > + value: '__default__', > + comboItems: [ > + ['__default__', Proxmox.Utils.defaultText + ' (shutdown)'], > + ['none', 'none'], > + ['pause', 'pause'], > + ['shutdown', 'shutdown'], > + ['exit-failure', 'exit-failure'], would be nice to have a better text (with gettext here) for example: none: gettext('No action') pause: gettext('Guest will be paused') shutdown: gettext('Default Shutdown action') exit-failure: gettext('Guest will be stopped') don't take these suggestions too seriously they are just examples i came up with on the spot, but having translatable strings makes it easier for the user to understand what will happen (not everybody will read the docs ;) ) > + ], > + bind: { > + disabled: '{!enabled.checked}', > + }, > + }, > + ], > + > + onGetValues: function (values) { > + let ret = {}; > + > + if (values.enabled) { > + ret.enabled = 1; > + } > + if (values.action) { > + ret.enabled = values.enabled; > + ret.action = values.action; > + } > + if (Ext.Object.isEmpty(ret)) { > + return { delete: 'pvpanic' }; > + } > + let pvpanic = PVE.Parser.printPropertyString(ret, 'enabled'); > + return { pvpanic: pvpanic }; > + }, > + > + setValues: function (values) { > + if (values.pvpanic) { > + let pvpanic = PVE.Parser.parsePropertyString(values.pvpanic, 'enabled'); > + this.callParent([pvpanic]); > + } > + }, > +}); > diff --git a/www/manager6/qemu/Options.js b/www/manager6/qemu/Options.js > index 8a4721a0..75cdebf9 100644 > --- a/www/manager6/qemu/Options.js > +++ b/www/manager6/qemu/Options.js > @@ -311,6 +311,22 @@ Ext.define('PVE.qemu.Options', { > } > : undefined, > }, > + pvpanic: { > + header: gettext('Panic Monitor'), > + defaultValue: false, > + renderer: PVE.Utils.render_pvpanic, > + editor: caps.vms['VM.Config.HWType'] > + ? { > + xtype: 'proxmoxWindowEdit', > + subject: gettext('Panic Monitor'), > + onlineHelp: 'qm_pvpanic', > + items: { > + xtype: 'pvePvpanicSelector', > + name: 'pvpanic', > + }, > + } > + : undefined, > + }, > protection: { > header: gettext('Protection'), > defaultValue: false,