]> git.proxmox.com Git - pve-qemu.git/commit - debian/patches/pve/0027-PVE-Backup-add-vma-backup-format-code.patch
vma: create: register all streams before entering coroutines
authorFabian Ebner <f.ebner@proxmox.com>
Mon, 14 Feb 2022 11:02:52 +0000 (12:02 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 14 Feb 2022 14:38:58 +0000 (15:38 +0100)
commit2bf61c3eb697f877be56e68ed11120f90b0ed6f1
tree3ac447eff40d64d70f8c3c1fa1cf0e1ddc727331
parentc07b2203b312fb2a4195b8c1712bcf353e8fa5dd
vma: create: register all streams before entering coroutines

Otherwise, the header might already get written by a coroutine and
registering further streams will fail after that.

Also adds a missing g_list_free call for the other GList that's used.

Reported in the community forum:
https://forum.proxmox.com/threads/104744/

Reproducer script (increase beyond 30 if the issue isn't triggered yet):
> #!/usr/bin/perl
>
> my $dir = "./vma-create-bug";
> mkdir $dir;
>
> my $archive_path = "$dir/vzdump-qemu-104-2202_02_02-00_00_00.vma";
> unlink $archive_path;
>
> my $cmd = "vma create $archive_path -v";
> for (my $i = 0; $i < 30; $i++) {
>   system("truncate -s 1M $dir/drive-virtio$i.img");
>   $cmd .= " drive-virtio$i=$dir/drive-virtio$i.img";
> }
> system($cmd);

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
debian/patches/pve/0025-PVE-Backup-add-vma-backup-format-code.patch