From: Erik Fastermann <e.fastermann@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Erik Fastermann <e.fastermann@proxmox.com>
Subject: [PATCH qemu v3 3/4] savevm-async: include reason when file open fails
Date: Mon, 14 Sep 2026 12:46:41 +0200 [thread overview]
Message-ID: <20260914104642.145478-4-e.fastermann@proxmox.com> (raw)
In-Reply-To: <20260914104642.145478-1-e.fastermann@proxmox.com>
blk_new_open() reports why it could not open the file, but the error was
discarded.
Signed-off-by: Erik Fastermann <e.fastermann@proxmox.com>
---
...m-async-for-background-state-snapshots.patch | 17 ++++++++++-------
...E-add-optional-buffer-size-to-QEMUFile.patch | 6 +++---
...euse-migration-blocker-check-for-snaps.patch | 2 +-
3 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/debian/patches/pve/0017-PVE-add-savevm-async-for-background-state-snapshots.patch b/debian/patches/pve/0017-PVE-add-savevm-async-for-background-state-snapshots.patch
index a4571d8..30400a1 100644
--- a/debian/patches/pve/0017-PVE-add-savevm-async-for-background-state-snapshots.patch
+++ b/debian/patches/pve/0017-PVE-add-savevm-async-for-background-state-snapshots.patch
@@ -39,7 +39,8 @@ Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
[EF: drop QIOChannel reference
free migration vmdesc
- release resources on start failure path]
+ release resources on start failure path
+ include reason when file open fails]
Signed-off-by: Erik Fastermann <e.fastermann@proxmox.com>
---
hmp-commands-info.hx | 13 +
@@ -47,13 +48,13 @@ Signed-off-by: Erik Fastermann <e.fastermann@proxmox.com>
include/migration/snapshot.h | 2 +
include/monitor/hmp.h | 3 +
migration/meson.build | 1 +
- migration/savevm-async.c | 636 +++++++++++++++++++++++++++++++++++
+ migration/savevm-async.c | 638 +++++++++++++++++++++++++++++++++++
monitor/hmp-cmds.c | 38 +++
qapi/migration.json | 34 ++
qapi/misc.json | 25 ++
qemu-options.hx | 12 +
system/vl.c | 10 +
- 11 files changed, 791 insertions(+)
+ 11 files changed, 793 insertions(+)
create mode 100644 migration/savevm-async.c
diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
@@ -151,10 +152,10 @@ index 0222d5ea6e..90d62d5723 100644
), gnutls, zlib)
diff --git a/migration/savevm-async.c b/migration/savevm-async.c
new file mode 100644
-index 0000000000..ef014e93e8
+index 0000000000..bf8509b261
--- /dev/null
+++ b/migration/savevm-async.c
-@@ -0,0 +1,636 @@
+@@ -0,0 +1,638 @@
+#include "qemu/osdep.h"
+#include "migration/channel-savevm-async.h"
+#include "migration/migration.h"
@@ -571,7 +572,8 @@ index 0000000000..ef014e93e8
+ qdict_put_str(options, "driver", "raw");
+ snap_state.target = blk_new_open(statefile, NULL, options, bdrv_oflags, &local_err);
+ if (!snap_state.target) {
-+ error_setg(errp, "failed to open '%s'", statefile);
++ error_setg(errp, "failed to open '%s' - %s", statefile,
++ local_err ? error_get_pretty(local_err) : "unknown error");
+ goto fail;
+ }
+ target_bs = blk_bs(snap_state.target);
@@ -733,7 +735,8 @@ index 0000000000..ef014e93e8
+ be = blk_new_open(filename, NULL, options, 0, &local_err);
+
+ if (!be) {
-+ error_setg(errp, "Could not open VM state file");
++ error_setg(errp, "Could not open VM state file - %s",
++ local_err ? error_get_pretty(local_err) : "unknown error");
+ goto the_end;
+ }
+
diff --git a/debian/patches/pve/0018-PVE-add-optional-buffer-size-to-QEMUFile.patch b/debian/patches/pve/0018-PVE-add-optional-buffer-size-to-QEMUFile.patch
index 55b3359..caea753 100644
--- a/debian/patches/pve/0018-PVE-add-optional-buffer-size-to-QEMUFile.patch
+++ b/debian/patches/pve/0018-PVE-add-optional-buffer-size-to-QEMUFile.patch
@@ -186,10 +186,10 @@ index a390554208..eda093b16a 100644
G_DEFINE_AUTOPTR_CLEANUP_FUNC(QEMUFile, qemu_fclose)
diff --git a/migration/savevm-async.c b/migration/savevm-async.c
-index ef014e93e8..f3179b8ad0 100644
+index bf8509b261..94849f5219 100644
--- a/migration/savevm-async.c
+++ b/migration/savevm-async.c
-@@ -425,7 +425,7 @@ void qmp_savevm_start(const char *statefile, bool has_skip_vm_start,
+@@ -426,7 +426,7 @@ void qmp_savevm_start(const char *statefile, bool has_skip_vm_start,
QIOChannel *ioc = QIO_CHANNEL(qio_channel_savevm_async_new(snap_state.target,
&snap_state.bs_pos));
@@ -198,7 +198,7 @@ index ef014e93e8..f3179b8ad0 100644
object_unref(ioc);
if (!snap_state.file) {
-@@ -591,7 +591,7 @@ int load_snapshot_from_blockdev(const char *filename, Error **errp)
+@@ -593,7 +593,7 @@ int load_snapshot_from_blockdev(const char *filename, Error **errp)
/* restore the VM state */
QIOChannel *ioc = QIO_CHANNEL(qio_channel_savevm_async_new(be, &bs_pos));
diff --git a/debian/patches/pve/0046-savevm-async-reuse-migration-blocker-check-for-snaps.patch b/debian/patches/pve/0046-savevm-async-reuse-migration-blocker-check-for-snaps.patch
index 9801a2a..153a569 100644
--- a/debian/patches/pve/0046-savevm-async-reuse-migration-blocker-check-for-snaps.patch
+++ b/debian/patches/pve/0046-savevm-async-reuse-migration-blocker-check-for-snaps.patch
@@ -136,7 +136,7 @@ index b6888daced..80eb0dcd1f 100644
bool migration_in_postcopy(void);
bool migration_postcopy_is_alive(MigrationStatus state);
diff --git a/migration/savevm-async.c b/migration/savevm-async.c
-index f3179b8ad0..41eabea480 100644
+index 94849f5219..4ed5d510bf 100644
--- a/migration/savevm-async.c
+++ b/migration/savevm-async.c
@@ -391,7 +391,7 @@ void qmp_savevm_start(const char *statefile, bool has_skip_vm_start,
--
2.47.3
next prev parent reply other threads:[~2026-09-14 10:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 10:46 [PATCH qemu v3 0/4] savevm-async: fix stuck paused vm after snapshot Erik Fastermann
2026-09-14 10:46 ` [PATCH qemu v3 1/4] savevm-async: free migration vmdesc Erik Fastermann
2026-09-14 10:46 ` [PATCH qemu v3 2/4] savevm-async: release resources on start failure path Erik Fastermann
2026-09-14 10:46 ` Erik Fastermann [this message]
2026-09-14 10:46 ` [PATCH qemu v3 4/4] savevm-async: restore run state from before snapshot Erik Fastermann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260914104642.145478-4-e.fastermann@proxmox.com \
--to=e.fastermann@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox