]> xenbits.xensource.com Git - libvirt.git/commitdiff
virmdev: fix build on non-Linux
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Mon, 27 Mar 2017 15:38:33 +0000 (19:38 +0400)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Mon, 27 Mar 2017 17:59:39 +0000 (21:59 +0400)
 - Make virMediatedDeviceNew() stub args match its prototype
 - Fix typo: virRerportError -> virReportError
 - Move MDEV_SYSFS_DEVICES definition out of the #ifdef __linux__ block
   so we don't have to stub virMediatedDeviceGetSysfsPath()

src/util/virmdev.c

index e924af3c118a7bc8bb1649fe21aba8edf287d84c..2a1ade739042c6e5aa5e63ca0c547c8b1af68b87 100644 (file)
@@ -28,6 +28,8 @@
 
 #define VIR_FROM_THIS VIR_FROM_NONE
 
+#define MDEV_SYSFS_DEVICES "/sys/bus/mdev/devices/"
+
 VIR_LOG_INIT("util.mdev");
 
 struct _virMediatedDevice {
@@ -68,7 +70,6 @@ virMediatedOnceInit(void)
 VIR_ONCE_GLOBAL_INIT(virMediated)
 
 #ifdef __linux__
-# define MDEV_SYSFS_DEVICES "/sys/bus/mdev/devices/"
 
 static int
 virMediatedDeviceGetSysfsDeviceAPI(virMediatedDevicePtr dev,
@@ -173,12 +174,12 @@ virMediatedDeviceNew(const char *uuidstr, virMediatedDeviceModelType model)
 #else
 
 virMediatedDevicePtr
-virMediatedDeviceNew(virPCIDeviceAddressPtr pciaddr ATTRIBUTE_UNUSED,
-                     const char *uuidstr ATTRIBUTE_UNUSED)
+virMediatedDeviceNew(const char *uuidstr ATTRIBUTE_UNUSED,
+                     virMediatedDeviceModelType model ATTRIBUTE_UNUSED)
 {
-    virRerportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                    _("mediated devices are not supported on non-linux "
-                      "platforms"));
+    virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                   _("mediated devices are not supported on non-linux "
+                     "platforms"));
     return NULL;
 }