public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
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 v3 3/3] ui: qemu: add pvpanic device support
Date: Fri, 30 Oct 2026 15:06:44 +0100	[thread overview]
Message-ID: <9a0b4eff-79bf-4921-90ee-2f5f3e709f87@proxmox.com> (raw)
In-Reply-To: <20261009065813.109006-4-wukaiyang@loongfans.cn>

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 <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..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,





  reply	other threads:[~2026-10-30 14:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09  6:58 [PATCH qemu-server/docs/manager v3 0/3] add pvpanic device support Kaiyang Wu
2026-10-09  6:58 ` [PATCH qemu-server v3 1/3] qemuserver: add pvpanic device Kaiyang Wu
2026-10-30 14:06   ` Dominik Csapak
2026-10-09  6:58 ` [PATCH docs v3 2/3] qm: add document section for the " Kaiyang Wu
2026-10-30 14:06   ` Dominik Csapak
2026-10-09  6:58 ` [PATCH manager v3 3/3] ui: qemu: add pvpanic device support Kaiyang Wu
2026-10-30 14:06   ` Dominik Csapak [this message]
2026-10-28  3:29 ` [PATCH qemu-server/docs/manager v3 0/3] " Kaiyang Wu
2026-10-30 14:06 ` Dominik Csapak

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=9a0b4eff-79bf-4921-90ee-2f5f3e709f87@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal