From: Kaiyang Wu <wukaiyang2003@gmail.com>
To: pve-devel@lists.proxmox.com
Cc: Kaiyang Wu <wukaiyang@loongfans.cn>
Subject: [PATCH qemu-server 1/5] qemuserver: add pvpanic device
Date: Mon, 14 Sep 2026 17:20:08 +0800 [thread overview]
Message-ID: <20260914092015.125780-2-wukaiyang@loongfans.cn> (raw)
In-Reply-To: <20260914092015.125780-1-wukaiyang@loongfans.cn>
Add pvpanic PCI device to monitor guest system panics.
Suggested-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Kaiyang Wu <wukaiyang@loongfans.cn>
---
src/PVE/API2/Qemu.pm | 1 +
src/PVE/QemuServer.pm | 11 +++++++++++
src/PVE/QemuServer/PCI.pm | 1 +
3 files changed, 13 insertions(+)
diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
index 714c87a9..d60e90a8 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,
+ 'pvpanic' => 1,
};
my $generaloptions = {
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 5849392e..facbb06a 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -740,6 +740,12 @@ EODESCR
optional => 1,
default => 1,
},
+ pvpanic => {
+ optional => 1,
+ type => 'boolean',
+ description => "Configure a pvpanic device to monitor guest panics",
+ default => 0,
+ },
};
my $cicustom_fmt = {
@@ -3439,6 +3445,11 @@ sub config_to_command {
push @$cmd, '-nographic';
}
+ if (defined($conf->{pvpanic}) && $conf->{pvpanic}) {
+ my $pvpanicpciaddr = print_pci_addr("pvpanic", $arch);
+ push @$devices, '-device', "pvpanic-pci,id=pvpanic$pvpanicpciaddr";
+ }
+
# 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 35e18ad9..faaeffca 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
+ 'pvpanic' => { bus => 1, addr => 31 },
'virtio6' => { bus => 2, addr => 1 },
'virtio7' => { bus => 2, addr => 2 },
'virtio8' => { bus => 2, addr => 3 },
--
2.55.0
next prev parent reply other threads:[~2026-09-14 9:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 9:20 [PATCH qemu-server/docs/manager/ha-manager 0/5] add pvpanic device support Kaiyang Wu
2026-09-14 9:20 ` Kaiyang Wu [this message]
2026-09-14 9:20 ` [PATCH docs 2/5] qm: add document section for the pvpanic device Kaiyang Wu
2026-09-14 9:20 ` [PATCH manager 3/5] ui: qemu: add pvpanic device support Kaiyang Wu
2026-09-14 9:20 ` [PATCH ha-manager 4/5] vm resource: return running status -1 for panicked VMs Kaiyang Wu
2026-09-14 9:20 ` [PATCH ha-manager 5/5] lrm: stop and restart panicked VMs to keep the "started" state 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=20260914092015.125780-2-wukaiyang@loongfans.cn \
--to=wukaiyang2003@gmail.com \
--cc=pve-devel@lists.proxmox.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 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.