[pve-devel] [PATCH qemu-server v2 07/15] fix #5284: cli: importovf: assert content type support for target storage
Fiona Ebner
f.ebner at proxmox.com
Thu Feb 20 15:29:15 CET 2025
Am 11.02.25 um 17:08 schrieb Daniel Kral:
> Asserts whether the target storage supports storing VM images before
> importing a OVF manifest as a VM to the target storage.
>
> Without the check in place, a VM volume can be imported to a storage,
> which does not support VM images, but won't be able to start since any
> attached volume must be stored on a supported storage.
>
> Signed-off-by: Daniel Kral <d.kral at proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner at proxmox.com>
> ---
> changes since v1:
> - new! (was fixed without special notice in rfc, now it's more obvious)
>
> PVE/CLI/qm.pm | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm
> index 4214a7ca..58167050 100755
> --- a/PVE/CLI/qm.pm
> +++ b/PVE/CLI/qm.pm
> @@ -756,7 +756,9 @@ __PACKAGE__->register_method ({
>
> die "$ovf_file: non-existent or non-regular file\n" if (! -f $ovf_file);
> my $storecfg = PVE::Storage::config();
> - PVE::Storage::storage_check_enabled($storecfg, $storeid);
> + my $scfg = PVE::Storage::storage_check_enabled($storecfg, $storeid);
> + raise_param_exc({ storage => "storage '$storeid' does not support vm images" })
> + if !$scfg->{content}->{images};
>
> my $parsed = PVE::GuestImport::OVF::parse_ovf($ovf_file);
>
More information about the pve-devel
mailing list