
On 06/15/10 - 01:13:00PM, Daniel P. Berrange wrote:
@@ -11179,6 +11179,7 @@ out: static int qemudNodeDeviceDettach (virNodeDevicePtr dev) { + struct qemud_driver *driver = dev->conn->privateData; pciDevice *pci; unsigned domain, bus, slot, function; int ret = -1; @@ -11190,7 +11191,7 @@ qemudNodeDeviceDettach (virNodeDevicePtr dev) if (!pci) return -1;
- if (pciDettachDevice(pci) < 0) + if (pciDettachDevice(pci, driver->activePciHostdevs) < 0) goto out;
ret = 0; @@ -11202,6 +11203,7 @@ out: static int qemudNodeDeviceReAttach (virNodeDevicePtr dev) { + struct qemud_driver *driver = dev->conn->privateData; pciDevice *pci; unsigned domain, bus, slot, function; int ret = -1; @@ -11213,7 +11215,7 @@ qemudNodeDeviceReAttach (virNodeDevicePtr dev) if (!pci) return -1;
- if (pciReAttachDevice(pci) < 0) + if (pciReAttachDevice(pci, driver->activePciHostdevs) < 0) goto out;
ret = 0;
You're accessing 'driver' here without first locking it
D'oh, of course. Thanks for that. Updated patch below.