From 34fbf1a809251da97a471fb07b2b0a84bdbd6ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 10 Dec 2024 10:37:50 +0100 Subject: [PATCH] file-restore: fix -blockdev regression with namespaces or encryption MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QEMU CLI option parsing requires doubling the commas for values, this seems to be also used when a combined option is used to pass down the key=value pairs to the internal options, like for the combined -drive option that was replaced by the slightly lower-level blockdev option in commit 668b8383 ("file restore: qemu helper: switch to more modern blockdev option for drives"). So there we now could drop the comma duplication as blockdev directly interprets these options, thus no need for escaping the comma. We missed two instances because they were not part of the "main" format string, which broke some use cases. Fixes: 668b8383 ("file restore: qemu helper: switch to more modern blockdev option for drives") Signed-off-by: Fabian Grünbichler Tested-by: Mira Limbeck [ TL: add more context, but it's a bit guesstimation ] Signed-off-by: Thomas Lamprecht --- proxmox-file-restore/src/qemu_helper.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxmox-file-restore/src/qemu_helper.rs b/proxmox-file-restore/src/qemu_helper.rs index 1274dda3..e0e16911 100644 --- a/proxmox-file-restore/src/qemu_helper.rs +++ b/proxmox-file-restore/src/qemu_helper.rs @@ -281,14 +281,14 @@ pub async fn start_vm( } drives.push("-blockdev".to_owned()); let keyfile = if let Some(ref keyfile) = details.keyfile { - format!(",,keyfile={keyfile}") + format!(",keyfile={keyfile}") } else { "".to_owned() }; let namespace = if details.namespace.is_root() { String::new() } else { - format!(",,namespace={}", details.namespace) + format!(",namespace={}", details.namespace) }; drives.push(format!( "driver=pbs,repository={}{},snapshot={},archive={}{},read-only=on,node-name=drive{}",