Message ID | 1605731327-23533-1-git-send-email-kwankhede@nvidia.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/1] Fix to show vfio migration stat in migration status | expand |
On Thu, 19 Nov 2020 01:58:47 +0530 Kirti Wankhede <kwankhede@nvidia.com> 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") > > Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com> > --- > meson.build | 1 + > migration/migration.c | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/meson.build b/meson.build > index 7ddf983ff7f5..24526499cfb5 100644 > --- a/meson.build > +++ b/meson.build > @@ -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="@0@-config-devices.h"'.format(target) , > build_by_default: false, > sources: common_all.sources() + genh, > dependencies: common_all.dependencies(), > diff --git a/migration/migration.c b/migration/migration.c > index 87a9b59f83f4..650efb81daad 100644 > --- a/migration/migration.c > +++ b/migration/migration.c > @@ -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
On 11/23/2020 10:03 PM, Alex Williamson wrote: > On Thu, 19 Nov 2020 01:58:47 +0530 > Kirti Wankhede <kwankhede@nvidia.com> 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") >> >> Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com> >> --- >> meson.build | 1 + >> migration/migration.c | 1 + >> 2 files changed, 2 insertions(+) >> >> diff --git a/meson.build b/meson.build >> index 7ddf983ff7f5..24526499cfb5 100644 >> --- a/meson.build >> +++ b/meson.build >> @@ -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="@0@-config-devices.h"'.format(target) , >> build_by_default: false, >> sources: common_all.sources() + genh, >> dependencies: common_all.dependencies(), >> diff --git a/migration/migration.c b/migration/migration.c >> index 87a9b59f83f4..650efb81daad 100644 >> --- a/migration/migration.c >> +++ b/migration/migration.c >> @@ -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... > I didn't see this in my testing. Any specific configuration/build which fails? Thanks, Kirti > [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 >
On Mon, 23 Nov 2020 23:48:37 +0530 Kirti Wankhede <kwankhede@nvidia.com> wrote: > On 11/23/2020 10:03 PM, Alex Williamson wrote: > > On Thu, 19 Nov 2020 01:58:47 +0530 > > Kirti Wankhede <kwankhede@nvidia.com> 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") > >> > >> Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com> > >> --- > >> meson.build | 1 + > >> migration/migration.c | 1 + > >> 2 files changed, 2 insertions(+) > >> > >> diff --git a/meson.build b/meson.build > >> index 7ddf983ff7f5..24526499cfb5 100644 > >> --- a/meson.build > >> +++ b/meson.build > >> @@ -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="@0@-config-devices.h"'.format(target) , > >> build_by_default: false, > >> sources: common_all.sources() + genh, > >> dependencies: common_all.dependencies(), > >> diff --git a/migration/migration.c b/migration/migration.c > >> index 87a9b59f83f4..650efb81daad 100644 > >> --- a/migration/migration.c > >> +++ b/migration/migration.c > >> @@ -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... > > > > 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 > > [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 > > 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 > >
* Kirti Wankhede (kwankhede@nvidia.com) 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") > > Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com> 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 > --- > meson.build | 1 + > migration/migration.c | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/meson.build b/meson.build > index 7ddf983ff7f5..24526499cfb5 100644 > --- a/meson.build > +++ b/meson.build > @@ -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="@0@-config-devices.h"'.format(target) , > build_by_default: false, > sources: common_all.sources() + genh, > dependencies: common_all.dependencies(), > diff --git a/migration/migration.c b/migration/migration.c > index 87a9b59f83f4..650efb81daad 100644 > --- a/migration/migration.c > +++ b/migration/migration.c > @@ -57,6 +57,7 @@ > #include "qemu/queue.h" > #include "multifd.h" > > +#include CONFIG_DEVICES > #ifdef CONFIG_VFIO > #include "hw/vfio/vfio-common.h" > #endif > -- > 2.7.0 >
On 11/25/2020 3:00 PM, Dr. David Alan Gilbert wrote: > * Kirti Wankhede (kwankhede@nvidia.com) 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") >> >> Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com> > > 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 > Dave > >> --- >> meson.build | 1 + >> migration/migration.c | 1 + >> 2 files changed, 2 insertions(+) >> >> diff --git a/meson.build b/meson.build >> index 7ddf983ff7f5..24526499cfb5 100644 >> --- a/meson.build >> +++ b/meson.build >> @@ -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="@0@-config-devices.h"'.format(target) , >> build_by_default: false, >> sources: common_all.sources() + genh, >> dependencies: common_all.dependencies(), >> diff --git a/migration/migration.c b/migration/migration.c >> index 87a9b59f83f4..650efb81daad 100644 >> --- a/migration/migration.c >> +++ b/migration/migration.c >> @@ -57,6 +57,7 @@ >> #include "qemu/queue.h" >> #include "multifd.h" >> >> +#include CONFIG_DEVICES >> #ifdef CONFIG_VFIO >> #include "hw/vfio/vfio-common.h" >> #endif >> -- >> 2.7.0 >>
* Kirti Wankhede (kwankhede@nvidia.com) wrote: > > > On 11/25/2020 3:00 PM, Dr. David Alan Gilbert wrote: > > * Kirti Wankhede (kwankhede@nvidia.com) 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") > > > > > > Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com> > > > > 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/ > Earlier I used CONFIG_LINUX instead of CONFIG_VFIO which works here. Should > I change it back to CONFIG_LINUX? No. > 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 > Thanks, > Kirti > > > Dave > > > > > --- > > > meson.build | 1 + > > > migration/migration.c | 1 + > > > 2 files changed, 2 insertions(+) > > > > > > diff --git a/meson.build b/meson.build > > > index 7ddf983ff7f5..24526499cfb5 100644 > > > --- a/meson.build > > > +++ b/meson.build > > > @@ -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="@0@-config-devices.h"'.format(target) , > > > build_by_default: false, > > > sources: common_all.sources() + genh, > > > dependencies: common_all.dependencies(), > > > diff --git a/migration/migration.c b/migration/migration.c > > > index 87a9b59f83f4..650efb81daad 100644 > > > --- a/migration/migration.c > > > +++ b/migration/migration.c > > > @@ -57,6 +57,7 @@ > > > #include "qemu/queue.h" > > > #include "multifd.h" > > > +#include CONFIG_DEVICES > > > #ifdef CONFIG_VFIO > > > #include "hw/vfio/vfio-common.h" > > > #endif > > > -- > > > 2.7.0 > > > >
On 11/26/2020 12:33 AM, Dr. David Alan Gilbert wrote: > * Kirti Wankhede (kwankhede@nvidia.com) wrote: >> >> >> On 11/25/2020 3:00 PM, Dr. David Alan Gilbert wrote: >>> * Kirti Wankhede (kwankhede@nvidia.com) 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") >>>> >>>> Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com> >>> >>> 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; Any recommendation which header file to use? Thanks, Kirti > and the stub goes in a file in > stubs/ > >> Earlier I used CONFIG_LINUX instead of CONFIG_VFIO which works here. Should >> I change it back to CONFIG_LINUX? > > No. > >> 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 > >> Thanks, >> Kirti >> >>> Dave >>> >>>> --- >>>> meson.build | 1 + >>>> migration/migration.c | 1 + >>>> 2 files changed, 2 insertions(+) >>>> >>>> diff --git a/meson.build b/meson.build >>>> index 7ddf983ff7f5..24526499cfb5 100644 >>>> --- a/meson.build >>>> +++ b/meson.build >>>> @@ -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="@0@-config-devices.h"'.format(target) , >>>> build_by_default: false, >>>> sources: common_all.sources() + genh, >>>> dependencies: common_all.dependencies(), >>>> diff --git a/migration/migration.c b/migration/migration.c >>>> index 87a9b59f83f4..650efb81daad 100644 >>>> --- a/migration/migration.c >>>> +++ b/migration/migration.c >>>> @@ -57,6 +57,7 @@ >>>> #include "qemu/queue.h" >>>> #include "multifd.h" >>>> +#include CONFIG_DEVICES >>>> #ifdef CONFIG_VFIO >>>> #include "hw/vfio/vfio-common.h" >>>> #endif >>>> -- >>>> 2.7.0 >>>> >>
* Kirti Wankhede (kwankhede@nvidia.com) wrote: > > > On 11/26/2020 12:33 AM, Dr. David Alan Gilbert wrote: > > * Kirti Wankhede (kwankhede@nvidia.com) wrote: > > > > > > > > > On 11/25/2020 3:00 PM, Dr. David Alan Gilbert wrote: > > > > * Kirti Wankhede (kwankhede@nvidia.com) 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") > > > > > > > > > > Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com> > > > > > > > > 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; > > 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 > Thanks, > Kirti > > > and the stub goes in a file in > > stubs/ > > > > > Earlier I used CONFIG_LINUX instead of CONFIG_VFIO which works here. Should > > > I change it back to CONFIG_LINUX? > > > > No. > > > > > 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 > > > > > Thanks, > > > Kirti > > > > > > > Dave > > > > > > > > > --- > > > > > meson.build | 1 + > > > > > migration/migration.c | 1 + > > > > > 2 files changed, 2 insertions(+) > > > > > > > > > > diff --git a/meson.build b/meson.build > > > > > index 7ddf983ff7f5..24526499cfb5 100644 > > > > > --- a/meson.build > > > > > +++ b/meson.build > > > > > @@ -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="@0@-config-devices.h"'.format(target) , > > > > > build_by_default: false, > > > > > sources: common_all.sources() + genh, > > > > > dependencies: common_all.dependencies(), > > > > > diff --git a/migration/migration.c b/migration/migration.c > > > > > index 87a9b59f83f4..650efb81daad 100644 > > > > > --- a/migration/migration.c > > > > > +++ b/migration/migration.c > > > > > @@ -57,6 +57,7 @@ > > > > > #include "qemu/queue.h" > > > > > #include "multifd.h" > > > > > +#include CONFIG_DEVICES > > > > > #ifdef CONFIG_VFIO > > > > > #include "hw/vfio/vfio-common.h" > > > > > #endif > > > > > -- > > > > > 2.7.0 > > > > > > > > >
diff --git a/meson.build b/meson.build index 7ddf983ff7f5..24526499cfb5 100644 --- a/meson.build +++ b/meson.build @@ -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="@0@-config-devices.h"'.format(target) , build_by_default: false, sources: common_all.sources() + genh, dependencies: common_all.dependencies(), diff --git a/migration/migration.c b/migration/migration.c index 87a9b59f83f4..650efb81daad 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -57,6 +57,7 @@ #include "qemu/queue.h" #include "multifd.h" +#include CONFIG_DEVICES #ifdef CONFIG_VFIO #include "hw/vfio/vfio-common.h" #endif
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") Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com> --- meson.build | 1 + migration/migration.c | 1 + 2 files changed, 2 insertions(+)