提交 f4828ca3 编写于 作者: C Chris Wright 提交者: Daniel Veillard

pciSharesBusWithActive fails to find multiple devices on bus

The first conditional is always true which means the iterator will
never find another device on the same bus.

    if (dev->domain != check->domain ||
        dev->bus != check->bus ||
  ----> (check->slot == check->slot &&
         check->function == check->function)) <-----

The goal of that check is to verify that the device is either:

  in a different pci domain
  on a different bus
  is the same identical device

This means libvirt may issue a secondary bus reset when there are
devices
on that bus that actively in use by the host or another guest.

* src/util/pci.c: fix a bogus test in pciSharesBusWithActive()
上级 8d4f0242
...@@ -446,10 +446,11 @@ pciSharesBusWithActive(pciDevice *dev, pciDevice *check, void *data) ...@@ -446,10 +446,11 @@ pciSharesBusWithActive(pciDevice *dev, pciDevice *check, void *data)
{ {
pciDeviceList *activeDevs = data; pciDeviceList *activeDevs = data;
/* Different domain, different bus, or simply identical device */
if (dev->domain != check->domain || if (dev->domain != check->domain ||
dev->bus != check->bus || dev->bus != check->bus ||
(check->slot == check->slot && (dev->slot == check->slot &&
check->function == check->function)) dev->function == check->function))
return 0; return 0;
if (activeDevs && !pciDeviceListFind(activeDevs, check)) if (activeDevs && !pciDeviceListFind(activeDevs, check))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册