snapshot: save VM state: propagate error from QEMU

So that there is a better chance to debug issues like in [0]. For
suspending, which uses the same QMP calls, this is already done.

[0]: https://forum.proxmox.com/threads/114203/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fiona Ebner 2022-08-29 12:54:54 +02:00 committed by Thomas Lamprecht
parent adc67fe917
commit d064764a70

View File

@ -327,6 +327,9 @@ sub __snapshot_create_vol_snapshots_hook {
my ($b, $t) = $render_state->($stat); my ($b, $t) = $render_state->($stat);
print "completed saving the VM state in $t, saved $b\n"; print "completed saving the VM state in $t, saved $b\n";
last; last;
} elsif ($stat->{status} eq 'failed') {
my $err = $stat->{error} || 'unknown error';
die "unable to save VM state and RAM - $err\n";
} else { } else {
die "query-savevm returned unexpected status '$stat->{status}'\n"; die "query-savevm returned unexpected status '$stat->{status}'\n";
} }