public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH-SERIES qemu-server 00/10] restore: check permissions up-front
@ 2026-11-27 13:45 Fiona Ebner
  2026-11-27 13:45 ` [PATCH qemu-server 01/10] restore: vma: rename variable for storage configuration Fiona Ebner
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Fiona Ebner @ 2026-11-27 13:45 UTC (permalink / raw)
  To: pve-devel

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




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-11-27 13:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 13:45 [PATCH-SERIES qemu-server 00/10] restore: check permissions up-front Fiona Ebner
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

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