[pve-devel] [PATCH v4 qemu-server 4/4] fix #4957: add vendor and product information passthrough for SCSI-Disks

Hannes Dürr h.duerr at proxmox.com
Fri Nov 17 13:24:17 CET 2023


New Version can be found here:
https://lists.proxmox.com/pipermail/pve-devel/2023-November/060429.html

On 11/17/23 12:53, Hannes Duerr wrote:
> adds vendor and product information for SCSI devices to the json schema and
> checks in the VM create/update API call if it is possible to add these to QEMU as a device option
>
> Signed-off-by: Hannes Duerr <h.duerr at proxmox.com>
> ---
>   PVE/API2/Qemu.pm        | 39 +++++++++++++++++++++++++++++++++++++++
>   PVE/QemuServer.pm       | 13 ++++++++++++-
>   PVE/QemuServer/Drive.pm | 24 ++++++++++++++++++++++++
>   3 files changed, 75 insertions(+), 1 deletion(-)
>
>   __PACKAGE__->register_method({
>       name => 'vmlist',
>       path => '',
> @@ -1011,6 +1038,13 @@ __PACKAGE__->register_method({
>   		my $conf = $param;
>   		my $arch = PVE::QemuServer::get_vm_arch($conf);
>   
> +		for my $opt (sort keys $param->%*) {
> +		    if ($opt =~ m/^scsi(\d)+$/) {
> +			assert_scsi_feature_compatibility(
> +			    $opt, $conf, $storecfg, $param->{$opt});
> +		    }
> +		}
> +
>   		$conf->{meta} = PVE::QemuServer::new_meta_info_string();
>   
>   		my $vollist = [];
> @@ -1826,6 +1860,11 @@ my $update_vm_api  = sub {
>   		    PVE::QemuServer::vmconfig_register_unused_drive($storecfg, $vmid, $conf, PVE::QemuServer::parse_drive($opt, $conf->{pending}->{$opt}))
>   			if defined($conf->{pending}->{$opt});
>   
> +		    if ($opt =~ m/^scsi(\d)+$/) {
> +			PVE::QemuServer::assert_scsi_feature_compatibility(
> +			    $opt, $conf, $storecfg, $param->{$opt});
^ copy paste error
> +		    }
> +
>   		    my (undef, $created_opts) = $create_disks->(
>   			$rpcenv,
>   			$authuser,





More information about the pve-devel mailing list