From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 1B36D1FF0A7 for ; Wed, 02 Sep 2026 15:56:04 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 9730521636; Wed, 02 Sep 2026 15:55:46 +0200 (CEST) From: Fiona Ebner 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 Message-ID: <20260902135536.525194-8-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260902135536.525194-1-f.ebner@proxmox.com> References: <20260902135536.525194-1-f.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1788357336229 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.745 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 2EOSV4VJUC7IGAPQCZKB6NTYEIGXZ5K4 X-Message-ID-Hash: 2EOSV4VJUC7IGAPQCZKB6NTYEIGXZ5K4 X-MailFrom: f.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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