[pdm-devel] [PATCH proxmox 2/2] fix #7080: pve-api-types: mark 'has-dbus-vmstate' optional

Dominik Csapak d.csapak at proxmox.com
Mon Dec 1 16:00:14 CET 2025


this was introduced in PVE9. Since PVE8 does not return this at all,
de-serialization fails on PDM. To work around this, mark it as optional
in the api type so de-serialization works again. (We currently don't use
this value in PDM anyway)

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 pve-api-types/generate.pl            | 4 ++++
 pve-api-types/src/generated/types.rs | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/pve-api-types/generate.pl b/pve-api-types/generate.pl
index f72a776a..e92f776d 100755
--- a/pve-api-types/generate.pl
+++ b/pve-api-types/generate.pl
@@ -244,6 +244,10 @@ api(PUT => '/nodes/{node}/qemu/{vmid}/resize', 'qemu_resize', 'param-name' => 'Q
 api(POST => '/nodes/{node}/qemu/{vmid}/status/start',    'start_qemu_async',    'output-type' => 'PveUpid', 'param-name' => 'StartQemu');
 api(POST => '/nodes/{node}/qemu/{vmid}/status/stop',     'stop_qemu_async',     'output-type' => 'PveUpid', 'param-name' => 'StopQemu');
 api(POST => '/nodes/{node}/qemu/{vmid}/status/shutdown', 'shutdown_qemu_async', 'output-type' => 'PveUpid', 'param-name' => 'ShutdownQemu');
+
+# PVE9 introduced a non-optional return value, mark it optional manually so we can still use it with PVE8
+my $r = (Schema2Rust::get_return_type(GET => '/nodes/{node}/qemu/{vmid}/migrate'))->{properties};
+$r->{'has-dbus-vmstate'}->{optional} = '1';
 api(GET => '/nodes/{node}/qemu/{vmid}/migrate',           'qemu_migrate_preconditions', 'return-name' => 'QemuMigratePreconditions');
 Schema2Rust::derive('QemuMigratePreconditionsNotAllowedNodesBlockingHaResources' => 'Clone', 'PartialEq');
 Schema2Rust::derive('QemuMigratePreconditionsNotAllowedNodes' => 'Clone', 'PartialEq');
diff --git a/pve-api-types/src/generated/types.rs b/pve-api-types/src/generated/types.rs
index 01c7f0cd..557f90f7 100644
--- a/pve-api-types/src/generated/types.rs
+++ b/pve-api-types/src/generated/types.rs
@@ -13047,6 +13047,7 @@ serde_plain::derive_fromstr_from_deserialize!(QemuConfigVirtiofsCache);
         },
         "has-dbus-vmstate": {
             default: false,
+            optional: true,
         },
         local_disks: {
             items: {
@@ -13098,8 +13099,9 @@ pub struct QemuMigratePreconditions {
     /// Whether the VM host supports migrating additional VM state, such as
     /// conntrack entries.
     #[serde(deserialize_with = "proxmox_serde::perl::deserialize_bool")]
+    #[serde(default, skip_serializing_if = "Option::is_none")]
     #[serde(rename = "has-dbus-vmstate")]
-    pub has_dbus_vmstate: bool,
+    pub has_dbus_vmstate: Option<bool>,
 
     /// List local disks including CD-Rom, unused and not referenced disks
     pub local_disks: Vec<QemuMigratePreconditionsLocalDisks>,
-- 
2.47.3





More information about the pdm-devel mailing list