Skip to contentSkip to conversation

Fix to show vfio migration stat in migration status

PATCH Superseded Kirti Wankhede 3 participants 9 messages Nov 18, 2020 – Nov 25, 2020 Arm/Amlogic Meson SoC support

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix to show vfio migration stat in migration status

Header file where CONFIG_VFIO is defined is not included in migration.c file. Include config devices header file in migration.c.

Fixes 3710586caa5d ("qapi: Add VFIO devices migration stats in Migration

stats")

---
 meson.build           | 1 +
 migration/migration.c | 1 +
 2 files changed, 2 insertions(+)
meson.build +1 -0
index 7ddf983ff7f5..24526499cfb5 100644
@@ -1713,6 +1713,7 @@ common_ss.add_all(when: 'CONFIG_USER_ONLY', if_true: user_ss)
 
 common_all = common_ss.apply(config_all, strict: false)
 common_all = static_library('common',
+                            c_args:'-DCONFIG_DEVICES="@[email protected]"'.format(target) ,
                             build_by_default: false,
                             sources: common_all.sources() + genh,
                             dependencies: common_all.dependencies(),
migration/migration.c +1 -0
index 87a9b59f83f4..650efb81daad 100644
@@ -57,6 +57,7 @@
 #include "qemu/queue.h"
 #include "multifd.h"
 
+#include CONFIG_DEVICES
 #ifdef CONFIG_VFIO
 #include "hw/vfio/vfio-common.h"
 #endif
Signature · 1 line
2.7.0
#1 lore raw
Quoted 29 lines · On Thu, 19 Nov 2020 01:58:47 +0530 Kirti Wankhede <[email protected]> wrote:

Header file where CONFIG_VFIO is defined is not included in migration.c file. Include config devices header file in migration.c.

Fixes 3710586caa5d ("qapi: Add VFIO devices migration stats in Migration

stats")

---
 meson.build           | 1 +
 migration/migration.c | 1 +
 2 files changed, 2 insertions(+)
meson.build +1 -0
index 7ddf983ff7f5..24526499cfb5 100644
@@ -1713,6 +1713,7 @@ common_ss.add_all(when: 'CONFIG_USER_ONLY', if_true: user_ss)
 
 common_all = common_ss.apply(config_all, strict: false)
 common_all = static_library('common',
+                            c_args:'-DCONFIG_DEVICES="@[email protected]"'.format(target) ,
                             build_by_default: false,
                             sources: common_all.sources() + genh,
                             dependencies: common_all.dependencies(),
migration/migration.c +0 -0
index 87a9b59f83f4..650efb81daad 100644

migration/migration.c line 63

Quoted 7 lines
migration/migration.c +1 -0
@@ -57,6 +57,7 @@
 #include "qemu/queue.h"
 #include "multifd.h"
 
+#include CONFIG_DEVICES
 #ifdef CONFIG_VFIO
 #include "hw/vfio/vfio-common.h"
 #endif

Fails to build...

[1705/8465] Compiling C object libcommon.fa.p/migration_postcopy-ram.c.o
[1706/8465] Compiling C object libcommon.fa.p/migration_migration.c.o
FAILED: libcommon.fa.p/migration_migration.c.o
cc -Ilibcommon.fa.p -I. -I.. -I../slirp -I../slirp/src -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/libpng16 -I/usr/include/capstone -I/usr/include/SDL2 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/at-spi-2.0 -I/usr/include/spice-1 -I/usr/include/spice-server -I/usr/include/cacard -I/usr/include/nss3 -I/usr/include/nspr4 -I/usr/include/vte-2.91 -I/usr/include/virgl -I/usr/include/libusb-1.0 -fdiagnostics-color=auto -pipe -Wall -Winvalid-pch -std=gnu99 -O2 -g -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredu
ndant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong -isystem /tmp/tmp.HlKsni7iGC/linux-headers -isystem linux-headers -iquote /tmp/tmp.HlKsni7iGC/tcg/i386 -iquote . -iquote /tmp/tmp.HlKsni7iGC -iquote /tmp/tmp.HlKsni7iGC/accel/tcg -iquote /tmp/tmp.HlKsni7iGC/include -iquote /tmp/tmp.HlKsni7iGC/disas/libvixl -pthread -fPIC -DSTRUCT_IOVEC_DEFINED -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DNCURSES_WIDECHAR -Wno-undef -D_REENTRANT '-DCONFIG_DEVICES="xtensa-linux-user-config-devices.h"' -MD -MQ libcommon.fa.p/migration_migration.c.o -MF libcommon.fa.p/migration_migration.c.o.d -o libcommon.fa.p/migration_migration.c.o -c ../migration/migration.c
<command-line>: fatal error: xtensa-linux-user-config-devices.h: No such file or directory
compilation terminated.
[1707/8465] Compiling C object libcommon.fa.p/hw_pci-bridge_dec.c.o
[1708/8465] Compiling C object libcommon.fa.p/backends_hostmem-memfd.c.o
[1709/8465] Compiling C object libcommon.fa.p/hw_display_edid-region.c.o
[1710/8465] Compiling C object libcommon.fa.p/ui_gtk-gl-area.c.o
[1711/8465] Compiling C object libcommon.fa.p/disas_s390.c.o
[1712/8465] Compiling C object libcommon.fa.p/hw_pci-host_gpex-acpi.c.o
[1713/8465] Compiling C object libcommon.fa.p/hw_misc_macio_macio.c.o
[1714/8465] Compiling C object libcommon.fa.p/hw_misc_bcm2835_mbox.c.o
[1715/8465] Compiling C object libcommon.fa.p/hw_pci-bridge_xio3130_upstream.c.o
[1716/8465] Compiling C object libcommon.fa.p/hw_display_qxl-logger.c.o
[1717/8465] Compiling C object libcommon.fa.p/hw_net_net_tx_pkt.c.o
[1718/8465] Compiling C object libcommon.fa.p/hw_char_xen_console.c.o
[1719/8465] Compiling C object libqemu-mips64el-softmmu.fa.p/target_mips_msa_helper.c.o
[1720/8465] Compiling C object libqemu-mips64el-softmmu.fa.p/target_mips_translate.c.o
[1721/8465] Compiling C++ object libcommon.fa.p/disas_nanomips.cpp.o
ninja: build stopped: subcommand failed.
make[1]: *** [Makefile:171: run-ninja] Error 1
make[1]: Leaving directory '/tmp/tmp.HlKsni7iGC/build'
make: *** [GNUmakefile:11: all] Error 2

#2 lore raw
Quoted 35 lines · Alex Williamson
Quoted 32 lines · On Thu, 19 Nov 2020 01:58:47 +0530 Kirti Wankhede <[email protected]> wrote:

Header file where CONFIG_VFIO is defined is not included in migration.c file. Include config devices header file in migration.c.

Fixes 3710586caa5d ("qapi: Add VFIO devices migration stats in Migration

stats")

---
  meson.build           | 1 +
  migration/migration.c | 1 +
  2 files changed, 2 insertions(+)
meson.build +1 -0
index 7ddf983ff7f5..24526499cfb5 100644
@@ -1713,6 +1713,7 @@ common_ss.add_all(when: 'CONFIG_USER_ONLY', if_true: user_ss)
 
  common_all = common_ss.apply(config_all, strict: false)
  common_all = static_library('common',
+                            c_args:'-DCONFIG_DEVICES="@[email protected]"'.format(target) ,
                              build_by_default: false,
                              sources: common_all.sources() + genh,
                              dependencies: common_all.dependencies(),
migration/migration.c +0 -0
index 87a9b59f83f4..650efb81daad 100644
@@ -57,6 +57,7 @@
  #include "qemu/queue.h"
  #include "multifd.h"
 
Quoted 7 lines

migration/migration.c line 63

Quoted 4 lines
migration/migration.c +1 -0
+#include CONFIG_DEVICES
  #ifdef CONFIG_VFIO
  #include "hw/vfio/vfio-common.h"
  #endif

Fails to build...

I didn't see this in my testing. Any specific configuration/build which fails?

Thanks,
Kirti

Quoted 27 lines

[1705/8465] Compiling C object libcommon.fa.p/migration_postcopy-ram.c.o
[1706/8465] Compiling C object libcommon.fa.p/migration_migration.c.o
FAILED: libcommon.fa.p/migration_migration.c.o
cc -Ilibcommon.fa.p -I. -I.. -I../slirp -I../slirp/src -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/libpng16 -I/usr/include/capstone -I/usr/include/SDL2 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/at-spi-2.0 -I/usr/include/spice-1 -I/usr/include/spice-server -I/usr/include/cacard -I/usr/include/nss3 -I/usr/include/nspr4 -I/usr/include/vte-2.91 -I/usr/include/virgl -I/usr/include/libusb-1.0 -fdiagnostics-color=auto -pipe -Wall -Winvalid-pch -std=gnu99 -O2 -g -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredu
ndant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong -isystem /tmp/tmp.HlKsni7iGC/linux-headers -isystem linux-headers -iquote /tmp/tmp.HlKsni7iGC/tcg/i386 -iquote . -iquote /tmp/tmp.HlKsni7iGC -iquote /tmp/tmp.HlKsni7iGC/accel/tcg -iquote /tmp/tmp.HlKsni7iGC/include -iquote /tmp/tmp.HlKsni7iGC/disas/libvixl -pthread -fPIC -DSTRUCT_IOVEC_DEFINED -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DNCURSES_WIDECHAR -Wno-undef -D_REENTRANT '-DCONFIG_DEVICES="xtensa-linux-user-config-devices.h"' -MD -MQ libcommon.fa.p/migration_migration.c.o -MF libcommon.fa.p/migration_migration.c.o.d -o libcommon.fa.p/migration_migration.c.o -c ../migration/migration.c
<command-line>: fatal error: xtensa-linux-user-config-devices.h: No such file or directory
compilation terminated.
[1707/8465] Compiling C object libcommon.fa.p/hw_pci-bridge_dec.c.o
[1708/8465] Compiling C object libcommon.fa.p/backends_hostmem-memfd.c.o
[1709/8465] Compiling C object libcommon.fa.p/hw_display_edid-region.c.o
[1710/8465] Compiling C object libcommon.fa.p/ui_gtk-gl-area.c.o
[1711/8465] Compiling C object libcommon.fa.p/disas_s390.c.o
[1712/8465] Compiling C object libcommon.fa.p/hw_pci-host_gpex-acpi.c.o
[1713/8465] Compiling C object libcommon.fa.p/hw_misc_macio_macio.c.o
[1714/8465] Compiling C object libcommon.fa.p/hw_misc_bcm2835_mbox.c.o
[1715/8465] Compiling C object libcommon.fa.p/hw_pci-bridge_xio3130_upstream.c.o
[1716/8465] Compiling C object libcommon.fa.p/hw_display_qxl-logger.c.o
[1717/8465] Compiling C object libcommon.fa.p/hw_net_net_tx_pkt.c.o
[1718/8465] Compiling C object libcommon.fa.p/hw_char_xen_console.c.o
[1719/8465] Compiling C object libqemu-mips64el-softmmu.fa.p/target_mips_msa_helper.c.o
[1720/8465] Compiling C object libqemu-mips64el-softmmu.fa.p/target_mips_translate.c.o
[1721/8465] Compiling C++ object libcommon.fa.p/disas_nanomips.cpp.o
ninja: build stopped: subcommand failed.
make[1]: *** [Makefile:171: run-ninja] Error 1
make[1]: Leaving directory '/tmp/tmp.HlKsni7iGC/build'
make: *** [GNUmakefile:11: all] Error 2

#3 lore raw
Quoted 44 lines · On Mon, 23 Nov 2020 23:48:37 +0530 Kirti Wankhede <[email protected]> wrote:
Quoted 35 lines · Alex Williamson
Quoted 32 lines · On Thu, 19 Nov 2020 01:58:47 +0530 Kirti Wankhede <[email protected]> wrote:

Header file where CONFIG_VFIO is defined is not included in migration.c file. Include config devices header file in migration.c.

Fixes 3710586caa5d ("qapi: Add VFIO devices migration stats in Migration

stats")

---
  meson.build           | 1 +
  migration/migration.c | 1 +
  2 files changed, 2 insertions(+)
meson.build +1 -0
index 7ddf983ff7f5..24526499cfb5 100644
@@ -1713,6 +1713,7 @@ common_ss.add_all(when: 'CONFIG_USER_ONLY', if_true: user_ss)
 
  common_all = common_ss.apply(config_all, strict: false)
  common_all = static_library('common',
+                            c_args:'-DCONFIG_DEVICES="@[email protected]"'.format(target) ,
                              build_by_default: false,
                              sources: common_all.sources() + genh,
                              dependencies: common_all.dependencies(),
migration/migration.c +0 -0
index 87a9b59f83f4..650efb81daad 100644
@@ -57,6 +57,7 @@
  #include "qemu/queue.h"
  #include "multifd.h"
 
Quoted 7 lines

migration/migration.c line 63

Quoted 4 lines
migration/migration.c +1 -0
+#include CONFIG_DEVICES
  #ifdef CONFIG_VFIO
  #include "hw/vfio/vfio-common.h"
  #endif  

Fails to build...

Quoted 2 lines

I didn't see this in my testing. Any specific configuration/build which fails?

x86_64 Fedora 32 host, no configure options:

./configure
make

Thanks,
Alex

Quoted 4 lines
Quoted 4 lines

[1705/8465] Compiling C object libcommon.fa.p/migration_postcopy-ram.c.o
[1706/8465] Compiling C object libcommon.fa.p/migration_migration.c.o
FAILED: libcommon.fa.p/migration_migration.c.o
cc -Ilibcommon.fa.p -I. -I.. -I../slirp -I../slirp/src -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/libpng16 -I/usr/include/capstone -I/usr/include/SDL2 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/at-spi-2.0 -I/usr/include/spice-1 -I/usr/include/spice-server -I/usr/include/cacard -I/usr/include/nss3 -I/usr/include/nspr4 -I/usr/include/vte-2.91 -I/usr/include/virgl -I/usr/include/libusb-1.0 -fdiagnostics-color=auto -pipe -Wall -Winvalid-pch -std=gnu99 -O2 -g -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -W

redu

Quoted 23 lines
Quoted 23 lines

ndant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong -isystem /tmp/tmp.HlKsni7iGC/linux-headers -isystem linux-headers -iquote /tmp/tmp.HlKsni7iGC/tcg/i386 -iquote . -iquote /tmp/tmp.HlKsni7iGC -iquote /tmp/tmp.HlKsni7iGC/accel/tcg -iquote /tmp/tmp.HlKsni7iGC/include -iquote /tmp/tmp.HlKsni7iGC/disas/libvixl -pthread -fPIC -DSTRUCT_IOVEC_DEFINED -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DNCURSES_WIDECHAR -Wno-undef -D_REENTRANT '-DCONFIG_DEVICES="xtensa-linux-user-config-devices.h"' -MD -MQ libcommon.fa.p/migration_migration.c.o -MF libcommon.fa.p/migration_migration.c.o.d -o libcommon.fa.p/migration_migration.c.o -c ../migration/migration.c
<command-line>: fatal error: xtensa-linux-user-config-devices.h: No such file or directory
compilation terminated.
[1707/8465] Compiling C object libcommon.fa.p/hw_pci-bridge_dec.c.o
[1708/8465] Compiling C object libcommon.fa.p/backends_hostmem-memfd.c.o
[1709/8465] Compiling C object libcommon.fa.p/hw_display_edid-region.c.o
[1710/8465] Compiling C object libcommon.fa.p/ui_gtk-gl-area.c.o
[1711/8465] Compiling C object libcommon.fa.p/disas_s390.c.o
[1712/8465] Compiling C object libcommon.fa.p/hw_pci-host_gpex-acpi.c.o
[1713/8465] Compiling C object libcommon.fa.p/hw_misc_macio_macio.c.o
[1714/8465] Compiling C object libcommon.fa.p/hw_misc_bcm2835_mbox.c.o
[1715/8465] Compiling C object libcommon.fa.p/hw_pci-bridge_xio3130_upstream.c.o
[1716/8465] Compiling C object libcommon.fa.p/hw_display_qxl-logger.c.o
[1717/8465] Compiling C object libcommon.fa.p/hw_net_net_tx_pkt.c.o
[1718/8465] Compiling C object libcommon.fa.p/hw_char_xen_console.c.o
[1719/8465] Compiling C object libqemu-mips64el-softmmu.fa.p/target_mips_msa_helper.c.o
[1720/8465] Compiling C object libqemu-mips64el-softmmu.fa.p/target_mips_translate.c.o
[1721/8465] Compiling C++ object libcommon.fa.p/disas_nanomips.cpp.o
ninja: build stopped: subcommand failed.
make[1]: *** [Makefile:171: run-ninja] Error 1
make[1]: Leaving directory '/tmp/tmp.HlKsni7iGC/build'
make: *** [GNUmakefile:11: all] Error 2

#4 lore raw
In reply to Kirti Wankhede
Quoted 7 lines · * Kirti Wankhede ([email protected]) wrote:

Header file where CONFIG_VFIO is defined is not included in migration.c file. Include config devices header file in migration.c.

Fixes 3710586caa5d ("qapi: Add VFIO devices migration stats in Migration

stats")

Given it's got build problems; I suggest actually something cleaner would be to swing populate_vfio_info into one of the vfio specific files, add a stubs/ entry somewhere and then migration.c doesn't need to include the device or header stuff.

Dave

Quoted 32 lines
---
 meson.build           | 1 +
 migration/migration.c | 1 +
 2 files changed, 2 insertions(+)
meson.build +1 -0
index 7ddf983ff7f5..24526499cfb5 100644
@@ -1713,6 +1713,7 @@ common_ss.add_all(when: 'CONFIG_USER_ONLY', if_true: user_ss)
 
 common_all = common_ss.apply(config_all, strict: false)
 common_all = static_library('common',
+                            c_args:'-DCONFIG_DEVICES="@[email protected]"'.format(target) ,
                             build_by_default: false,
                             sources: common_all.sources() + genh,
                             dependencies: common_all.dependencies(),
migration/migration.c +1 -0
index 87a9b59f83f4..650efb81daad 100644
@@ -57,6 +57,7 @@
 #include "qemu/queue.h"
 #include "multifd.h"
 
+#include CONFIG_DEVICES
 #ifdef CONFIG_VFIO
 #include "hw/vfio/vfio-common.h"
 #endif
Signature · 1 line
2.7.0
Signature · 1 line
Dr. David Alan Gilbert / [email protected] / Manchester, UK
#5 lore raw
Quoted 7 lines · Dr. David Alan Gilbert
Quoted 6 lines · * Kirti Wankhede ([email protected]) wrote:

Header file where CONFIG_VFIO is defined is not included in migration.c file. Include config devices header file in migration.c.

Fixes 3710586caa5d ("qapi: Add VFIO devices migration stats in Migration

stats")

Quoted 7 lines
Quoted 1 line

Given it's got build problems; I suggest actually something cleaner would be to swing populate_vfio_info into one of the vfio specific files, add a stubs/ entry somewhere and then migration.c doesn't need to include the device or header stuff.

Still function prototype for populate_vfio_info() and its stub has to be placed in some header file.

Earlier I used CONFIG_LINUX instead of CONFIG_VFIO which works here. Should I change it back to CONFIG_LINUX?

I'm not very much aware of meson build system, I tested by configuring specific target, but I think by default if target build is not specified during configuration, it builds for multiple target that's where this build is failing. Any help on how to fix it would be helpful.

Thanks,
Kirti

Quoted 34 lines

Dave

Quoted 32 lines
---
  meson.build           | 1 +
  migration/migration.c | 1 +
  2 files changed, 2 insertions(+)
meson.build +1 -0
index 7ddf983ff7f5..24526499cfb5 100644
@@ -1713,6 +1713,7 @@ common_ss.add_all(when: 'CONFIG_USER_ONLY', if_true: user_ss)
 
  common_all = common_ss.apply(config_all, strict: false)
  common_all = static_library('common',
+                            c_args:'-DCONFIG_DEVICES="@[email protected]"'.format(target) ,
                              build_by_default: false,
                              sources: common_all.sources() + genh,
                              dependencies: common_all.dependencies(),
migration/migration.c +1 -0
index 87a9b59f83f4..650efb81daad 100644
@@ -57,6 +57,7 @@
  #include "qemu/queue.h"
  #include "multifd.h"
 
+#include CONFIG_DEVICES
  #ifdef CONFIG_VFIO
  #include "hw/vfio/vfio-common.h"
  #endif
Signature · 1 line
2.7.0
#6 lore raw
Quoted 12 lines · * Kirti Wankhede ([email protected]) wrote:
Quoted 9 lines · Dr. David Alan Gilbert
Quoted 7 lines · * Kirti Wankhede ([email protected]) wrote:

Header file where CONFIG_VFIO is defined is not included in migration.c file. Include config devices header file in migration.c.

Fixes 3710586caa5d ("qapi: Add VFIO devices migration stats in Migration

stats")

Quoted 8 lines
Quoted 5 lines

Given it's got build problems; I suggest actually something cleaner would be to swing populate_vfio_info into one of the vfio specific files, add a stubs/ entry somewhere and then migration.c doesn't need to include the device or header stuff.

Still function prototype for populate_vfio_info() and its stub has to be placed in some header file.

Which header file isn't that important; and the stub goes in a file in stubs/

Quoted 2 lines

Earlier I used CONFIG_LINUX instead of CONFIG_VFIO which works here. Should I change it back to CONFIG_LINUX?

No.

Quoted 4 lines

I'm not very much aware of meson build system, I tested by configuring specific target, but I think by default if target build is not specified during configuration, it builds for multiple target that's where this build is failing. Any help on how to fix it would be helpful.

With my suggestion you don't have to do anything clever to meson (which I don't know much about either).

Dave

Quoted 36 lines

Thanks,
Kirti

Quoted 32 lines

Dave

Quoted 30 lines
---
  meson.build           | 1 +
  migration/migration.c | 1 +
  2 files changed, 2 insertions(+)
meson.build +1 -0
index 7ddf983ff7f5..24526499cfb5 100644
@@ -1713,6 +1713,7 @@ common_ss.add_all(when: 'CONFIG_USER_ONLY', if_true: user_ss)
  common_all = common_ss.apply(config_all, strict: false)
  common_all = static_library('common',
+                            c_args:'-DCONFIG_DEVICES="@[email protected]"'.format(target) ,
                              build_by_default: false,
                              sources: common_all.sources() + genh,
                              dependencies: common_all.dependencies(),
migration/migration.c +1 -0
index 87a9b59f83f4..650efb81daad 100644
@@ -57,6 +57,7 @@
  #include "qemu/queue.h"
  #include "multifd.h"
+#include CONFIG_DEVICES
  #ifdef CONFIG_VFIO
  #include "hw/vfio/vfio-common.h"
  #endif
Signature · 1 line
2.7.0
Signature · 1 line
Dr. David Alan Gilbert / [email protected] / Manchester, UK
#7 lore raw
Quoted 19 lines · Dr. David Alan Gilbert
Quoted 18 lines · * Kirti Wankhede ([email protected]) wrote:
Quoted 14 lines · Dr. David Alan Gilbert
Quoted 7 lines · * Kirti Wankhede ([email protected]) wrote:

Header file where CONFIG_VFIO is defined is not included in migration.c file. Include config devices header file in migration.c.

Fixes 3710586caa5d ("qapi: Add VFIO devices migration stats in Migration

stats")

Given it's got build problems; I suggest actually something cleaner would be to swing populate_vfio_info into one of the vfio specific files, add a stubs/ entry somewhere and then migration.c doesn't need to include the device or header stuff.

Quoted 4 lines
Quoted 2 lines

Still function prototype for populate_vfio_info() and its stub has to be placed in some header file.

Which header file isn't that important;

Any recommendation which header file to use?

Thanks,
Kirti

Quoted 54 lines

and the stub goes in a file in
stubs/

Quoted 2 lines

Earlier I used CONFIG_LINUX instead of CONFIG_VFIO which works here. Should I change it back to CONFIG_LINUX?

No.

Quoted 4 lines

I'm not very much aware of meson build system, I tested by configuring specific target, but I think by default if target build is not specified during configuration, it builds for multiple target that's where this build is failing. Any help on how to fix it would be helpful.

With my suggestion you don't have to do anything clever to meson (which I don't know much about either).

Dave

Quoted 36 lines

Thanks,
Kirti

Quoted 32 lines

Dave

Quoted 30 lines
---
   meson.build           | 1 +
   migration/migration.c | 1 +
   2 files changed, 2 insertions(+)
meson.build +1 -0
index 7ddf983ff7f5..24526499cfb5 100644
@@ -1713,6 +1713,7 @@ common_ss.add_all(when: 'CONFIG_USER_ONLY', if_true: user_ss)
   common_all = common_ss.apply(config_all, strict: false)
   common_all = static_library('common',
+                            c_args:'-DCONFIG_DEVICES="@[email protected]"'.format(target) ,
                               build_by_default: false,
                               sources: common_all.sources() + genh,
                               dependencies: common_all.dependencies(),
migration/migration.c +1 -0
index 87a9b59f83f4..650efb81daad 100644
@@ -57,6 +57,7 @@
   #include "qemu/queue.h"
   #include "multifd.h"
+#include CONFIG_DEVICES
   #ifdef CONFIG_VFIO
   #include "hw/vfio/vfio-common.h"
   #endif
Signature · 1 line
2.7.0
#8 lore raw
Quoted 22 lines · * Kirti Wankhede ([email protected]) wrote:
Quoted 19 lines · Dr. David Alan Gilbert
Quoted 18 lines · * Kirti Wankhede ([email protected]) wrote:
Quoted 14 lines · Dr. David Alan Gilbert
Quoted 7 lines · * Kirti Wankhede ([email protected]) wrote:

Header file where CONFIG_VFIO is defined is not included in migration.c file. Include config devices header file in migration.c.

Fixes 3710586caa5d ("qapi: Add VFIO devices migration stats in Migration

stats")

Given it's got build problems; I suggest actually something cleaner would be to swing populate_vfio_info into one of the vfio specific files, add a stubs/ entry somewhere and then migration.c doesn't need to include the device or header stuff.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Still function prototype for populate_vfio_info() and its stub has to be placed in some header file.

Which header file isn't that important;

Any recommendation which header file to use?

I guess ./include/hw/vfio/vfio.h or one of the other vfio headers that works even if vfio isn't configured?

Dave

Quoted 58 lines

Thanks,
Kirti

Quoted 54 lines

and the stub goes in a file in
stubs/

Quoted 2 lines

Earlier I used CONFIG_LINUX instead of CONFIG_VFIO which works here. Should I change it back to CONFIG_LINUX?

No.

Quoted 4 lines

I'm not very much aware of meson build system, I tested by configuring specific target, but I think by default if target build is not specified during configuration, it builds for multiple target that's where this build is failing. Any help on how to fix it would be helpful.

With my suggestion you don't have to do anything clever to meson (which I don't know much about either).

Dave

Quoted 36 lines

Thanks,
Kirti

Quoted 32 lines

Dave

Quoted 30 lines
---
   meson.build           | 1 +
   migration/migration.c | 1 +
   2 files changed, 2 insertions(+)
meson.build +1 -0
index 7ddf983ff7f5..24526499cfb5 100644
@@ -1713,6 +1713,7 @@ common_ss.add_all(when: 'CONFIG_USER_ONLY', if_true: user_ss)
   common_all = common_ss.apply(config_all, strict: false)
   common_all = static_library('common',
+                            c_args:'-DCONFIG_DEVICES="@[email protected]"'.format(target) ,
                               build_by_default: false,
                               sources: common_all.sources() + genh,
                               dependencies: common_all.dependencies(),
migration/migration.c +1 -0
index 87a9b59f83f4..650efb81daad 100644
@@ -57,6 +57,7 @@
   #include "qemu/queue.h"
   #include "multifd.h"
+#include CONFIG_DEVICES
   #ifdef CONFIG_VFIO
   #include "hw/vfio/vfio-common.h"
   #endif
Signature · 1 line
2.7.0
Signature · 1 line
Dr. David Alan Gilbert / [email protected] / Manchester, UK