[libvirt] [PATCH] Add PCI sysfs reset access

Eric Blake eblake at redhat.com
Thu Mar 17 20:34:46 UTC 2011


On 03/17/2011 02:26 PM, Alex Williamson wrote:
> I'm proposing we make use of $PCIDIR/reset in qemu-kvm to reset
> devices on VM reset.  We need to add it to libvirt's list of
> files that get ownership for device assignment.
> 
> Signed-off-by: Alex Williamson <alex.williamson at redhat.com>
> ---
> 
>  src/util/pci.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/util/pci.c b/src/util/pci.c
> index 095ad3f..8d2dbb0 100644
> --- a/src/util/pci.c
> +++ b/src/util/pci.c
> @@ -1349,11 +1349,13 @@ int pciDeviceFileIterate(pciDevice *dev,
>  
>      while ((ent = readdir(dir)) != NULL) {
>          /* Device assignment requires:
> -         *   $PCIDIR/config, $PCIDIR/resource, $PCIDIR/resourceNNN, $PCIDIR/rom
> +         *   $PCIDIR/config, $PCIDIR/resource, $PCIDIR/resourceNNN,
> +         *   $PCIDIR/rom, $PCIDIR/reset

Hmm, in the case of hot-plug, we are already passing the config fd via
SCM_RIGHTS rather than having qemu directly open it.  Should we be
passing all of these files via SCM_RIGHTS?

>           */
>          if (STREQ(ent->d_name, "config") ||
>              STRPREFIX(ent->d_name, "resource") ||
> -            STREQ(ent->d_name, "rom")) {
> +            STREQ(ent->d_name, "rom") ||
> +            STREQ(ent->d_name, "reset")) {

At any rate, this looks reasonable to me, so ACK, and I'll push it shortly.

-- 
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/20110317/88791483/attachment-0001.sig>


More information about the libvir-list mailing list