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 18E1B1FF0A5 for ; Fri, 04 Sep 2026 10:30:18 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 9325921401; Fri, 04 Sep 2026 10:30:14 +0200 (CEST) Message-ID: <9477b7a3-ab60-4c92-83dc-84292ef119ab@proxmox.com> Date: Fri, 4 Sep 2026 10:30:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH manager 3/3] ui: qemu: add pvpanic device support To: Kaiyang Wu , pve-devel@lists.proxmox.com References: <20260827103529.393388-1-wukaiyang@loongfans.cn> <20260827103529.393388-4-wukaiyang@loongfans.cn> Content-Language: en-US From: Dominik Csapak In-Reply-To: <20260827103529.393388-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: 1788510600385 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.555 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: WF3JXGDBIGR3PKSKIKRBW56YVYL3JUR5 X-Message-ID-Hash: WF3JXGDBIGR3PKSKIKRBW56YVYL3JUR5 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: aside from this code being much simpler when we would only have one option (with only PCI, there wouldn't be a need for an edit window at all, the menu would just add the device, or it would be just a checkbox on the machine edit window) Also as long as our backend/code doesn't do anything with the panics, we probably shouldn't expose the device at all? This would only confuse users what do to with it. other than that some comment inline On 8/27/26 12:36 PM, Kaiyang Wu wrote: > Add basic structure for adding and editing a pvpanic device, allowing to > monitor guest system panics through the pvpanic device. Add an > architecture-aware pvpanic device type option since arm64 does not > support pvpanic ISA device. > > Signed-off-by: Kaiyang Wu > --- > www/manager6/Makefile | 2 ++ > www/manager6/Utils.js | 1 + > www/manager6/form/PvpanicSelector.js | 12 +++++++++ > www/manager6/qemu/Architecture.js | 5 ++++ > www/manager6/qemu/HardwareView.js | 15 +++++++++++ > www/manager6/qemu/PvpanicEdit.js | 39 ++++++++++++++++++++++++++++ > 6 files changed, 74 insertions(+) > create mode 100644 www/manager6/form/PvpanicSelector.js > create mode 100644 www/manager6/qemu/PvpanicEdit.js > > diff --git a/www/manager6/Makefile b/www/manager6/Makefile > index d2ea786b..c8bebf9c 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 \ > @@ -282,6 +283,7 @@ JSSRC= \ > qemu/Options.js \ > qemu/PCIEdit.js \ > qemu/ProcessorEdit.js \ > + qemu/PvpanicEdit.js \ > qemu/QemuBiosEdit.js \ > qemu/RNGEdit.js \ > qemu/SSHKey.js \ > diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js > index c86a00c5..9bc4cda6 100644 > --- a/www/manager6/Utils.js > +++ b/www/manager6/Utils.js > @@ -1776,6 +1776,7 @@ Ext.define('PVE.Utils', { > rng: 1, > tpmstate: 1, > virtiofs: 10, > + pvpanic: 1, > }, > > // we can have usb6 and up only for specific machine/ostypes > diff --git a/www/manager6/form/PvpanicSelector.js b/www/manager6/form/PvpanicSelector.js > new file mode 100644 > index 00000000..63456c96 > --- /dev/null > +++ b/www/manager6/form/PvpanicSelector.js > @@ -0,0 +1,12 @@ > +Ext.define('PVE.form.PvpanicSelector', { > + extend: 'PVE.form.FilteredKVComboBox', > + alias: ['widget.pvePvpanicSelector'], > + comboItems: [ > + ['pvpanic', 'pvpanic'], > + ['pvpanic-pci', 'pvpanic (PCI)'], > + ], > + > + allowBlank: false, > + > + allowedValuesPerCategory: PVE.qemu.Architecture.allowedPvpanic, > +}); > diff --git a/www/manager6/qemu/Architecture.js b/www/manager6/qemu/Architecture.js > index 7b6ef402..d58b4429 100644 > --- a/www/manager6/qemu/Architecture.js > +++ b/www/manager6/qemu/Architecture.js > @@ -52,6 +52,11 @@ Ext.define('PVE.qemu.Architecture', { > aarch64: ['virtio-scsi-pci', 'virtio-scsi-single'], > }, > > + allowedPvpanic: { > + x86_64: ['pvpanic', 'pvpanic-pci'], > + aarch64: ['pvpanic-pci'], > + }, > +> allowedMachines: { > x86_64: ['__default__', 'q35'], // __default__ is i440fx > aarch64: ['__default__'], // __default__ is virt > diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js > index e6c02299..9bea67a0 100644 > --- a/www/manager6/qemu/HardwareView.js > +++ b/www/manager6/qemu/HardwareView.js > @@ -375,6 +375,13 @@ Ext.define('PVE.qemu.HardwareView', { > header: gettext('Virtiofs') + ' (' + confid + ')', > }; > } > + rows.pvpanic0 = { > + group: 55, > + iconCls: 'exclamation-triangle', > + editor: caps.vms['VM.Config.HWType'] ? 'PVE.qemu.PvpanicEdit' : undefined, > + never_delete: !caps.vms['VM.Config.HWType'], > + header: gettext('Panic Monitor (pvpanic)'), we normally don't write the qemu name in this menu, so just 'Panic Montior' should be enough > + }; > > var sorterFn = function (rec1, rec2) { > var v1 = rec1.data.key; > @@ -738,6 +745,7 @@ Ext.define('PVE.qemu.HardwareView', { > efidisk_menuitem.setDisabled(noVMConfigDiskPerm || isAtLimit('efidisk')); > me.down('#addTpmState').setDisabled(noVMConfigDiskPerm || isAtLimit('tpmstate')); > me.down('#addVirtiofs').setDisabled(noVMConfigOptionsPerm || isAtLimit('virtiofs')); > + me.down('#addPvpanic').setDisabled(noVMConfigHWTypePerm || isAtLimit('pvpanic')); > me.down('#addCloudinitDrive').setDisabled( > noVMConfigCDROMPerm || noVMConfigCloudinitPerm || hasCloudInit, > ); > @@ -918,6 +926,13 @@ Ext.define('PVE.qemu.HardwareView', { > disabled: !caps.nodes['Sys.Console'], > handler: editorFactory('VirtiofsEdit'), > }, > + { > + text: gettext('Panic Monitor (pvpanic)'), > + itemId: 'addPvpanic', > + iconCls: 'fa fa-exclamation-triangle', > + disabled: !caps.vms['VM.Config.HWType'], > + handler: editorFactory('PvpanicEdit'), > + }, > ], not your issue here, I just mention it for completeness sake: we should probably start to categorize the hardware in the add menu, the number of entries is getting too large and it takes too long to find something > }), > }, > diff --git a/www/manager6/qemu/PvpanicEdit.js b/www/manager6/qemu/PvpanicEdit.js > new file mode 100644 > index 00000000..871ebefa > --- /dev/null > +++ b/www/manager6/qemu/PvpanicEdit.js > @@ -0,0 +1,39 @@ > +Ext.define('PVE.qemu.PvpanicEdit', { > + extend: 'Proxmox.window.Edit', > + > + subject: gettext('Panic Monitor (pvpanic)'), > + > + onlineHelp: 'qm_pvpanic', > + > + items: [ > + { > + xtype: 'pvePvpanicSelector', > + name: 'pvpanic0', > + fieldLabel: gettext('Type'), > + }, > + ], > + > + initComponent: function () { > + var me = this; > + > + me.nodename = me.pveSelNode?.data.node; > + > + if (!me.nodename) { > + throw 'no nodename given'; > + } > + > + me.callParent(); > + > + me.load({ > + success: function ({ result }) { > + let values = result.data; > + let arch = PVE.qemu.Architecture.getGuestArchitecture(values.arch, me.nodename); > + let pvpanic0 = values.pvpanic0; > + if (pvpanic0) { > + me.down('pvePvpanicSelector').setValue(pvpanic0); > + } > + me.down('pvePvpanicSelector').setCategory(arch); > + }, > + }); > + }, > +});