[pve-devel] [PATCH qemu-server] Honour volume size returned by storage plugin.

Dmitry Petuhov mityapetuhov at gmail.com
Fri Jan 13 08:11:32 CET 2017


Actual volume size may slightly differ from requested because of
alignment and truncating, so feed qemu with actual size.

Also, some plugins may need to send zero instead of actual size to qemu.

Signed-off-by: Dmitry Petuhov <mityapetuhov at gmail.com>
---
 PVE/QemuServer.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index bc26da2..85a7ddd 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3980,9 +3980,9 @@ sub qemu_block_resize {
 
     my $running = check_running($vmid);
 
-    return if !PVE::Storage::volume_resize($storecfg, $volid, $size, $running);
+    $size = PVE::Storage::volume_resize($storecfg, $volid, $size, $running);
 
-    return if !$running;
+    return unless defined($size) && $running;
 
     vm_mon_cmd($vmid, "block_resize", device => $deviceid, size => int($size));
 
-- 
2.1.4



More information about the pve-devel mailing list