public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Erik Fastermann <e.fastermann@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Erik Fastermann <e.fastermann@proxmox.com>
Subject: [PATCH qemu v2 8/9] savevm-async: include reason when file open fails
Date: Mon,  7 Sep 2026 11:47:42 +0200	[thread overview]
Message-ID: <20260907094744.131193-9-e.fastermann@proxmox.com> (raw)
In-Reply-To: <20260907094744.131193-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 d21fb1f..94908d7 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     | 632 +++++++++++++++++++++++++++++++++++
+ migration/savevm-async.c     | 634 +++++++++++++++++++++++++++++++++++
  monitor/hmp-cmds.c           |  38 +++
  qapi/migration.json          |  34 ++
  qapi/misc.json               |  25 ++
  qemu-options.hx              |  12 +
  system/vl.c                  |  10 +
- 11 files changed, 787 insertions(+)
+ 11 files changed, 789 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..d688fc7112
+index 0000000000..56c60b345f
 --- /dev/null
 +++ b/migration/savevm-async.c
-@@ -0,0 +1,632 @@
+@@ -0,0 +1,634 @@
 +#include "qemu/osdep.h"
 +#include "migration/channel-savevm-async.h"
 +#include "migration/migration.h"
@@ -570,7 +571,8 @@ index 0000000000..d688fc7112
 +    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);
@@ -729,7 +731,8 @@ index 0000000000..d688fc7112
 +    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 cac1842..4345f42 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 d688fc7112..24f7ba60c9 100644
+index 56c60b345f..a460970dd5 100644
 --- a/migration/savevm-async.c
 +++ b/migration/savevm-async.c
-@@ -424,7 +424,7 @@ void qmp_savevm_start(const char *statefile, bool has_skip_vm_start,
+@@ -425,7 +425,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 d688fc7112..24f7ba60c9 100644
      object_unref(ioc);
  
      if (!snap_state.file) {
-@@ -587,7 +587,7 @@ int load_snapshot_from_blockdev(const char *filename, Error **errp)
+@@ -589,7 +589,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 98a0ca4..d87875b 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 24f7ba60c9..78fc27b320 100644
+index a460970dd5..b703c5d5a3 100644
 --- a/migration/savevm-async.c
 +++ b/migration/savevm-async.c
 @@ -390,7 +390,7 @@ void qmp_savevm_start(const char *statefile, bool has_skip_vm_start,
-- 
2.47.3




  parent reply	other threads:[~2026-09-07  9:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07  9:47 [PATCH qemu v2 0/9] savevm-async: fix stuck paused vm after snapshot Erik Fastermann
2026-09-07  9:47 ` [PATCH qemu v2 1/9] d/patches: normalize header of pbs-restore no-cache patch Erik Fastermann
2026-09-07  9:47 ` [PATCH qemu v2 2/9] pbs-restore: keep callback data on the stack Erik Fastermann
2026-09-07  9:47 ` [PATCH qemu v2 3/9] migration/qemu-file: allocate buffer with g_malloc Erik Fastermann
2026-09-07  9:47 ` [PATCH qemu v2 4/9] migration/pbs-state: check allocation of incoming state buffer Erik Fastermann
2026-09-07  9:47 ` [PATCH qemu v2 5/9] savevm-async: drop QIOChannel reference Erik Fastermann
2026-09-08 14:22   ` Fiona Ebner
2026-09-07  9:47 ` [PATCH qemu v2 6/9] savevm-async: free migration vmdesc Erik Fastermann
2026-09-08 14:22   ` Fiona Ebner
2026-09-07  9:47 ` [PATCH qemu v2 7/9] savevm-async: release resources on start failure path Erik Fastermann
2026-09-07  9:47 ` Erik Fastermann [this message]
2026-09-07  9:47 ` [PATCH qemu v2 9/9] savevm-async: restore run state from before snapshot Erik Fastermann
2026-09-08 14:22   ` Fiona Ebner
2026-09-08 14:21 ` partially-applied: [PATCH qemu v2 0/9] savevm-async: fix stuck paused vm after snapshot Fiona Ebner

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=20260907094744.131193-9-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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal