all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [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
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ 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] 4+ 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-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
  2 siblings, 0 replies; 4+ 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] 4+ 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 siblings, 0 replies; 4+ 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] 4+ 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
  2 siblings, 0 replies; 4+ 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] 4+ messages in thread

end of thread, other threads:[~2026-08-27 10:36 UTC | newest]

Thread overview: 4+ 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-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

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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal