mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
Allow access to vendor and device file for PCI device passthrough
For some devices, the $PCIDIR/vendor and $PCIDIR/device need to be read. Iterate over them to get them as well in the the generated apparmor profile.
This commit is contained in:
parent
5a35b2e599
commit
28d599c513
@ -1955,11 +1955,13 @@ int virPCIDeviceFileIterate(virPCIDevicePtr dev,
|
||||
while ((direrr = virDirRead(dir, &ent, pcidir)) > 0) {
|
||||
/* Device assignment requires:
|
||||
* $PCIDIR/config, $PCIDIR/resource, $PCIDIR/resourceNNN,
|
||||
* $PCIDIR/rom, $PCIDIR/reset
|
||||
* $PCIDIR/rom, $PCIDIR/reset, $PCIDIR/vendor, $PCIDIR/device
|
||||
*/
|
||||
if (STREQ(ent->d_name, "config") ||
|
||||
STRPREFIX(ent->d_name, "resource") ||
|
||||
STREQ(ent->d_name, "rom") ||
|
||||
STREQ(ent->d_name, "vendor") ||
|
||||
STREQ(ent->d_name, "device") ||
|
||||
STREQ(ent->d_name, "reset")) {
|
||||
if (virAsprintf(&file, "%s/%s", pcidir, ent->d_name) < 0)
|
||||
goto cleanup;
|
||||
|
Loading…
x
Reference in New Issue
Block a user