Description of problem: MarkHostDevicesUsedByVmId stored procedure (invoked by HostDeviceManager) looked only on device name when marking the appropriate host devices in DB. This could potentially result (when having device of same name on more than 1 host) in additional allocation of unrelated host devices with given name on all hosts. Version-Release number of selected component (if applicable): ovirt-engine-3.6 How reproducible: Difficult. Have to have pass-through-able devices on at least two hosts with the same device_name. Steps to Reproduce: 1. Configure host device with given name for a VM 2. Run the VM (should run successfully) 3. check host_device table in DB which host devices have set vm_id to that of the running VM Actual results: More than the host_device (belonging to the VM's pinned host) has the vm_id set to that of the running VM. Expected results: Only host devices belonging to VM's (unique) pinned host should be marked with vm_id.
Verified: rhevm-3.6.3.2-0.1.el6 libvirt-client-1.2.17-13.el7_2.2.x86_64 vdsm-4.17.21-0.el7ev.noarch qemu-kvm-rhev-2.3.0-31.el7_2.4.x86_64 sanlock-3.2.4-1.el7.x86_64 Verification scenario: 1. Use 2 hosts that support passthrough. 2. Browse webadmin --> hosts tab --> select host --> host devices tab, find PCI device with an equal name to the second host PCI name (for example pci_0003_03_00_0). 3. Attach the first host PCI device to VM and run VM. 4. Verify VM is running with PCI device attached. 5. Observe engine DB --> host_device table, verify that this device only is allocated to the first host only (actually the verification is to validate that identical PCI ID is not attached to the second host also because of the name duplication)