public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server] vm status: make sure disk{read, write} adhere to return schema to fix regression for PDM
Date: Wed, 22 Oct 2025 12:41:15 +0200	[thread overview]
Message-ID: <20251022104259.47945-1-f.ebner@proxmox.com> (raw)

As reported in the community forum [0], Proxmox Datacenter Manager
will fail to handle the result of the status API call for a shut down
VM. The reason is that the return schema requires having an integer
return value for disk{read,write}, so an explicit undef is not
allowed. However, the properties are optional and are not relevant for
a shut down guest, so just don't set them at all if no value was
queried. This also makes sure that bug #6207 does not reappear. Note
that pvestatd would already not consider the value for shut down VMs
and treats the value not being present and the value being an explicit
undef the same, see update_qemu_status() in pvestatd.pm.

[0]: https://forum.proxmox.com/threads/160166/post-809901

Fixes: 528df523 ("fix #6207: vm status: return undef values when disk{read, write} cannot be queried")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/QemuServer.pm | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 8b8e8338..b9067120 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -2549,9 +2549,6 @@ sub vmstatus {
         $d->{netout} = 0;
         $d->{netin} = 0;
 
-        $d->{diskread} = undef;
-        $d->{diskwrite} = undef;
-
         $d->{template} = 1 if PVE::QemuConfig->is_template($conf);
 
         $d->{serial} = 1 if conf_has_serial($conf);
-- 
2.47.3



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


             reply	other threads:[~2025-10-22 10:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22 10:41 Fiona Ebner [this message]
2025-10-22 11:50 ` [pve-devel] applied: " Fabian Grünbichler

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=20251022104259.47945-1-f.ebner@proxmox.com \
    --to=f.ebner@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal