]> git.proxmox.com Git - qemu-server.git/blobdiff - PVE/QemuServer.pm
fix pbs-restore call for non raw images
[qemu-server.git] / PVE / QemuServer.pm
index 8e3fadfed0f000ce2d0f50286755094cb01fd831..c262f4aa1cc47583e1f6dad020d2786b6bdedb98 100644 (file)
@@ -4065,6 +4065,14 @@ sub qemu_netdevadd {
     my $netdev = print_netdev_full($vmid, $conf, $arch, $device, $deviceid, 1);
     my %options =  split(/[=,]/, $netdev);
 
+    if (defined(my $vhost = $options{vhost})) {
+       $options{vhost} = JSON::boolean(PVE::JSONSchema::parse_boolean($vhost));
+    }
+
+    if (defined(my $queues = $options{queues})) {
+       $options{queues} = $queues + 0;
+    }
+
     mon_cmd($vmid, "netdev_add",  %options);
     return 1;
 }
@@ -5655,6 +5663,9 @@ sub tar_restore_cleanup {
 sub restore_file_archive {
     my ($archive, $vmid, $user, $opts) = @_;
 
+    return restore_vma_archive($archive, $vmid, $user, $opts)
+       if $archive eq '-';
+
     my $info = PVE::Storage::archive_info($archive);
     my $format = $opts->{format} // $info->{format};
     my $comp = $info->{compression};
@@ -6165,6 +6176,8 @@ sub restore_proxmox_backup_archive {
                '--verbose',
                ];
 
+           push @$pbs_restore_cmd, '--format', $d->{format} if $d->{format};
+
            if (PVE::Storage::volume_has_feature($storecfg, 'sparseinit', $volid)) {
                push @$pbs_restore_cmd, '--skip-zero';
            }