public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server 01/10] restore: vma: rename variable for storage configuration
Date: Fri, 27 Nov 2026 14:45:25 +0100	[thread overview]
Message-ID: <20261127134637.140854-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20261127134637.140854-1-f.ebner@proxmox.com>

The name $cfg is too generic, use $storecfg like for the restore
implementations for the other archive types.

No functional change intended.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/QemuServer.pm | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 1d665877..a26faa3d 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -7580,7 +7580,7 @@ sub restore_vma_archive {
 
     my $readfrom = $archive;
 
-    my $cfg = PVE::Storage::config();
+    my $storecfg = PVE::Storage::config();
     my $commands = [];
     my $bwlimit = $opts->{bwlimit};
 
@@ -7599,7 +7599,7 @@ sub restore_vma_archive {
     } else {
         # If we use a backup from a PVE defined storage we also consider that
         # storage's rate limit:
-        my (undef, $volid) = PVE::Storage::path_to_volume_id($cfg, $archive);
+        my (undef, $volid) = PVE::Storage::path_to_volume_id($storecfg, $archive);
         if (defined($volid)) {
             my ($sid, undef) = PVE::Storage::parse_volume_id($volid);
             my $readlimit = PVE::Storage::get_bandwidth_limit('restore', [$sid], $bwlimit);
@@ -7665,7 +7665,7 @@ sub restore_vma_archive {
         my $fwcfgfn = "$tmpdir/qemu-server.fw";
         restore_firewall_config($vmid, $fwcfgfn) if -f $fwcfgfn;
 
-        $virtdev_hash = $parse_backup_hints->($rpcenv, $user, $cfg, $fh, $devinfo, $opts);
+        $virtdev_hash = $parse_backup_hints->($rpcenv, $user, $storecfg, $fh, $devinfo, $opts);
 
         foreach my $info (values %{$virtdev_hash}) {
             my $storeid = $info->{storeid};
@@ -7683,10 +7683,10 @@ sub restore_vma_archive {
 
         # create empty/temp config
         restore_write_config($vmid, { memory => 128, lock => 'create' }, $opts);
-        $restore_cleanup_oldconf->($cfg, $vmid, $oldconf, $virtdev_hash);
+        $restore_cleanup_oldconf->($storecfg, $vmid, $oldconf, $virtdev_hash);
 
         # allocate volumes
-        my $map = $restore_allocate_devices->($cfg, $virtdev_hash, $vmid);
+        my $map = $restore_allocate_devices->($storecfg, $virtdev_hash, $vmid);
 
         # print restore information to $fifofh
         foreach my $virtdev (sort keys %$virtdev_hash) {
@@ -7702,12 +7702,12 @@ sub restore_vma_archive {
             }
 
             my $write_zeros = 1;
-            if (PVE::Storage::volume_has_feature($cfg, 'sparseinit', $volid)) {
+            if (PVE::Storage::volume_has_feature($storecfg, 'sparseinit', $volid)) {
                 $write_zeros = 0;
             }
 
-            my $path = PVE::Storage::path($cfg, $volid);
-            my $scfg = PVE::Storage::storage_config($cfg, $storeid);
+            my $path = PVE::Storage::path($storecfg, $volid);
+            my $scfg = PVE::Storage::storage_config($storecfg, $storeid);
 
             # TODO: extending this needs a separate rationale, the amplification
             # avoided here is specific to the volblock layout
@@ -7785,7 +7785,7 @@ sub restore_vma_archive {
 
     alarm($oldtimeout) if $oldtimeout;
 
-    $restore_deactivate_volumes->($cfg, $virtdev_hash);
+    $restore_deactivate_volumes->($storecfg, $virtdev_hash);
 
     close($fifofh) if $fifofh;
     unlink $mapfifo;
@@ -7794,7 +7794,7 @@ sub restore_vma_archive {
     if ($err) {
         # what could not be removed keeps the VMID taken
         $opts->{progress}->{'volumes-left'} = 1
-            if $restore_destroy_volumes->($cfg, $virtdev_hash);
+            if $restore_destroy_volumes->($storecfg, $virtdev_hash);
         die $err;
     }
     $opts->{progress}->{'volumes-kept'} = 1;
-- 
2.47.3





  reply	other threads:[~2026-11-27 13:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 13:45 [PATCH-SERIES qemu-server 00/10] restore: check permissions up-front Fiona Ebner
2026-11-27 13:45 ` Fiona Ebner [this message]
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-2-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 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