public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH proxmox 2/2] fix #7080: pve-api-types: mark 'has-dbus-vmstate' optional
Date: Mon,  1 Dec 2025 16:00:14 +0100	[thread overview]
Message-ID: <20251201150058.3461083-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20251201150058.3461083-1-d.csapak@proxmox.com>

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@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



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


  reply	other threads:[~2025-12-01 15:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01 15:00 [pdm-devel] [PATCH proxmox 1/2] pve-api-types: generator lib: add method to get return schema of api Dominik Csapak
2025-12-01 15:00 ` Dominik Csapak [this message]
2025-12-01 15:02 ` Dominik Csapak
2025-12-01 23:10 ` [pdm-devel] applied: " Thomas Lamprecht

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=20251201150058.3461083-2-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pdm-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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal