public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Markus Frank <m.frank@proxmox.com>
Subject: Re: [pve-devel] [PATCH qemu-server v3 2/4] fix 4888: qmrestore: add disk-format option
Date: Wed, 21 May 2025 15:09:43 +0200	[thread overview]
Message-ID: <c2b16209-2edd-4090-89fa-40be0572a272@proxmox.com> (raw)
In-Reply-To: <20250307092546.102655-3-m.frank@proxmox.com>

Am 07.03.25 um 10:25 schrieb Markus Frank:
> Add an option to choose a file format (qcow2, raw, vmdk) when restoring
> a vm backup to file based storage. This options allows all disks to be
> recreated with the specified file format if supported by the target
> storage.
> 
> Signed-off-by: Markus Frank <m.frank@proxmox.com>

Looks good to me, but some slight changes would be nice, see below:

Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>

> ---
> v3:
> * added requires => 'archive' to disk-format
> * changed descriptions
> * added missing imports/uses
> * check if disk_format is in validFormats
> 
>  PVE/API2/Qemu.pm     |  7 +++++++
>  PVE/CLI/qmrestore.pm |  5 +++++
>  PVE/QemuServer.pm    | 14 +++++++++-----
>  3 files changed, 21 insertions(+), 5 deletions(-)
> 
> diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
> index 5ac61aa5..3f4d19cc 100644
> --- a/PVE/API2/Qemu.pm
> +++ b/PVE/API2/Qemu.pm

Should add an include for PVE::Storage::Common if you make the requested
change for 1/4. I guess it would be inherited implicitly, but it's nicer
to explicitly include it.

> diff --git a/PVE/CLI/qmrestore.pm b/PVE/CLI/qmrestore.pm
> index a47648bd..9910f30d 100755
> --- a/PVE/CLI/qmrestore.pm
> +++ b/PVE/CLI/qmrestore.pm
> @@ -3,6 +3,7 @@ package PVE::CLI::qmrestore;
>  use strict;
>  use warnings;
>  use PVE::SafeSyslog;
> +use PVE::Storage;

Should be PVE::Storage::Common if you make the requested change for 1/4.

> @@ -7064,7 +7068,7 @@ sub restore_proxmox_backup_archive {
>  	$restore_cleanup_oldconf->($storecfg, $vmid, $oldconf, $virtdev_hash) if $oldconf;
>  
>  	# allocate volumes
> -	my $map = $restore_allocate_devices->($storecfg, $virtdev_hash, $vmid);
> +	my $map = $restore_allocate_devices->($storecfg, $virtdev_hash, $vmid, $options->{disk_format});
>  
>  	foreach my $virtdev (sort keys %$virtdev_hash) {
>  	    my $d = $virtdev_hash->{$virtdev};
> @@ -7461,7 +7465,7 @@ sub restore_vma_archive {
>  	}
>  
>  	# allocate volumes
> -	my $map = $restore_allocate_devices->($cfg, $virtdev_hash, $vmid);
> +	my $map = $restore_allocate_devices->($cfg, $virtdev_hash, $vmid, $opts->{disk_format});
>  
>  	# print restore information to $fifofh
>  	foreach my $virtdev (sort keys %$virtdev_hash) {

There's a restore_external_archive() function that also calls
$restore_allocate_devices->() now which should be adapted too.


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  reply	other threads:[~2025-05-21 13:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-07  9:25 [pve-devel] [PATCH storage/qemu-server/manager v3 0/4] restore with a specified file format Markus Frank
2025-03-07  9:25 ` [pve-devel] [PATCH storage v3 1/4] add standard option for VM disk formats in file-based storages Markus Frank
2025-05-21 13:09   ` Fiona Ebner
2025-03-07  9:25 ` [pve-devel] [PATCH qemu-server v3 2/4] fix 4888: qmrestore: add disk-format option Markus Frank
2025-05-21 13:09   ` Fiona Ebner [this message]
2025-03-07  9:25 ` [pve-devel] [PATCH manager v3 3/4] ui: add hideFormatWhenStorageEmpty option to DiskStorageSelector Markus Frank
2025-05-21 13:39   ` Fiona Ebner
2025-03-07  9:25 ` [pve-devel] [PATCH manager v3 4/4] ui: restore window: add disk-format option Markus Frank
2025-05-21 13:39   ` 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=c2b16209-2edd-4090-89fa-40be0572a272@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=m.frank@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