Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153272864
D54649.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D54649.diff
View Options
diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c
--- a/usr.sbin/bhyve/pci_emul.c
+++ b/usr.sbin/bhyve/pci_emul.c
@@ -1174,14 +1174,30 @@
if (get_config_bool_default("pci.enable_bars", !bootrom_boot()))
pci_set_cfgdata8(pdi, PCIR_COMMAND, PCIM_CMD_BUSMASTEREN);
-
- err = (*pde->pe_init)(pdi, fi->fi_config);
- if (err == 0)
- fi->fi_devi = pdi;
+ /*
+ * If we've been called as part of a hotplug request, call
+ * pci_validate_hotplug_request to check if the caller provided
+ * all required name/value pairs.
+ *
+ * Otherwise, invoke libbhyve's pci_init_fds to populate the
+ * configuration nvlist with the appropriate file descriptors.
+ */
+ if (nvlist_exists_bool(fi->fi_config, "ipc"))
+ err = !pci_validate_hotplug_request(fi->fi_config, pde->pe_emu);
else
+ err = pci_init_fds(fi->fi_config, pde->pe_emu);
+ if (err != 0) {
free(pdi);
+ return (err);
+ }
+ err = (*pde->pe_init)(pdi, fi->fi_config);
+ if (err != 0) {
+ free(pdi);
+ return (err);
+ }
+ fi->fi_devi = pdi;
- return (err);
+ return (0);
}
#ifdef __amd64__
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 21, 4:34 AM (7 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31767321
Default Alt Text
D54649.diff (1 KB)
Attached To
Mode
D54649: bhyve/pci_emul_init: Allow runtime device initialization
Attached
Detach File
Event Timeline
Log In to Comment