On 2/18/20 4:09 PM, Dominik Csapak wrote:
one comment inline

On 2/17/20 12:41 PM, Fabian Ebner wrote:
Also gets rid of an error with qmp block_resize, which expects
that the size is a multiple of 512 bytes for qcow2 volumes.

Signed-off-by: Fabian Ebner <f.eb...@proxmox.com>
---
  PVE/QemuServer.pm | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 23176dd..d2f0ff6 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -4652,11 +4652,13 @@ sub qemu_block_resize {
      my $running = check_running($vmid);
+    my $size = PVE::Tools::convert_size($size, "b" => "kb");

this my produces a warning that it shadows the previous definition
(from the parameters)


Of course the "my " shouldn't be there. Thanks for catching this.

+
      $size = 0 if !PVE::Storage::volume_resize($storecfg, $volid, $size, $running);
      return if !$running;
-    mon_cmd($vmid, "block_resize", device => $deviceid, size => int($size)); +    mon_cmd($vmid, "block_resize", device => $deviceid, size => int($size) * 1024);
  }



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


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

Reply via email to