Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142174613
D54739.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
953 B
Referenced Files
None
Subscribers
None
D54739.diff
View Options
diff --git a/usr.sbin/bhyve/pci_passthru.c b/usr.sbin/bhyve/pci_passthru.c
--- a/usr.sbin/bhyve/pci_passthru.c
+++ b/usr.sbin/bhyve/pci_passthru.c
@@ -132,13 +132,14 @@
}
static int
-pcifd_open(void)
+pcifd_open(int flags)
{
int fd;
- fd = open(_PATH_DEVPCI, O_RDWR, 0);
+ fd = open(_PATH_DEVPCI, flags, 0);
if (fd < 0) {
- warn("failed to open %s", _PATH_DEVPCI);
+ if (errno != EACCES)
+ warn("failed to open %s", _PATH_DEVPCI);
return (-1);
}
return (fd);
@@ -147,7 +148,7 @@
static int
pcifd_init(void)
{
- pcifd = pcifd_open();
+ pcifd = pcifd_open(O_RDWR);
if (pcifd < 0)
return (1);
@@ -194,7 +195,7 @@
uint32_t ret;
int fd;
- fd = pcifd_open();
+ fd = pcifd_open(O_RDONLY);
if (fd < 0)
return (0);
ret = host_read_config(fd, sel, reg, width);
@@ -230,7 +231,7 @@
{
int fd;
- fd = pcifd_open();
+ fd = pcifd_open(O_RDWR);
if (fd < 0)
return;
host_write_config(fd, sel, reg, width, data);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 17, 7:47 PM (11 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27696934
Default Alt Text
D54739.diff (953 B)
Attached To
Mode
D54739: bhyve: Open /dev/pci read-only when possible
Attached
Detach File
Event Timeline
Log In to Comment