[PATCH v4 3/8] hw/vfio/pci-quirks.c: remove CONFIG_VFIO_IGD

Pierrick Bouvier posted 8 patches 1 week, 2 days ago
Maintainers: Tony Krowiak <akrowiak@linux.ibm.com>, Halil Pasic <pasic@linux.ibm.com>, Jason Herne <jjherne@linux.ibm.com>, Alex Williamson <alex@shazbot.org>, "Cédric Le Goater" <clg@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Eric Farman <farman@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Paolo Bonzini <pbonzini@redhat.com>, Nicholas Piggin <npiggin@gmail.com>, Harsh Prateek Bora <harshpb@linux.ibm.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Christian Borntraeger <borntraeger@linux.ibm.com>, Richard Henderson <richard.henderson@linaro.org>, Ilya Leoshkevich <iii@linux.ibm.com>, David Hildenbrand <david@kernel.org>
There is a newer version of this series
[PATCH v4 3/8] hw/vfio/pci-quirks.c: remove CONFIG_VFIO_IGD
Posted by Pierrick Bouvier 1 week, 2 days ago
Add stubs for needed functions.

As well, we need to add pixman to qemuutil library dependencies since
pixman is transitively included from pci.h header, which is needed to be
able to include prototypes for stubs we declared.
In file included from include/ui/console.h:4,
                 from ../hw/vfio/vfio-display.h:12,
                 from ../hw/vfio/pci.h:25,
                 from ../hw/vfio/igd-stubs.c:9:
include/ui/qemu-pixman.h:10:10: fatal error: pixman.h: No such file or directory
   10 | #include <pixman.h>
      |          ^~~~~~~~~~

On OpenBSD, opengl headers are not available in default include path,
and thus we need to add opengl to list of qemuutil dependencies.
In file included from /home/root/qemu/include/ui/console.h:9:
/home/root/qemu/include/ui/surface.h:11:11: fatal error: 'epoxy/gl.h' file not found

Finally, vfio_pci_hot_reset_info must be forwarded declared on non linux
platforms:
In file included from ../hw/vfio/igd-stubs.c:9:
../hw/vfio/pci.h:265:44: error: 'struct vfio_pci_hot_reset_info' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
  265 |                                     struct vfio_pci_hot_reset_info **info_p);
      |

Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>

Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
 meson.build          |  2 +-
 hw/vfio/pci.h        |  2 ++
 hw/vfio/igd-stubs.c  | 20 ++++++++++++++++++++
 hw/vfio/pci-quirks.c |  5 -----
 hw/vfio/meson.build  |  1 +
 5 files changed, 24 insertions(+), 6 deletions(-)
 create mode 100644 hw/vfio/igd-stubs.c

diff --git a/meson.build b/meson.build
index b2154bb9287..ab726ea1152 100644
--- a/meson.build
+++ b/meson.build
@@ -3781,7 +3781,7 @@ util_ss = util_ss.apply({})
 libqemuutil = static_library('qemuutil',
                              build_by_default: false,
                              sources: util_ss.sources() + stub_ss.sources() + genh,
-                             dependencies: [util_ss.dependencies(), libm, threads, glib, socket, malloc, rt])
+                             dependencies: [util_ss.dependencies(), libm, threads, glib, socket, malloc, rt, pixman, opengl])
 qemuutil = declare_dependency(link_with: libqemuutil,
                               sources: genh + version_res,
                               dependencies: [event_loop_base])
diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h
index d6495d7f297..c3a1f53d350 100644
--- a/hw/vfio/pci.h
+++ b/hw/vfio/pci.h
@@ -258,6 +258,8 @@ bool vfio_probe_igd_config_quirk(VFIOPCIDevice *vdev, Error **errp);
 
 extern const PropertyInfo qdev_prop_nv_gpudirect_clique;
 
+struct vfio_pci_hot_reset_info;
+
 void vfio_pci_pre_reset(VFIOPCIDevice *vdev);
 void vfio_pci_post_reset(VFIOPCIDevice *vdev);
 bool vfio_pci_host_match(PCIHostDeviceAddress *addr, const char *name);
diff --git a/hw/vfio/igd-stubs.c b/hw/vfio/igd-stubs.c
new file mode 100644
index 00000000000..f7687d90912
--- /dev/null
+++ b/hw/vfio/igd-stubs.c
@@ -0,0 +1,20 @@
+/*
+ * IGD device quirks stubs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "qapi/qmp/qerror.h"
+#include "pci.h"
+#include "pci-quirks.h"
+
+void vfio_probe_igd_bar0_quirk(VFIOPCIDevice *vdev, int nr)
+{
+    return;
+}
+
+bool vfio_probe_igd_config_quirk(VFIOPCIDevice *vdev, Error **errp)
+{
+    return true;
+}
diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
index 7b907b9360d..ab864048943 100644
--- a/hw/vfio/pci-quirks.c
+++ b/hw/vfio/pci-quirks.c
@@ -11,7 +11,6 @@
  */
 
 #include "qemu/osdep.h"
-#include CONFIG_DEVICES
 #include "exec/memop.h"
 #include "qemu/units.h"
 #include "qemu/log.h"
@@ -1128,11 +1127,9 @@ static void vfio_probe_rtl8168_bar2_quirk(VFIOPCIDevice *vdev, int nr)
  */
 bool vfio_config_quirk_setup(VFIOPCIDevice *vdev, Error **errp)
 {
-#ifdef CONFIG_VFIO_IGD
     if (!vfio_probe_igd_config_quirk(vdev, errp)) {
         return false;
     }
-#endif
     return true;
 }
 
@@ -1179,9 +1176,7 @@ void vfio_bar_quirk_setup(VFIOPCIDevice *vdev, int nr)
     vfio_probe_nvidia_bar5_quirk(vdev, nr);
     vfio_probe_nvidia_bar0_quirk(vdev, nr);
     vfio_probe_rtl8168_bar2_quirk(vdev, nr);
-#ifdef CONFIG_VFIO_IGD
     vfio_probe_igd_bar0_quirk(vdev, nr);
-#endif
 }
 
 void vfio_bar_quirk_exit(VFIOPCIDevice *vdev, int nr)
diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
index f2a7728d3d0..6c00a7f51bb 100644
--- a/hw/vfio/meson.build
+++ b/hw/vfio/meson.build
@@ -17,6 +17,7 @@ vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
 vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c'))
 vfio_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c'))
 vfio_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c'))
+stub_ss.add(files('igd-stubs.c'))
 
 specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss)
 
-- 
2.47.3


Re: [PATCH v4 3/8] hw/vfio/pci-quirks.c: remove CONFIG_VFIO_IGD
Posted by Cédric Le Goater 1 week, 1 day ago
On 3/17/26 20:42, Pierrick Bouvier wrote:
> Add stubs for needed functions.
> 
> As well, we need to add pixman to qemuutil library dependencies since
> pixman is transitively included from pci.h header, which is needed to be
> able to include prototypes for stubs we declared.
> In file included from include/ui/console.h:4,
>                   from ../hw/vfio/vfio-display.h:12,
>                   from ../hw/vfio/pci.h:25,
>                   from ../hw/vfio/igd-stubs.c:9:
> include/ui/qemu-pixman.h:10:10: fatal error: pixman.h: No such file or directory
>     10 | #include <pixman.h>
>        |          ^~~~~~~~~~
> 
> On OpenBSD, opengl headers are not available in default include path,
> and thus we need to add opengl to list of qemuutil dependencies.
> In file included from /home/root/qemu/include/ui/console.h:9:
> /home/root/qemu/include/ui/surface.h:11:11: fatal error: 'epoxy/gl.h' file not found
> 
> Finally, vfio_pci_hot_reset_info must be forwarded declared on non linux
> platforms:
> In file included from ../hw/vfio/igd-stubs.c:9:
> ../hw/vfio/pci.h:265:44: error: 'struct vfio_pci_hot_reset_info' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
>    265 |                                     struct vfio_pci_hot_reset_info **info_p);
>        |
> 
> Reviewed-by: Cédric Le Goater <clg@redhat.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> 
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>

Duplicated Signed-off-by. I can fix when applying.

Thanks,

C.

> ---
>   meson.build          |  2 +-
>   hw/vfio/pci.h        |  2 ++
>   hw/vfio/igd-stubs.c  | 20 ++++++++++++++++++++
>   hw/vfio/pci-quirks.c |  5 -----
>   hw/vfio/meson.build  |  1 +
>   5 files changed, 24 insertions(+), 6 deletions(-)
>   create mode 100644 hw/vfio/igd-stubs.c
> 
> diff --git a/meson.build b/meson.build
> index b2154bb9287..ab726ea1152 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -3781,7 +3781,7 @@ util_ss = util_ss.apply({})
>   libqemuutil = static_library('qemuutil',
>                                build_by_default: false,
>                                sources: util_ss.sources() + stub_ss.sources() + genh,
> -                             dependencies: [util_ss.dependencies(), libm, threads, glib, socket, malloc, rt])
> +                             dependencies: [util_ss.dependencies(), libm, threads, glib, socket, malloc, rt, pixman, opengl])
>   qemuutil = declare_dependency(link_with: libqemuutil,
>                                 sources: genh + version_res,
>                                 dependencies: [event_loop_base])
> diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h
> index d6495d7f297..c3a1f53d350 100644
> --- a/hw/vfio/pci.h
> +++ b/hw/vfio/pci.h
> @@ -258,6 +258,8 @@ bool vfio_probe_igd_config_quirk(VFIOPCIDevice *vdev, Error **errp);
>   
>   extern const PropertyInfo qdev_prop_nv_gpudirect_clique;
>   
> +struct vfio_pci_hot_reset_info;
> +
>   void vfio_pci_pre_reset(VFIOPCIDevice *vdev);
>   void vfio_pci_post_reset(VFIOPCIDevice *vdev);
>   bool vfio_pci_host_match(PCIHostDeviceAddress *addr, const char *name);
> diff --git a/hw/vfio/igd-stubs.c b/hw/vfio/igd-stubs.c
> new file mode 100644
> index 00000000000..f7687d90912
> --- /dev/null
> +++ b/hw/vfio/igd-stubs.c
> @@ -0,0 +1,20 @@
> +/*
> + * IGD device quirks stubs
> + *
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + */
> +
> +#include "qemu/osdep.h"
> +#include "qapi/qmp/qerror.h"
> +#include "pci.h"
> +#include "pci-quirks.h"
> +
> +void vfio_probe_igd_bar0_quirk(VFIOPCIDevice *vdev, int nr)
> +{
> +    return;
> +}
> +
> +bool vfio_probe_igd_config_quirk(VFIOPCIDevice *vdev, Error **errp)
> +{
> +    return true;
> +}
> diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
> index 7b907b9360d..ab864048943 100644
> --- a/hw/vfio/pci-quirks.c
> +++ b/hw/vfio/pci-quirks.c
> @@ -11,7 +11,6 @@
>    */
>   
>   #include "qemu/osdep.h"
> -#include CONFIG_DEVICES
>   #include "exec/memop.h"
>   #include "qemu/units.h"
>   #include "qemu/log.h"
> @@ -1128,11 +1127,9 @@ static void vfio_probe_rtl8168_bar2_quirk(VFIOPCIDevice *vdev, int nr)
>    */
>   bool vfio_config_quirk_setup(VFIOPCIDevice *vdev, Error **errp)
>   {
> -#ifdef CONFIG_VFIO_IGD
>       if (!vfio_probe_igd_config_quirk(vdev, errp)) {
>           return false;
>       }
> -#endif
>       return true;
>   }
>   
> @@ -1179,9 +1176,7 @@ void vfio_bar_quirk_setup(VFIOPCIDevice *vdev, int nr)
>       vfio_probe_nvidia_bar5_quirk(vdev, nr);
>       vfio_probe_nvidia_bar0_quirk(vdev, nr);
>       vfio_probe_rtl8168_bar2_quirk(vdev, nr);
> -#ifdef CONFIG_VFIO_IGD
>       vfio_probe_igd_bar0_quirk(vdev, nr);
> -#endif
>   }
>   
>   void vfio_bar_quirk_exit(VFIOPCIDevice *vdev, int nr)
> diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
> index f2a7728d3d0..6c00a7f51bb 100644
> --- a/hw/vfio/meson.build
> +++ b/hw/vfio/meson.build
> @@ -17,6 +17,7 @@ vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
>   vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c'))
>   vfio_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c'))
>   vfio_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c'))
> +stub_ss.add(files('igd-stubs.c'))
>   
>   specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss)
>   


Re: [PATCH v4 3/8] hw/vfio/pci-quirks.c: remove CONFIG_VFIO_IGD
Posted by Pierrick Bouvier 1 week, 1 day ago
On 3/18/26 1:11 AM, Cédric Le Goater wrote:
> On 3/17/26 20:42, Pierrick Bouvier wrote:
>> Add stubs for needed functions.
>>
>> As well, we need to add pixman to qemuutil library dependencies since
>> pixman is transitively included from pci.h header, which is needed to be
>> able to include prototypes for stubs we declared.
>> In file included from include/ui/console.h:4,
>>                    from ../hw/vfio/vfio-display.h:12,
>>                    from ../hw/vfio/pci.h:25,
>>                    from ../hw/vfio/igd-stubs.c:9:
>> include/ui/qemu-pixman.h:10:10: fatal error: pixman.h: No such file or directory
>>      10 | #include <pixman.h>
>>         |          ^~~~~~~~~~
>>
>> On OpenBSD, opengl headers are not available in default include path,
>> and thus we need to add opengl to list of qemuutil dependencies.
>> In file included from /home/root/qemu/include/ui/console.h:9:
>> /home/root/qemu/include/ui/surface.h:11:11: fatal error: 'epoxy/gl.h' file not found
>>
>> Finally, vfio_pci_hot_reset_info must be forwarded declared on non linux
>> platforms:
>> In file included from ../hw/vfio/igd-stubs.c:9:
>> ../hw/vfio/pci.h:265:44: error: 'struct vfio_pci_hot_reset_info' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
>>     265 |                                     struct vfio_pci_hot_reset_info **info_p);
>>         |
>>
>> Reviewed-by: Cédric Le Goater <clg@redhat.com>
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>>
>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> 
> Duplicated Signed-off-by. I can fix when applying.
>

Oops, that's a rebase mistake. thanks!

> Thanks,
> 
> C.
>

Re: [PATCH v4 3/8] hw/vfio/pci-quirks.c: remove CONFIG_VFIO_IGD
Posted by Philippe Mathieu-Daudé 1 week, 1 day ago
On 18/3/26 09:11, Cédric Le Goater wrote:
> On 3/17/26 20:42, Pierrick Bouvier wrote:
>> Add stubs for needed functions.
>>

--->

>> As well, we need to add pixman to qemuutil library dependencies since
>> pixman is transitively included from pci.h header, which is needed to be
>> able to include prototypes for stubs we declared.
>> In file included from include/ui/console.h:4,
>>                   from ../hw/vfio/vfio-display.h:12,
>>                   from ../hw/vfio/pci.h:25,
>>                   from ../hw/vfio/igd-stubs.c:9:
>> include/ui/qemu-pixman.h:10:10: fatal error: pixman.h: No such file or 
>> directory
>>     10 | #include <pixman.h>
>>        |          ^~~~~~~~~~
>>
>> On OpenBSD, opengl headers are not available in default include path,
>> and thus we need to add opengl to list of qemuutil dependencies.
>> In file included from /home/root/qemu/include/ui/console.h:9:
>> /home/root/qemu/include/ui/surface.h:11:11: fatal error: 'epoxy/gl.h' 
>> file not found
>>
>> Finally, 

<---

>> vfio_pci_hot_reset_info must be forwarded declared on non linux
>> platforms:
>> In file included from ../hw/vfio/igd-stubs.c:9:
>> ../hw/vfio/pci.h:265:44: error: 'struct vfio_pci_hot_reset_info' 
>> declared inside parameter list will not be visible outside of this 
>> definition or declaration [-Werror]
>>    265 |                                     struct 
>> vfio_pci_hot_reset_info **info_p);
>>        |
>>
>> Reviewed-by: Cédric Le Goater <clg@redhat.com>
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>>
>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> 
> Duplicated Signed-off-by. I can fix when applying.

Actually you can also cut description marked betwwen --->
and <--- because already mentioned in future commit 988499515da:
https://lore.kernel.org/qemu-devel/20260317190250.70506-3-philmd@linaro.org/
which removes [*] below (should disappear on rebase).

(Sorry for that hiccups, I was expecting Pierrick series to
be posted after my PR was merged).

Regards,

Phil.

> 
> Thanks,
> 
> C.
> 
>> ---
>>   meson.build          |  2 +-
>>   hw/vfio/pci.h        |  2 ++
>>   hw/vfio/igd-stubs.c  | 20 ++++++++++++++++++++
>>   hw/vfio/pci-quirks.c |  5 -----
>>   hw/vfio/meson.build  |  1 +
>>   5 files changed, 24 insertions(+), 6 deletions(-)
>>   create mode 100644 hw/vfio/igd-stubs.c
>>
>> diff --git a/meson.build b/meson.build
>> index b2154bb9287..ab726ea1152 100644
>> --- a/meson.build
>> +++ b/meson.build
>> @@ -3781,7 +3781,7 @@ util_ss = util_ss.apply({})
>>   libqemuutil = static_library('qemuutil',
>>                                build_by_default: false,
>>                                sources: util_ss.sources() + 
>> stub_ss.sources() + genh,
>> -                             dependencies: [util_ss.dependencies(), 
>> libm, threads, glib, socket, malloc, rt])
>> +                             dependencies: [util_ss.dependencies(), 
>> libm, threads, glib, socket, malloc, rt, pixman, opengl])

[*]

>>   qemuutil = declare_dependency(link_with: libqemuutil,
>>                                 sources: genh + version_res,
>>                                 dependencies: [event_loop_base])
>> diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h
>> index d6495d7f297..c3a1f53d350 100644
>> --- a/hw/vfio/pci.h
>> +++ b/hw/vfio/pci.h
>> @@ -258,6 +258,8 @@ bool vfio_probe_igd_config_quirk(VFIOPCIDevice 
>> *vdev, Error **errp);
>>   extern const PropertyInfo qdev_prop_nv_gpudirect_clique;
>> +struct vfio_pci_hot_reset_info;
>> +
>>   void vfio_pci_pre_reset(VFIOPCIDevice *vdev);
>>   void vfio_pci_post_reset(VFIOPCIDevice *vdev);
>>   bool vfio_pci_host_match(PCIHostDeviceAddress *addr, const char *name);
>> diff --git a/hw/vfio/igd-stubs.c b/hw/vfio/igd-stubs.c
>> new file mode 100644
>> index 00000000000..f7687d90912
>> --- /dev/null
>> +++ b/hw/vfio/igd-stubs.c
>> @@ -0,0 +1,20 @@
>> +/*
>> + * IGD device quirks stubs
>> + *
>> + * SPDX-License-Identifier: GPL-2.0-or-later
>> + */
>> +
>> +#include "qemu/osdep.h"
>> +#include "qapi/qmp/qerror.h"
>> +#include "pci.h"
>> +#include "pci-quirks.h"
>> +
>> +void vfio_probe_igd_bar0_quirk(VFIOPCIDevice *vdev, int nr)
>> +{
>> +    return;
>> +}
>> +
>> +bool vfio_probe_igd_config_quirk(VFIOPCIDevice *vdev, Error **errp)
>> +{
>> +    return true;
>> +}
>> diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
>> index 7b907b9360d..ab864048943 100644
>> --- a/hw/vfio/pci-quirks.c
>> +++ b/hw/vfio/pci-quirks.c
>> @@ -11,7 +11,6 @@
>>    */
>>   #include "qemu/osdep.h"
>> -#include CONFIG_DEVICES
>>   #include "exec/memop.h"
>>   #include "qemu/units.h"
>>   #include "qemu/log.h"
>> @@ -1128,11 +1127,9 @@ static void 
>> vfio_probe_rtl8168_bar2_quirk(VFIOPCIDevice *vdev, int nr)
>>    */
>>   bool vfio_config_quirk_setup(VFIOPCIDevice *vdev, Error **errp)
>>   {
>> -#ifdef CONFIG_VFIO_IGD
>>       if (!vfio_probe_igd_config_quirk(vdev, errp)) {
>>           return false;
>>       }
>> -#endif
>>       return true;
>>   }
>> @@ -1179,9 +1176,7 @@ void vfio_bar_quirk_setup(VFIOPCIDevice *vdev, 
>> int nr)
>>       vfio_probe_nvidia_bar5_quirk(vdev, nr);
>>       vfio_probe_nvidia_bar0_quirk(vdev, nr);
>>       vfio_probe_rtl8168_bar2_quirk(vdev, nr);
>> -#ifdef CONFIG_VFIO_IGD
>>       vfio_probe_igd_bar0_quirk(vdev, nr);
>> -#endif
>>   }
>>   void vfio_bar_quirk_exit(VFIOPCIDevice *vdev, int nr)
>> diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build
>> index f2a7728d3d0..6c00a7f51bb 100644
>> --- a/hw/vfio/meson.build
>> +++ b/hw/vfio/meson.build
>> @@ -17,6 +17,7 @@ vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files(
>>   vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c'))
>>   vfio_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c'))
>>   vfio_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c'))
>> +stub_ss.add(files('igd-stubs.c'))
>>   specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss)
> 


Re: [PATCH v4 3/8] hw/vfio/pci-quirks.c: remove CONFIG_VFIO_IGD
Posted by Pierrick Bouvier 1 week, 1 day ago
On 3/18/26 2:46 AM, Philippe Mathieu-Daudé wrote:
> On 18/3/26 09:11, Cédric Le Goater wrote:
>> On 3/17/26 20:42, Pierrick Bouvier wrote:
>>> Add stubs for needed functions.
>>>
> 
> --->
> 
>>> As well, we need to add pixman to qemuutil library dependencies since
>>> pixman is transitively included from pci.h header, which is needed to be
>>> able to include prototypes for stubs we declared.
>>> In file included from include/ui/console.h:4,
>>>                    from ../hw/vfio/vfio-display.h:12,
>>>                    from ../hw/vfio/pci.h:25,
>>>                    from ../hw/vfio/igd-stubs.c:9:
>>> include/ui/qemu-pixman.h:10:10: fatal error: pixman.h: No such file or
>>> directory
>>>      10 | #include <pixman.h>
>>>         |          ^~~~~~~~~~
>>>
>>> On OpenBSD, opengl headers are not available in default include path,
>>> and thus we need to add opengl to list of qemuutil dependencies.
>>> In file included from /home/root/qemu/include/ui/console.h:9:
>>> /home/root/qemu/include/ui/surface.h:11:11: fatal error: 'epoxy/gl.h'
>>> file not found
>>>
>>> Finally,
> 
> <---
> 
>>> vfio_pci_hot_reset_info must be forwarded declared on non linux
>>> platforms:
>>> In file included from ../hw/vfio/igd-stubs.c:9:
>>> ../hw/vfio/pci.h:265:44: error: 'struct vfio_pci_hot_reset_info'
>>> declared inside parameter list will not be visible outside of this
>>> definition or declaration [-Werror]
>>>     265 |                                     struct
>>> vfio_pci_hot_reset_info **info_p);
>>>         |
>>>
>>> Reviewed-by: Cédric Le Goater <clg@redhat.com>
>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>>>
>>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>>
>> Duplicated Signed-off-by. I can fix when applying.
> 
> Actually you can also cut description marked betwwen --->
> and <--- because already mentioned in future commit 988499515da:
> https://lore.kernel.org/qemu-devel/20260317190250.70506-3-philmd@linaro.org/
> which removes [*] below (should disappear on rebase).
> 
> (Sorry for that hiccups, I was expecting Pierrick series to
> be posted after my PR was merged).
>

No problem, I'll change it and fix the extra signed-off by, so Cedric 
can have a clean v5 to apply.

Thanks!

> Regards,
> 
> Phil.
> 
>>
>> Thanks,
>>
>> C.
>>
>>> ---
>>>    meson.build          |  2 +-
>>>    hw/vfio/pci.h        |  2 ++
>>>    hw/vfio/igd-stubs.c  | 20 ++++++++++++++++++++
>>>    hw/vfio/pci-quirks.c |  5 -----
>>>    hw/vfio/meson.build  |  1 +
>>>    5 files changed, 24 insertions(+), 6 deletions(-)
>>>    create mode 100644 hw/vfio/igd-stubs.c
>>>