5
0
mirror of git://git.proxmox.com/git/pve-guest-common.git synced 2025-01-31 01:47:21 +03:00

storage tunnel: correctly set disk-import parameters

according to the schema, else some combinations of migration / guest /
storage settings will fail validation:

2024-05-15 11:48:51 ERROR: migration_snapshot: type check ('boolean') failed - got ''

since this is client / source side, remote migrations to a remote node
with validation enabled can fail without this change.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2024-05-15 12:10:08 +02:00 committed by Thomas Lamprecht
parent 5dbf4609bd
commit 172ab9f5cc

View File

@ -50,13 +50,13 @@ sub storage_migrate {
my $disk_import_opts = {
format => $format,
storage => $targetsid,
snapshot => $snapshot,
migration_snapshot => $migration_snapshot,
migration_snapshot => $migration_snapshot ? 1 : 0,
with_snapshots => $with_snapshots,
allow_rename => !$opts->{is_vmstate},
export_formats => join(",", @export_formats),
volname => $name,
};
$disk_import_opts->{snapshot} = $snapshot if $snapshot;
my $res = PVE::Tunnel::write_tunnel($tunnel, 600, 'disk-import', $disk_import_opts);
my $local = "/run/pve/$local_vmid.storage";
if (!$tunnel->{forwarded}->{$local}) {