]> git.proxmox.com Git - qemu-server.git/commitdiff
usb: Fix local resource check of Spice USB devices
authorAaron Lauterer <a.lauterer@proxmox.com>
Wed, 11 Sep 2019 12:43:33 +0000 (14:43 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 21 Sep 2019 11:42:47 +0000 (13:42 +0200)
The check relied on the fact that in a regular use case a usb device of
type spice would not have any other settings like `usb3=1`. An exact
match worked fine for this.

This patch changes the behaviour and makes it possible to migrate VMs
with Spice USB devices that have additional usb options set.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
PVE/QemuServer.pm

index 1260cc033352be60c5bc71248f2350498c93062a..33bf966737ab2748f68c97fccf42181f3d57a6f0 100644 (file)
@@ -2925,7 +2925,7 @@ sub check_local_resources {
     push @loc_res, "ivshmem" if $conf->{ivshmem};
 
     foreach my $k (keys %$conf) {
     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(?![^,])/);
        # 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+$/;
        # 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+$/;