all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [RFC qemu 7/9] PVE backup: properly track if snapshot access was set up
Date: Wed,  2 Sep 2026 15:54:38 +0200	[thread overview]
Message-ID: <20260902135536.525194-8-f.ebner@proxmox.com> (raw)
In-Reply-To: <20260902135536.525194-1-f.ebner@proxmox.com>

Regular backups set the target ID to "Proxmox". When using QMP
'backup-access-teardown' there is a check to error out when it's not a
regular backup, but this wrongly compared against "Proxmox VE",
rendering the check moot. This should not happen via the Proxmox VE
stack anyway, but still good to fix up. Avoid deciding implicitly
based on the target ID, keep track of whether the backup was set up
for snapshot access or if it is a regular backup explicitly.

In preparation to support different target IDs for regular backups
too.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 pve-backup.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pve-backup.c b/pve-backup.c
index ad0f8668fd..8a97f0425e 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -74,6 +74,7 @@ static struct PVEBackupState {
     CoMutex backup_mutex;
     CoMutex dump_callback_mutex;
     char *target_id;
+    bool is_backup_access;
 } backup_state;
 
 static void pvebackup_init(void)
@@ -1168,6 +1169,7 @@ BackupAccessInfoList *coroutine_fn qmp_backup_access_setup(
     qemu_mutex_unlock(&backup_state.stat.lock);
 
     backup_state_set_target_id(target_id);
+    backup_state.is_backup_access = true;
 
     backup_state.vmaw = NULL;
     backup_state.pbs = NULL;
@@ -1316,7 +1318,7 @@ void coroutine_fn qmp_backup_access_teardown(const char *target_id, bool success
         return;
     }
 
-    if (!strcmp(backup_state.target_id, "Proxmox VE")) {
+    if (!backup_state.is_backup_access) {
         error_setg(errp, "cannot teardown backup access for PVE - use backup-cancel instead");
         qemu_co_mutex_unlock(&backup_state.backup_mutex);
         return;
@@ -1594,6 +1596,7 @@ UuidInfo coroutine_fn *qmp_backup(
     backup_state.pbs = pbs;
 
     backup_state_set_target_id("Proxmox");
+    backup_state.is_backup_access = false;
 
     backup_state.di_list = di_list;
 
-- 
2.47.3





  parent reply	other threads:[~2026-09-02 13:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02 13:54 [RFC qemu/qemu-server/proxmox-backup-qemu 0/9] close #6169: backup: pbs: per-target dirty bitmaps Fiona Ebner
2026-09-02 13:54 ` [PATCH proxmox-backup-qemu 1/9] clippy: restore: fix needless borrows Fiona Ebner
2026-09-02 13:54 ` [PATCH proxmox-backup-qemu 2/9] clippy: commands: avoid manual implementation of ok() Fiona Ebner
2026-09-02 13:54 ` [RFC proxmox-backup-qemu 3/9] cargo: add dependency for serde Fiona Ebner
2026-09-02 13:54 ` [RFC proxmox-backup-qemu 4/9] close #6169: track checksums for incremental backups per target Fiona Ebner
2026-09-02 13:54 ` [RFC proxmox-backup-qemu 5/9] update current-api.h Fiona Ebner
2026-09-02 13:54 ` [RFC proxmox-backup-qemu 6/9] d/control: bump versioned breaks for pve-qemu-kvm Fiona Ebner
2026-09-02 13:54 ` Fiona Ebner [this message]
2026-09-02 13:54 ` [RFC qemu 8/9] PVE backup: track per-target dirty bitmaps Fiona Ebner
2026-09-02 13:54 ` [RFC qemu-server 9/9] close #6169: backup: pbs: specify target ID so QEMU keeps track of per-target dirty bitmap Fiona Ebner
2026-09-02 14:34 ` [RFC qemu/qemu-server/proxmox-backup-qemu 0/9] close #6169: backup: pbs: per-target dirty bitmaps Dominik Csapak

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=20260902135536.525194-8-f.ebner@proxmox.com \
    --to=f.ebner@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal