Signed-off-by: Aaron Lauterer <a.laute...@proxmox.com>
---

Notes:
    changes since:
    RFC:
    * switch from pve9-vm to pve-vm-90 schema

 src/PVE/API2/Qemu.pm | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
index 2e6358e..2867a53 100644
--- a/src/PVE/API2/Qemu.pm
+++ b/src/PVE/API2/Qemu.pm
@@ -1628,9 +1628,9 @@ __PACKAGE__->register_method({
     code => sub {
         my ($param) = @_;
 
-        return PVE::RRD::create_rrd_graph(
-            "pve2-vm/$param->{vmid}", $param->{timeframe}, $param->{ds}, 
$param->{cf},
-        );
+        my $path = "pve-vm-9.0/$param->{vmid}";
+        $path = "pve2-vm/$param->{vmid}" if !-e 
"/var/lib/rrdcached/db/${path}";
+        return PVE::RRD::create_rrd_graph($path, $param->{timeframe}, 
$param->{cf});
 
     },
 });
@@ -1672,8 +1672,9 @@ __PACKAGE__->register_method({
     code => sub {
         my ($param) = @_;
 
-        return PVE::RRD::create_rrd_data("pve2-vm/$param->{vmid}", 
$param->{timeframe},
-            $param->{cf});
+        my $path = "pve-vm-9.0/$param->{vmid}";
+        $path = "pve2-vm/$param->{vmid}" if !-e 
"/var/lib/rrdcached/db/${path}";
+        return PVE::RRD::create_rrd_data($path, $param->{timeframe}, 
$param->{cf});
     },
 });
 
-- 
2.39.5



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

Reply via email to