[PATCH 2/4] bhyve: list pci devices on host

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Alexander Shursha <kekek2@xxxxx>
---
 src/bhyve/bhyve_capabilities.c              | 2 +-
 src/conf/node_device_conf.c                 | 2 +-
 src/node_device/node_device_driver.c        | 2 +-
 src/node_device/node_device_udev.c          | 2 ++
 src/util/virmdev.c                          | 2 +-
 src/util/virpci.c                           | 2 +-
 tests/domaincapsdata/bhyve_basic.x86_64.xml | 3 ++-
 tests/domaincapsdata/bhyve_fbuf.x86_64.xml  | 3 ++-
 tests/domaincapsdata/bhyve_uefi.x86_64.xml  | 3 ++-
 9 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c
index b065256cf0..fcef91c435 100644
--- a/src/bhyve/bhyve_capabilities.c
+++ b/src/bhyve/bhyve_capabilities.c
@@ -108,7 +108,7 @@ virBhyveDomainCapsFill(virDomainCaps *caps,
         VIR_DOMAIN_CAPS_ENUM_SET(caps->video.modelType, VIR_DOMAIN_VIDEO_TYPE_GOP);
     }
 
-    caps->hostdev.supported = VIR_TRISTATE_BOOL_NO;
+    caps->hostdev.supported = VIR_TRISTATE_BOOL_YES;
     caps->features[VIR_DOMAIN_CAPS_FEATURE_IOTHREADS] = VIR_TRISTATE_BOOL_NO;
     caps->features[VIR_DOMAIN_CAPS_FEATURE_VMCOREINFO] = VIR_TRISTATE_BOOL_NO;
     caps->features[VIR_DOMAIN_CAPS_FEATURE_GENID] = VIR_TRISTATE_BOOL_NO;
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 88486a5f2d..0a1d649a40 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -3107,7 +3107,7 @@ virNodeDeviceSyncMdevActiveConfig(virNodeDeviceDef *def)
     }
 }
 
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD__)
 
 int
 virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHost *scsi_host)
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index 123b16a292..592f72fe52 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -111,7 +111,7 @@ int nodeConnectIsAlive(virConnectPtr conn G_GNUC_UNUSED)
     return 1;
 }
 
-#if defined (__linux__) && defined(WITH_UDEV)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(WITH_UDEV)
 /* NB: It was previously believed that changes in driver name were
  * relayed to libvirt as "change" events by udev, and the udev event
  * notification is setup to recognize such events and effectively
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 30c2ddf568..40c8ab14b1 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -431,6 +431,7 @@ udevProcessPCI(virNodeDeviceDriverState *driver_state,
     int ret = -1;
     char *p;
 
+#ifndef __FreeBSD__
     linkpath = g_strdup_printf("%s/config", udev_device_get_syspath(device));
     if (virFileWaitForExists(linkpath, 10, 100) < 0) {
         virReportSystemError(errno,
@@ -438,6 +439,7 @@ udevProcessPCI(virNodeDeviceDriverState *driver_state,
                              linkpath);
         goto cleanup;
     }
+#endif
 
     pci_dev->klass = -1;
     if (udevGetIntProperty(device, "PCI_CLASS", &pci_dev->klass, 16) < 0)
diff --git a/src/util/virmdev.c b/src/util/virmdev.c
index 6ecdbdf0ab..3a07ba75f2 100644
--- a/src/util/virmdev.c
+++ b/src/util/virmdev.c
@@ -565,7 +565,7 @@ virMediatedDeviceParentGetAddress(const char *sysfspath,
     return -1;
 }
 
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD__)
 
 ssize_t
 virMediatedDeviceGetMdevTypes(const char *sysfspath,
diff --git a/src/util/virpci.c b/src/util/virpci.c
index b5bbe73ece..12af206f13 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -2483,7 +2483,7 @@ virPCIGetVirtualFunctions(const char *sysfs_path,
 }
 
 
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD__)
 
 virPCIDeviceAddress *
 virPCIGetDeviceAddressFromSysfsLink(const char *device_link)
diff --git a/tests/domaincapsdata/bhyve_basic.x86_64.xml b/tests/domaincapsdata/bhyve_basic.x86_64.xml
index dd054577c0..fb9bf54a92 100644
--- a/tests/domaincapsdata/bhyve_basic.x86_64.xml
+++ b/tests/domaincapsdata/bhyve_basic.x86_64.xml
@@ -26,7 +26,8 @@
     </disk>
     <graphics supported='no'/>
     <video supported='no'/>
-    <hostdev supported='no'/>
+    <hostdev supported='yes'>
+    </hostdev>
   </devices>
   <features>
     <gic supported='no'/>
diff --git a/tests/domaincapsdata/bhyve_fbuf.x86_64.xml b/tests/domaincapsdata/bhyve_fbuf.x86_64.xml
index 0b1d9c17d7..1ec5706aed 100644
--- a/tests/domaincapsdata/bhyve_fbuf.x86_64.xml
+++ b/tests/domaincapsdata/bhyve_fbuf.x86_64.xml
@@ -43,7 +43,8 @@
         <value>gop</value>
       </enum>
     </video>
-    <hostdev supported='no'/>
+    <hostdev supported='yes'>
+    </hostdev>
   </devices>
   <features>
     <gic supported='no'/>
diff --git a/tests/domaincapsdata/bhyve_uefi.x86_64.xml b/tests/domaincapsdata/bhyve_uefi.x86_64.xml
index 69fff197a7..f76cf91acb 100644
--- a/tests/domaincapsdata/bhyve_uefi.x86_64.xml
+++ b/tests/domaincapsdata/bhyve_uefi.x86_64.xml
@@ -35,7 +35,8 @@
     </disk>
     <graphics supported='no'/>
     <video supported='no'/>
-    <hostdev supported='no'/>
+    <hostdev supported='yes'>
+    </hostdev>
   </devices>
   <features>
     <gic supported='no'/>
-- 
2.47.1



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux