[pve-devel] [PATCH pve-storage 1/2] plugin: map/activate volume: allow callers to pass hints
Fiona Ebner
f.ebner at proxmox.com
Tue Oct 28 13:17:42 CET 2025
Am 24.10.25 um 2:27 PM schrieb Friedrich Weber:
> +sub verify_hints {
> + my ($hints, $noerr) = @_;
> +
> + return if !defined($hints);
> +
> + eval { PVE::JSONSchema::validate($hints, $PVE::Storage::Plugin::hints_format); };
> + my $err = $@;
> +
> + return $hints if !$err;
> + return if $noerr;
> +
> + die "hints are not valid: $@";
Nit: I'd use "internal error - storage hints ..." to reduce potential
for confusion.
> diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm
> index 8acd214..2c72179 100644
> --- a/src/PVE/Storage/Plugin.pm
> +++ b/src/PVE/Storage/Plugin.pm
> @@ -59,6 +59,19 @@ cfs_register_file(
> sub { __PACKAGE__->write_config(@_); },
> );
>
> +our $hints_properties = {
> + 'guest-ostype' => {
> + type => 'string',
> + optional => 1,
> + },
I'd rather have this be an explicit "guest-is-windows" boolean. The
storage layer should not have any idea of how to parse guest OS types.
More information about the pve-devel
mailing list