From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server v3 06/14] api2: qemu: add module exposing node migration capabilities
Date: Thu, 3 Jul 2025 13:54:08 +0200 [thread overview]
Message-ID: <20250703115621.883244-7-c.heiss@proxmox.com> (raw)
In-Reply-To: <20250703115621.883244-1-c.heiss@proxmox.com>
Similar to the already existing ones for CPU and QEMU machine support.
Very simple for now, only provides one property for now:
'has-dbus-vmstate' - Whether the dbus-vmstate is available/installed
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
Changes v1 -> v2:
* no changes
Changes v2 -> v3:
* moved module from PVE::API2::Qemu::Migration to
PVE::API2::NodeCapabilities::Qemu::Migration, based on Fiona's
suggestion
* formatted using perltidy
src/PVE/API2/Makefile | 1 +
src/PVE/API2/NodeCapabilities/Makefile | 9 ++++
.../API2/NodeCapabilities/Qemu/Migration.pm | 48 +++++++++++++++++++
3 files changed, 58 insertions(+)
create mode 100644 src/PVE/API2/NodeCapabilities/Makefile
create mode 100644 src/PVE/API2/NodeCapabilities/Qemu/Migration.pm
diff --git a/src/PVE/API2/Makefile b/src/PVE/API2/Makefile
index f8fce567..4620703c 100644
--- a/src/PVE/API2/Makefile
+++ b/src/PVE/API2/Makefile
@@ -7,3 +7,4 @@ install:
install -d -m 0755 $(DESTDIR)$(PERLDIR)/PVE/API2
install -D -m 0644 Qemu.pm $(DESTDIR)$(PERLDIR)/PVE/API2/Qemu.pm
$(MAKE) -C Qemu install
+ $(MAKE) -C NodeCapabilities install
diff --git a/src/PVE/API2/NodeCapabilities/Makefile b/src/PVE/API2/NodeCapabilities/Makefile
new file mode 100644
index 00000000..b35f5529
--- /dev/null
+++ b/src/PVE/API2/NodeCapabilities/Makefile
@@ -0,0 +1,9 @@
+DESTDIR=
+PREFIX=/usr
+PERLDIR=$(PREFIX)/share/perl5
+
+SOURCES := Qemu/Migration.pm
+
+.PHONY: install
+install: $(SOURCES)
+ for i in $(SOURCES); do install -D -m 0644 $$i $(DESTDIR)$(PERLDIR)/PVE/API2/NodeCapabilities/$$i; done
diff --git a/src/PVE/API2/NodeCapabilities/Qemu/Migration.pm b/src/PVE/API2/NodeCapabilities/Qemu/Migration.pm
new file mode 100644
index 00000000..98d683c3
--- /dev/null
+++ b/src/PVE/API2/NodeCapabilities/Qemu/Migration.pm
@@ -0,0 +1,48 @@
+package PVE::API2::NodeCapabilities::Qemu::Migration;
+
+use strict;
+use warnings;
+
+use JSON;
+use PVE::JSONSchema qw(get_standard_option);
+use PVE::RESTHandler;
+
+use base qw(PVE::RESTHandler);
+
+__PACKAGE__->register_method({
+ name => 'capabilities',
+ path => '',
+ method => 'GET',
+ proxyto => 'node',
+ description => 'Get node-specific QEMU migration capabilities of the node.'
+ . " Requires the 'Sys.Audit' permission on '/nodes/<node>'.",
+ permissions => {
+ check => ['perm', '/nodes/{node}', ['Sys.Audit']],
+ },
+ parameters => {
+ additionalProperties => 0,
+ properties => {
+ node => get_standard_option('pve-node'),
+ },
+ },
+ returns => {
+ type => 'object',
+ additionalProperties => 0,
+ properties => {
+ 'dbus-vmstate' => {
+ type => 'boolean',
+ description => 'Whether the host supports live-migrating additional'
+ . ' VM state via the dbus-vmstate helper.',
+ },
+ },
+ },
+ code => sub {
+ return {
+ 'has-dbus-vmstate' => -f '/usr/libexec/qemu-server/dbus-vmstate'
+ ? JSON::true
+ : JSON::false,
+ };
+ },
+});
+
+1;
--
2.49.0
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-07-03 11:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-03 11:54 [pve-devel] [PATCH ve-rs/firewall/qemu-server/manager/docs v3 00/14] fix #5180: migrate conntrack state on live migration Christoph Heiss
2025-07-03 11:54 ` [pve-devel] [PATCH proxmox-ve-rs v3 01/14] config: guest: allow access to raw Vmid value Christoph Heiss
2025-07-03 11:54 ` [pve-devel] [PATCH proxmox-firewall v3 02/14] firewall: add connmark rule with VMID to all guest chains Christoph Heiss
2025-07-03 11:54 ` [pve-devel] [PATCH firewall v3 03/14] " Christoph Heiss
2025-07-03 11:54 ` [pve-devel] [PATCH firewall v3 04/14] firewall: helpers: add sub for flushing conntrack entries by mark Christoph Heiss
2025-07-03 11:54 ` [pve-devel] [PATCH qemu-server v3 05/14] qmp helpers: allow passing structured args via qemu_objectadd() Christoph Heiss
2025-07-03 11:54 ` Christoph Heiss [this message]
2025-07-03 11:54 ` [pve-devel] [PATCH qemu-server v3 07/14] fix #5180: dbus-vmstate: add daemon for QEMUs dbus-vmstate interface Christoph Heiss
2025-07-03 11:54 ` [pve-devel] [PATCH qemu-server v3 08/14] fix #5180: migrate: integrate helper for live-migrating conntrack info Christoph Heiss
2025-07-03 11:54 ` [pve-devel] [PATCH qemu-server v3 09/14] migrate: flush old VM conntrack entries after successful migration Christoph Heiss
2025-07-03 11:54 ` [pve-devel] [PATCH manager v3 10/14] api2: capabilities: explicitly import CPU capabilities module Christoph Heiss
2025-07-03 11:54 ` [pve-devel] [PATCH manager v3 11/14] api2: capabilities: proxy index endpoints to respective nodes Christoph Heiss
2025-07-03 11:54 ` [pve-devel] [PATCH manager v3 12/14] api2: capabilities: expose new qemu/migration endpoint Christoph Heiss
2025-07-03 11:54 ` [pve-devel] [PATCH manager v3 13/14] ui: window: Migrate: add checkbox for migrating VM conntrack state Christoph Heiss
2025-07-03 11:54 ` [pve-devel] [PATCH docs v3 14/14] qm: document conntrack state migration for live migrations Christoph Heiss
2025-07-17 14:16 ` [pve-devel] [PATCH ve-rs/firewall/qemu-server/manager/docs v3 00/14] fix #5180: migrate conntrack state on live migration Christoph Heiss
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=20250703115621.883244-7-c.heiss@proxmox.com \
--to=c.heiss@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/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