[libvirt] [PATCHv2 2/2] pci: make virPCIDeviceReset more autonomous

Martin Kletzander mkletzan at redhat.com
Mon Jul 15 08:39:07 UTC 2013


On 07/01/2013 07:46 PM, Laine Stump wrote:
> I recently patches the callers to virPCIDeviceReset() to not call it
> if the current driver for a device was vfio-pci (since that driver
> will always reset the device itself when appropriate. At the time, Dan
> Berrange suggested that I could instead modify virPCIDeviceReset
> to check the currently bound driver for the device, and decide
> for itself whether or not to go ahead with the reset.
> 
> This patch removes the previously added checks, and replaces them with
> a check down in virPCIDeviceReset(), as suggested.
> 
> The functional difference here is that previously we were deciding
> based on either the hostdev configuration or the value of
> stubDriverName in the virPCIDevice object, but now we are actually
> comparing to the "driver" link in the device's sysfs entry
> directly. In practice, both should be the same.
> ---
>  src/qemu/qemu_hostdev.c |  6 ++----
>  src/qemu/qemu_hotplug.c |  5 ++---
>  src/util/virpci.c       | 27 ++++++++++++++++++++++++---
>  3 files changed, 28 insertions(+), 10 deletions(-)
> 

This is better as it doesn't duplicate the code that much and makes us
sure that the reset won't be done redundantly.

ACK,

Martin




More information about the libvir-list mailing list