mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 23:37:42 +00:00
Add missing device type check in QEMU PCI hotunplug
The QEMU hotunplug code for PCI devices was looking at host devices in the guest config without first filtering non PCI devices. This means it was reading garbage * src/qemu/qemu_driver.c: Filter out non-PCI devices
This commit is contained in:
parent
6ef5a5beeb
commit
badfe6c75e
@ -6854,6 +6854,10 @@ static int qemudDomainDetachHostPciDevice(struct qemud_driver *driver,
|
||||
pciDevice *pci;
|
||||
|
||||
for (i = 0 ; i < vm->def->nhostdevs ; i++) {
|
||||
if (vm->def->hostdevs[i]->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS ||
|
||||
vm->def->hostdevs[i]->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI)
|
||||
continue;
|
||||
|
||||
unsigned domain = vm->def->hostdevs[i]->source.subsys.u.pci.domain;
|
||||
unsigned bus = vm->def->hostdevs[i]->source.subsys.u.pci.bus;
|
||||
unsigned slot = vm->def->hostdevs[i]->source.subsys.u.pci.slot;
|
||||
|
Loading…
x
Reference in New Issue
Block a user