[pve-devel] [PATCH qemu-server 2/2] Fix local resources check for USB3 Spice devices

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Sep 2 14:01:46 CEST 2019


On 8/30/19 9:40 AM, Aaron Lauterer wrote:
> The check relied on the fact, that spice usb devices could not be usb3
> in the past.

and then what...?

Maybe add:

> and thus the exact match for "spice" was enough.

Albeit that's wrong too, any user could set the usb3
just fine, we did not throw an error, just ignored it.
So this would be nice to have in general, or?

> 
> Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
> ---
>  PVE/QemuServer.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 6e3b19e..0a0fda7 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -2903,7 +2903,7 @@ sub check_local_resources {
>      push @loc_res, "ivshmem" if $conf->{ivshmem};
>  
>      foreach my $k (keys %$conf) {
> -	next if $k =~ m/^usb/ && ($conf->{$k} eq 'spice');
> +	next if $k =~ m/^usb/ && ($conf->{$k} =~ m/spice/);

a line start hook is missing: /^spice/
maybe even more future proof: /^spice(,)?$/

>  	# sockets are safe: they will recreated be on the target side post-migrate
>  	next if $k =~ m/^serial/ && ($conf->{$k} eq 'socket');
>  	push @loc_res, $k if $k =~ m/^(usb|hostpci|serial|parallel)\d+$/;
> 





More information about the pve-devel mailing list