I finally implement it this way:

https://git.proxmox.com/?p=qemu-server.git;a=commitdiff;h=bcc87408c06c860d190981c5e77067e3d0c3298f


> >> I think we should just skip the loop if we get an error.
> 
> Is this code ok for you ?:
> 
> 
> if (my $err = $@) {
> 
>  eval { vm_mon_cmd($vmid, "block-job-cancel", device => "drive-$drive"); };
> 
>  if(!$@){
>    while (1) {
>    my $stats = vm_mon_cmd($vmid, "query-block-jobs");
>    my $stat = @$stats[0];
>    last if !$stat;
>    sleep 1;
>    }
>   }
> 
>  die "mirroring error: $err" if $err;
> }
_______________________________________________
pve-devel mailing list
[email protected]
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to