From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH-SERIES qemu-server 00/10] restore: check permissions up-front
Date: Fri, 27 Nov 2026 14:45:24 +0100 [thread overview]
Message-ID: <20261127134637.140854-1-f.ebner@proxmox.com> (raw)
Patch 01/10 is a code cleanup.
Patch 02/10 is a small improvement, skipping all non-main config
sections.
Patches 03/10 to 07/10 create the restore module and move functions
to it.
Patches 08/10 to 10/10 move the permission checks up to the beginning
of the restore.
There is already an early permission check with the extracted
configuration, but that is marked as "best-effort" and can race with
something modifies the configuration in the meantime.
Check for the configuration actually used by restore if the user has
the necessary permissions before destroying the old configuration and
restoring all drives which might take a long time.
I had forgotten that we also have the early check, so this is less
relevant than I initially thought, but I still think it's nice to
have. Improves modularity and shaves off 230 lines of QemuServer.pm.
Allows extracting a common helper for preparing the new configuration
to avoid some duplication. It cannot be moved into the new Restore
module, since it depends on parse_vm_config().
qemu-server:
Fiona Ebner (10):
restore: vma: rename variable for storage configuration
restore: skip non-main config sections
restore: introduce dedicated module
restore: move helper for cleaning up target to module
restore: move helper for parsing backup device hints to module
restore: move helpers to deactivate and destroy volumes to module
restore: move helpers to check identity and write config to module
restore: check permissions up-front
restore: extract common helper for preparing new configuration
restore: prepare new config before modifying the target
src/PVE/API2/Qemu.pm | 5 +-
src/PVE/QemuServer.pm | 442 ++++++----------------
src/PVE/QemuServer/Makefile | 1 +
src/PVE/QemuServer/Restore.pm | 247 ++++++++++++
src/test/restore-config-expected/160.conf | 6 +-
src/test/restore-config-input/160.conf | 2 +-
src/test/run_qemu_restore_config_tests.pl | 70 +++-
7 files changed, 415 insertions(+), 358 deletions(-)
create mode 100644 src/PVE/QemuServer/Restore.pm
Summary over all repositories:
7 files changed, 415 insertions(+), 358 deletions(-)
--
Generated by git-murpp 0.5.0
next reply other threads:[~2026-11-27 13:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 13:45 Fiona Ebner [this message]
2026-11-27 13:45 ` [PATCH qemu-server 01/10] restore: vma: rename variable for storage configuration Fiona Ebner
2026-11-27 13:45 ` [PATCH qemu-server 02/10] restore: skip non-main config sections Fiona Ebner
2026-11-27 13:45 ` [PATCH qemu-server 03/10] restore: introduce dedicated module Fiona Ebner
2026-11-27 13:45 ` [PATCH qemu-server 04/10] restore: move helper for cleaning up target to module Fiona Ebner
2026-11-27 13:45 ` [PATCH qemu-server 05/10] restore: move helper for parsing backup device hints " Fiona Ebner
2026-11-27 13:45 ` [PATCH qemu-server 06/10] restore: move helpers to deactivate and destroy volumes " Fiona Ebner
2026-11-27 13:45 ` [PATCH qemu-server 07/10] restore: move helpers to check identity and write config " Fiona Ebner
2026-11-27 13:45 ` [PATCH qemu-server 08/10] restore: check permissions up-front Fiona Ebner
2026-11-27 13:45 ` [PATCH qemu-server 09/10] restore: extract common helper for preparing new configuration Fiona Ebner
2026-11-27 13:45 ` [PATCH qemu-server 10/10] restore: prepare new config before modifying the target 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=20261127134637.140854-1-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.