[libvirt] [PATCH 1/2] Check for active PCI devices when doing nodedevice operations.

Eric Blake eblake at redhat.com
Tue Jun 22 21:33:43 UTC 2010


On 06/15/2010 06:35 AM, Chris Lalancette wrote:
> On 06/15/10 - 01:13:00PM, Daniel P. Berrange wrote:
>> You're accessing 'driver' here without first locking it
> 
> D'oh, of course.  Thanks for that.  Updated patch below.
> 
> 
>>From 56b1d0463790b52e23975968c54d4f9f9a3c5fbd Mon Sep 17 00:00:00 2001
> From: Chris Lalancette <clalance at redhat.com>
> Date: Mon, 14 Jun 2010 17:12:35 -0400
> Subject: [PATCH v2 1/2] Check for active PCI devices when doing nodedevice operations.
> 
> In the current libvirt PCI code, there is no checking whether
> a PCI device is in use by a guest when doing node device
> detach or reattach.  This causes problems when a device is
> assigned to a guest, and the administrator starts issuing
> nodedevice commands.  Make it so that we check the list
> of active devices when trying to detach/reattach, and only
> allow the operation if the device is not assigned to a guest.
> 
> v2: Add locking to qemudNodeDeviceDettach and qemudNodeDeviceReAttach
> 
> Signed-off-by: Chris Lalancette <clalance at redhat.com>
> ---
> -            pciDettachDevice(dev) < 0)
> +            pciDettachDevice(dev, driver->activePciHostdevs) < 0)

ACK.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100622/6dfb2d21/attachment-0001.sig>


More information about the libvir-list mailing list