[pve-devel] [PATCH qemu-server] snapshot: save VM state: propagate error from QEMU

Fiona Ebner f.ebner at proxmox.com
Mon Aug 29 12:54:54 CEST 2022


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 at proxmox.com>
---
 PVE/QemuConfig.pm | 3 +++
 1 file changed, 3 insertions(+)

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






More information about the pve-devel mailing list