]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Rollback on used USB devices
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 16 May 2012 14:42:02 +0000 (16:42 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 16 May 2012 15:10:28 +0000 (17:10 +0200)
commit2f5fdc886ec7ed8b871ebd0576271f8ee5be1f71
treee5a06e13ea2a39c4a68b1ec50d53b9c3b786d5fd
parent7ba66ef285aeb9bd87a43a47dfa15d74d3f0ec46
qemu: Rollback on used USB devices

One of our latest USB device handling patches
05abd1507d66aabb6cad12eeafeb4c4d1911c585 introduced a regression.
That is, we first create a temporary list of all USB devices that
are to be used by domain just starting up. Then we iterate over and
check if a device from the list is in the global list of currently
assigned devices (activeUsbHostdevs). If not, we add it there and
continue with next iteration then. But if a device from temporary
list is either taken already or adding to the activeUsbHostdevs fails,
we remove all devices in temp list from the activeUsbHostdevs list.
Therefore, if a device is already taken we remove it from
activeUsbHostdevs even if we should not. Thus, next time we allow
the device to be assigned to another domain.
src/qemu/qemu_hostdev.c