From: Dominik Csapak <d.csapak@proxmox.com>
To: Kaiyang Wu <wukaiyang2003@gmail.com>, pve-devel@lists.proxmox.com
Cc: Kaiyang Wu <wukaiyang@loongfans.cn>
Subject: Re: [PATCH manager v4 3/3] ui: qemu: add pvpanic device support
Date: Mon, 16 Nov 2026 17:10:22 +0100 [thread overview]
Message-ID: <b3d77418-80c1-4fd1-9a20-d03b2a10a77a@proxmox.com> (raw)
In-Reply-To: <20261102095525.1635251-4-wukaiyang@loongfans.cn>
aside a nit inline (that could be solved as a follow up)
LGTM
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
On 11/2/26 10:55 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 perform when guest system panics.
>
> Suggested-by: Dominik Csapak <d.csapak@proxmox.com>
> Signed-off-by: Kaiyang Wu <wukaiyang@loongfans.cn>
> ---
> 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..2b7465fd 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)`;
nit: i think it would be better to have that text in a gettext,
but not an issue for now (for me)
> + }
> + },
> +
> 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..368fd43f
> --- /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} (${gettext('Shutdown guest')})`],
> + ['none', gettext('No action')],
> + ['pause', gettext('Pause guest')],
> + ['shutdown', gettext('Shutdown guest')],
> + ['exit-failure', gettext('Force stop guest')],
> + ],
> + 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,
next prev parent reply other threads:[~2026-11-16 16:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 9:55 [PATCH qemu-server v4 0/3] add pvpanic device support Kaiyang Wu
2026-11-02 9:55 ` [PATCH qemu-server v4 1/3] qemuserver: add pvpanic device Kaiyang Wu
2026-11-16 16:10 ` Dominik Csapak
2026-11-02 9:55 ` [PATCH docs v4 2/3] qm: add document section for the " Kaiyang Wu
2026-11-16 16:10 ` Dominik Csapak
2026-11-02 9:55 ` [PATCH manager v4 3/3] ui: qemu: add pvpanic device support Kaiyang Wu
2026-11-16 16:10 ` Dominik Csapak [this message]
2026-11-12 9:41 ` [PATCH qemu-server v4 0/3] " Kaiyang Wu
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=b3d77418-80c1-4fd1-9a20-d03b2a10a77a@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
--cc=wukaiyang2003@gmail.com \
--cc=wukaiyang@loongfans.cn \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox