* [PATCH qemu-server/docs/manager 0/3] add pvpanic device support
@ 2026-08-27 10:35 Kaiyang Wu
2026-08-27 10:35 ` [PATCH qemu-server 1/3] qemuserver: add pvpanic device Kaiyang Wu
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Kaiyang Wu @ 2026-08-27 10:35 UTC (permalink / raw)
To: pve-devel; +Cc: Kaiyang Wu
This patchset adds pvpanic device support to QEMU virtual machines to
provide extra virtual machine status (guest-panicked) when virtual
machines panic.
The pvpanic device can be implemented as an ISA device ('-device
pvpanic') or as a PCI device ('-device pvpanic-pci') [0]. The ISA
pvpanic device is only available on x86_64, and Linux VMs with kernel
>=3.1 and <5.2 only support the ISA pvpanic device [1] [2]. Therefore,
the patchset allows to choose between the two variants to fit different
needs, and adds a documentation section to help picking the variant.
[0]: https://www.qemu.org/docs/master/specs/pvpanic.html
[1]: https://www.kernelconfig.io/CONFIG_PVPANIC
[2]: https://www.kernelconfig.io/CONFIG_PVPANIC_PCI
qemu-server:
Kaiyang Wu (1):
qemuserver: add pvpanic device
src/PVE/API2/Qemu.pm | 1 +
src/PVE/QemuServer.pm | 19 +++++++++++++++++++
src/PVE/QemuServer/PCI.pm | 1 +
3 files changed, 21 insertions(+)
docs:
Kaiyang Wu (1):
qm: add document section for the pvpanic device
qm.adoc | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
manager:
Kaiyang Wu (1):
ui: qemu: add pvpanic device support
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
--
2.55.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH qemu-server 1/3] qemuserver: add pvpanic device
2026-08-27 10:35 [PATCH qemu-server/docs/manager 0/3] add pvpanic device support Kaiyang Wu
@ 2026-08-27 10:35 ` Kaiyang Wu
2026-09-04 8:30 ` Dominik Csapak
2026-08-27 10:35 ` [PATCH docs 2/3] qm: add document section for the " Kaiyang Wu
` (3 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Kaiyang Wu @ 2026-08-27 10:35 UTC (permalink / raw)
To: pve-devel; +Cc: Kaiyang Wu
Add pvpanic device to monitor virtual machine system panics. Add pvpanic
field in virtual machine configuration files, allowing to choose the ISA
or the PCI variant of the pvpanic device.
Signed-off-by: Kaiyang Wu <wukaiyang@loongfans.cn>
---
src/PVE/API2/Qemu.pm | 1 +
src/PVE/QemuServer.pm | 19 +++++++++++++++++++
src/PVE/QemuServer/PCI.pm | 1 +
3 files changed, 21 insertions(+)
diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
index 71247eec..933f6221 100644
--- a/src/PVE/API2/Qemu.pm
+++ b/src/PVE/API2/Qemu.pm
@@ -818,6 +818,7 @@ my $hwtypeoptions = {
'watchdog' => 1,
'audio0' => 1,
'rng0' => 1,
+ 'pvpanic0' => 1,
};
my $generaloptions = {
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 63d8c135..f476af94 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -739,6 +739,13 @@ EODESCR
optional => 1,
default => 1,
},
+ pvpanic0 => {
+ optional => 1,
+ type => 'string',
+ description => "Configure a pvpanic device to monitor guest panics",
+ enum => [qw(pvpanic pvpanic-pci)],
+ default => undef,
+ },
};
my $cicustom_fmt = {
@@ -3415,6 +3422,18 @@ sub config_to_command {
push @$cmd, '-nographic';
}
+ my $pvpanic = $conf->{pvpanic0};
+ if (defined($pvpanic)) {
+ if ($pvpanic eq 'pvpanic') {
+ push @$devices, '-device', $pvpanic;
+ } elsif ($pvpanic eq 'pvpanic-pci') {
+ my $pvpanicpciaddr = print_pci_addr("pvpanic0", $bridges, $arch);
+ push @$devices, '-device', "$pvpanic,id=pvpanic$pvpanicpciaddr";
+ } else {
+ die "unknown pvpanic device type $pvpanic";
+ }
+ }
+
# For now, handles only specific parts, but the final goal is to cover everything.
my $cfg2cmd_opts = { forcemachine => $forcemachine };
my $cfg2cmd = PVE::QemuServer::Cfg2Cmd->new($conf, $defaults, $version_guard, $cfg2cmd_opts);
diff --git a/src/PVE/QemuServer/PCI.pm b/src/PVE/QemuServer/PCI.pm
index 0b67943c..56770091 100644
--- a/src/PVE/QemuServer/PCI.pm
+++ b/src/PVE/QemuServer/PCI.pm
@@ -220,6 +220,7 @@ sub get_pci_addr_map {
'pci.4' => { bus => 1, addr => 28 },
'rng0' => { bus => 1, addr => 29 },
'pci.2-igd' => { bus => 1, addr => 30 }, # replaces pci.2 in case a legacy IGD device is passed through
+ 'pvpanic0' => { bus => 1, addr => 31 },
'virtio6' => { bus => 2, addr => 1 },
'virtio7' => { bus => 2, addr => 2 },
'virtio8' => { bus => 2, addr => 3 },
--
2.55.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH docs 2/3] qm: add document section for the pvpanic device
2026-08-27 10:35 [PATCH qemu-server/docs/manager 0/3] add pvpanic device support Kaiyang Wu
2026-08-27 10:35 ` [PATCH qemu-server 1/3] qemuserver: add pvpanic device Kaiyang Wu
@ 2026-08-27 10:35 ` Kaiyang Wu
2026-08-27 10:35 ` [PATCH manager 3/3] ui: qemu: add pvpanic device support Kaiyang Wu
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Kaiyang Wu @ 2026-08-27 10:35 UTC (permalink / raw)
To: pve-devel; +Cc: Kaiyang Wu
Document the variants of the pvpanic device, and corresponding driver
requirements on different virtual machine operating systems.
Signed-off-by: Kaiyang Wu <wukaiyang@loongfans.cn>
---
qm.adoc | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/qm.adoc b/qm.adoc
index 5b46cdc..afa7d32 100644
--- a/qm.adoc
+++ b/qm.adoc
@@ -1472,6 +1472,35 @@ tag (name used to mount the device on the guest).
For more information on available virtiofsd parameters, see the
https://gitlab.com/virtio-fs/virtiofsd[GitLab virtiofsd project page].
+[[qm_pvpanic]]
+Pvpanic
+~~~~~~~
+
+Pvpanic is a device to send system panic events to QEMU. It allows to
+provide extra VM status when the VM system crashes.
+
+To add a pvpanic device run the following command:
+
+----
+qm set <vmid> -pvpanic0 <type>
+----
+
+Supported pvpanic device types are:
+
+* `pvpanic`: pvpanic ISA device
+* `pvpanic-pci`: pvpanic PCI device
+
+Linux VMs with kernel >=3.1 support pvpanic ISA device
+(https://www.kernelconfig.io/CONFIG_PVPANIC[pvpanic ISA driver]), and with
+kernel >=5.2 support pvpanic PCI device
+(https://www.kernelconfig.io/CONFIG_PVPANIC_PCI[pvpanic PCI driver]).
+
+Windows VMs require
+https://github.com/virtio-win/kvm-guest-drivers-windows/[kvm-guest-drivers-windows]
+to use pvpanic.
+
+FreeBSD VMs do not support pvpanic.
+
[[qm_bootorder]]
Device Boot Order
~~~~~~~~~~~~~~~~~
--
2.55.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH manager 3/3] ui: qemu: add pvpanic device support
2026-08-27 10:35 [PATCH qemu-server/docs/manager 0/3] add pvpanic device support Kaiyang Wu
2026-08-27 10:35 ` [PATCH qemu-server 1/3] qemuserver: add pvpanic device Kaiyang Wu
2026-08-27 10:35 ` [PATCH docs 2/3] qm: add document section for the " Kaiyang Wu
@ 2026-08-27 10:35 ` Kaiyang Wu
2026-09-04 8:30 ` Dominik Csapak
2026-09-03 8:42 ` [PATCH qemu-server/docs/manager 0/3] " Kaiyang Wu
2026-09-04 8:30 ` Dominik Csapak
4 siblings, 1 reply; 8+ messages in thread
From: Kaiyang Wu @ 2026-08-27 10:35 UTC (permalink / raw)
To: pve-devel; +Cc: Kaiyang Wu
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 <wukaiyang@loongfans.cn>
---
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)'),
+ };
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'),
+ },
],
}),
},
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);
+ },
+ });
+ },
+});
--
2.55.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH qemu-server/docs/manager 0/3] add pvpanic device support
2026-08-27 10:35 [PATCH qemu-server/docs/manager 0/3] add pvpanic device support Kaiyang Wu
` (2 preceding siblings ...)
2026-08-27 10:35 ` [PATCH manager 3/3] ui: qemu: add pvpanic device support Kaiyang Wu
@ 2026-09-03 8:42 ` Kaiyang Wu
2026-09-04 8:30 ` Dominik Csapak
4 siblings, 0 replies; 8+ messages in thread
From: Kaiyang Wu @ 2026-09-03 8:42 UTC (permalink / raw)
To: pve-devel; +Cc: Kaiyang Wu
Gentle ping, can anyone please take a look?
Kaiyang
On 2026-08-27 18:35, Kaiyang Wu wrote:
> This patchset adds pvpanic device support to QEMU virtual machines to
> provide extra virtual machine status (guest-panicked) when virtual
> machines panic.
>
> The pvpanic device can be implemented as an ISA device ('-device
> pvpanic') or as a PCI device ('-device pvpanic-pci') [0]. The ISA
> pvpanic device is only available on x86_64, and Linux VMs with kernel
>> =3.1 and <5.2 only support the ISA pvpanic device [1] [2]. Therefore,
> the patchset allows to choose between the two variants to fit different
> needs, and adds a documentation section to help picking the variant.
>
> [0]: https://www.qemu.org/docs/master/specs/pvpanic.html
> [1]: https://www.kernelconfig.io/CONFIG_PVPANIC
> [2]: https://www.kernelconfig.io/CONFIG_PVPANIC_PCI
>
>
> qemu-server:
>
> Kaiyang Wu (1):
> qemuserver: add pvpanic device
>
> src/PVE/API2/Qemu.pm | 1 +
> src/PVE/QemuServer.pm | 19 +++++++++++++++++++
> src/PVE/QemuServer/PCI.pm | 1 +
> 3 files changed, 21 insertions(+)
>
>
> docs:
>
> Kaiyang Wu (1):
> qm: add document section for the pvpanic device
>
> qm.adoc | 29 +++++++++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
>
> manager:
>
> Kaiyang Wu (1):
> ui: qemu: add pvpanic device support
>
> 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
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH qemu-server/docs/manager 0/3] add pvpanic device support
2026-08-27 10:35 [PATCH qemu-server/docs/manager 0/3] add pvpanic device support Kaiyang Wu
` (3 preceding siblings ...)
2026-09-03 8:42 ` [PATCH qemu-server/docs/manager 0/3] " Kaiyang Wu
@ 2026-09-04 8:30 ` Dominik Csapak
4 siblings, 0 replies; 8+ messages in thread
From: Dominik Csapak @ 2026-09-04 8:30 UTC (permalink / raw)
To: Kaiyang Wu, pve-devel; +Cc: Kaiyang Wu
Hi,
high level question:
with this series, the pvpanic device is added, but nothing on the other
side queries it? So what's the use case here?
I think it could come in handy, but we should actually do something with
it ;)
E.g. at least we could also set the panic handler in tandem:
--action panic=none|shutdown|...
e.g. a shutdown action on panic paired with our HA stack could
reboot the vm (didn't test though)
On 8/27/26 12:35 PM, Kaiyang Wu wrote:
> This patchset adds pvpanic device support to QEMU virtual machines to
> provide extra virtual machine status (guest-panicked) when virtual
> machines panic.
>
> The pvpanic device can be implemented as an ISA device ('-device
> pvpanic') or as a PCI device ('-device pvpanic-pci') [0]. The ISA
> pvpanic device is only available on x86_64, and Linux VMs with kernel
>> =3.1 and <5.2 only support the ISA pvpanic device [1] [2]. Therefore,
> the patchset allows to choose between the two variants to fit different
> needs, and adds a documentation section to help picking the variant.
>
> [0]: https://www.qemu.org/docs/master/specs/pvpanic.html
> [1]: https://www.kernelconfig.io/CONFIG_PVPANIC
> [2]: https://www.kernelconfig.io/CONFIG_PVPANIC_PCI
>
>
> qemu-server:
>
> Kaiyang Wu (1):
> qemuserver: add pvpanic device
>
> src/PVE/API2/Qemu.pm | 1 +
> src/PVE/QemuServer.pm | 19 +++++++++++++++++++
> src/PVE/QemuServer/PCI.pm | 1 +
> 3 files changed, 21 insertions(+)
>
>
> docs:
>
> Kaiyang Wu (1):
> qm: add document section for the pvpanic device
>
> qm.adoc | 29 +++++++++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
>
> manager:
>
> Kaiyang Wu (1):
> ui: qemu: add pvpanic device support
>
> 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
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH manager 3/3] ui: qemu: add pvpanic device support
2026-08-27 10:35 ` [PATCH manager 3/3] ui: qemu: add pvpanic device support Kaiyang Wu
@ 2026-09-04 8:30 ` Dominik Csapak
0 siblings, 0 replies; 8+ messages in thread
From: Dominik Csapak @ 2026-09-04 8:30 UTC (permalink / raw)
To: Kaiyang Wu, pve-devel; +Cc: Kaiyang Wu
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 <wukaiyang@loongfans.cn>
> ---
> 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);
> + },
> + });
> + },
> +});
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH qemu-server 1/3] qemuserver: add pvpanic device
2026-08-27 10:35 ` [PATCH qemu-server 1/3] qemuserver: add pvpanic device Kaiyang Wu
@ 2026-09-04 8:30 ` Dominik Csapak
0 siblings, 0 replies; 8+ messages in thread
From: Dominik Csapak @ 2026-09-04 8:30 UTC (permalink / raw)
To: Kaiyang Wu, pve-devel; +Cc: Kaiyang Wu
comment inline
On 8/27/26 12:35 PM, Kaiyang Wu wrote:
> Add pvpanic device to monitor virtual machine system panics. Add pvpanic
> field in virtual machine configuration files, allowing to choose the ISA
> or the PCI variant of the pvpanic device.
>
> Signed-off-by: Kaiyang Wu <wukaiyang@loongfans.cn>
> ---
> src/PVE/API2/Qemu.pm | 1 +
> src/PVE/QemuServer.pm | 19 +++++++++++++++++++
> src/PVE/QemuServer/PCI.pm | 1 +
> 3 files changed, 21 insertions(+)
>
> diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
> index 71247eec..933f6221 100644
> --- a/src/PVE/API2/Qemu.pm
> +++ b/src/PVE/API2/Qemu.pm
> @@ -818,6 +818,7 @@ my $hwtypeoptions = {
> 'watchdog' => 1,
> 'audio0' => 1,
> 'rng0' => 1,
> + 'pvpanic0' => 1,
> };
>
> my $generaloptions = {
> diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
> index 63d8c135..f476af94 100644
> --- a/src/PVE/QemuServer.pm
> +++ b/src/PVE/QemuServer.pm
> @@ -739,6 +739,13 @@ EODESCR
> optional => 1,
> default => 1,
> },
> + pvpanic0 => {
since it won't make sense (ever?) to add multiple panic devices,
i think having simply 'pvpanic' is enough, no need to add an index
> + optional => 1,
> + type => 'string',
> + description => "Configure a pvpanic device to monitor guest panics",
> + enum => [qw(pvpanic pvpanic-pci)],
is it really useful to have two variants? couldn't we always
use the PCI variant or is there some specific usecase for the ISA one?
It could even be simply an option somewhere else (e.g. on the machine
maybe?)
if we just have single option, this might simplify the code below...
> + default => undef,
> + },
> };
>
> my $cicustom_fmt = {
> @@ -3415,6 +3422,18 @@ sub config_to_command {
> push @$cmd, '-nographic';
> }
>
> + my $pvpanic = $conf->{pvpanic0};
> + if (defined($pvpanic)) {
> + if ($pvpanic eq 'pvpanic') {
> + push @$devices, '-device', $pvpanic;
> + } elsif ($pvpanic eq 'pvpanic-pci') {
> + my $pvpanicpciaddr = print_pci_addr("pvpanic0", $bridges, $arch);
> + push @$devices, '-device', "$pvpanic,id=pvpanic$pvpanicpciaddr";
> + } else {
> + die "unknown pvpanic device type $pvpanic";
> + }
> + }
... here.
this would all collapse into a single
---
if (defined()) {
push ...
}
---
part
> +
> # For now, handles only specific parts, but the final goal is to cover everything.
> my $cfg2cmd_opts = { forcemachine => $forcemachine };
> my $cfg2cmd = PVE::QemuServer::Cfg2Cmd->new($conf, $defaults, $version_guard, $cfg2cmd_opts);
> diff --git a/src/PVE/QemuServer/PCI.pm b/src/PVE/QemuServer/PCI.pm
> index 0b67943c..56770091 100644
> --- a/src/PVE/QemuServer/PCI.pm
> +++ b/src/PVE/QemuServer/PCI.pm
> @@ -220,6 +220,7 @@ sub get_pci_addr_map {
> 'pci.4' => { bus => 1, addr => 28 },
> 'rng0' => { bus => 1, addr => 29 },
> 'pci.2-igd' => { bus => 1, addr => 30 }, # replaces pci.2 in case a legacy IGD device is passed through
> + 'pvpanic0' => { bus => 1, addr => 31 },
> 'virtio6' => { bus => 2, addr => 1 },
> 'virtio7' => { bus => 2, addr => 2 },
> 'virtio8' => { bus => 2, addr => 3 },
side note (not really directed at you though)"
urgh i really hate that we have to do it this way (finding free slots
by checking each line if there is a gap...)
I'm currently rewriting part of the pci addr handling so this
should become a bit better in the future...
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-09-04 8:30 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-27 10:35 [PATCH qemu-server/docs/manager 0/3] add pvpanic device support Kaiyang Wu
2026-08-27 10:35 ` [PATCH qemu-server 1/3] qemuserver: add pvpanic device Kaiyang Wu
2026-09-04 8:30 ` Dominik Csapak
2026-08-27 10:35 ` [PATCH docs 2/3] qm: add document section for the " Kaiyang Wu
2026-08-27 10:35 ` [PATCH manager 3/3] ui: qemu: add pvpanic device support Kaiyang Wu
2026-09-04 8:30 ` Dominik Csapak
2026-09-03 8:42 ` [PATCH qemu-server/docs/manager 0/3] " Kaiyang Wu
2026-09-04 8:30 ` Dominik Csapak
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.