From: Markus Frank <m.frank@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Matthias Heiserer <m.heiserer@proxmox.com>
Subject: Re: [pve-devel] [PATCH qemu-server] fix 3674: QEMU restore: verify storage allows images before writing
Date: Wed, 23 Feb 2022 10:42:22 +0100 [thread overview]
Message-ID: <cd413cd9-a6e9-82da-4d9e-5fe7a82ee72e@proxmox.com> (raw)
In-Reply-To: <20220217141251.739753-1-m.heiserer@proxmox.com>
With this patch restoring a backup on a disabled storage results in an
error and just creates a VM with the configuration from the backup
without any virtual disk instead of forcing the creation of the disk(s).
Works as intended.
Tested-by: Markus Frank <m.frank@proxmox.com>
On 2/17/22 15:12, Matthias Heiserer wrote:
> When restoring a backup and the storage the disks would be created on
> doesn't allow 'images', the process errors without cleanup.
> This is the same behaviour we currently have when the storage is
> disabled.
>
> Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
> ---
> PVE/QemuServer.pm | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index a99f1a5..2a1ec48 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -6299,6 +6299,10 @@ my $restore_allocate_devices = sub {
> my $supported = grep { $_ eq $d->{format} } @$validFormats;
> $d->{format} = $defFormat if !$supported;
>
> + # check if images can be stored on the requested storage
> + die "Content type 'images' is not available on storage '$storeid'\n"
> + if !$scfg->{content}->{images};
> +
> my $name;
> if ($d->{is_cloudinit}) {
> $name = "vm-$vmid-cloudinit";
prev parent reply other threads:[~2022-02-23 9:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-17 14:12 Matthias Heiserer
2022-02-18 12:48 ` Matthias Heiserer
2022-02-23 9:08 ` Fabian Ebner
2022-02-23 9:42 ` Markus Frank [this message]
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=cd413cd9-a6e9-82da-4d9e-5fe7a82ee72e@proxmox.com \
--to=m.frank@proxmox.com \
--cc=m.heiserer@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