If disk read/write cannot be queried because of QMP timeout, they
should not be reported as 0, because a consumer of the RRD stats
cannot distinguish between 0 being an actual 0 value and 0 being an
indicator for the absence of the real value. The RRD graphs in the UI
will already show this correctly.

Signed-off-by: Fiona Ebner <[email protected]>
---

Changes in v2:
* New approach, return undef instead of caching previous value.

 src/PVE/QemuServer.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to