[pve-devel] [PATCH qemu-server 18/23] restore: die early when there is no size for a device

Fiona Ebner f.ebner at proxmox.com
Tue Jul 23 11:56:19 CEST 2024


Makes it a clean error for buggy (external) backup providers where the
size might not be set at all.

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 PVE/QemuServer.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index d05705b1..0db9f667 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6755,6 +6755,7 @@ my $restore_allocate_devices = sub {
     my $map = {};
     foreach my $virtdev (sort keys %$virtdev_hash) {
 	my $d = $virtdev_hash->{$virtdev};
+	die "got no size for '$virtdev'\n" if !defined($d->{size});
 	my $alloc_size = int(($d->{size} + 1024 - 1)/1024);
 	my $storeid = $d->{storeid};
 	my $scfg = PVE::Storage::storage_config($storecfg, $storeid);
-- 
2.39.2





More information about the pve-devel mailing list