]> xenbits.xensource.com Git - libvirt.git/commitdiff
Add PCI sysfs reset access
authorAlex Williamson <alex.williamson@redhat.com>
Thu, 17 Mar 2011 20:26:36 +0000 (14:26 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 17 Mar 2011 20:52:50 +0000 (14:52 -0600)
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@redhat.com>
src/util/pci.c

index 095ad3f1eff20a8a64785b10dd121a5956ec6b53..8d2dbb09b7a896ebd18b3a428fc24ac22842323a 100644 (file)
@@ -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
          */
         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")) {
             if (virAsprintf(&file, "%s/%s", pcidir, ent->d_name) < 0) {
                 virReportOOMError();
                 goto cleanup;