--- Begin Message ---
We need to use the top blocknode (throttle) as name-node

Signed-off-by: Alexandre Derumier <alexandre.derum...@groupe-cyllene.com>
---
 PVE/QemuServer.pm | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 8e1369fc..04e71fb6 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -4656,13 +4656,24 @@ sub qemu_block_resize {
     my $padding = (1024 - $size % 1024) % 1024;
     $size = $size + $padding;
 
-    mon_cmd(
-       $vmid,
-       "block_resize",
-       device => $deviceid,
-       size => int($size),
-       timeout => 60,
-    );
+    my $machine_type = 
PVE::QemuServer::Machine::get_current_qemu_machine($vmid);
+    if (PVE::QemuServer::Machine::is_machine_version_at_least($machine_type, 
10, 0)) {
+       mon_cmd(
+           $vmid,
+           "block_resize",
+           'node-name' => $deviceid,
+           size => int($size),
+           timeout => 60,
+       );
+    } else {
+       mon_cmd(
+           $vmid,
+           "block_resize",
+           device => $deviceid,
+           size => int($size),
+           timeout => 60,
+       );
+    }
 }
 
 sub qemu_volume_snapshot {
-- 
2.39.5



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

Reply via email to