Skip to contentSkip to conversation

Misc meson fixes along test-vmstate fixes

PATCH Superseded Yonggang Luo 3 participants 9 messages Sep 7, 2020 Arm/Amlogic Meson SoC support

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover Misc meson fixes along test-vmstate fixes

The test-vmstate can be passed under win32 too
so enable it on win32,
This is based on Bonzini's upstream tag along

Yonggang Luo (4):
vmstate: Trying fixes test-vmstate.c
meson: Fixes jemalloc and tcmalloc can not building.
meson: remove empty else and duplicated gio deps
vmstate: Enable test-vmstate on all platform:

 configure            |  9 +++++++++
 meson.build          | 11 ++++-------
 tests/meson.build    |  4 +---
 tests/test-vmstate.c |  2 +-
 4 files changed, 15 insertions(+), 11 deletions(-)
Signature · 1 line
2.28.0.windows.1
#1 lore raw

PATCH v3 1/4 vmstate: Trying fixes test-vmstate.c

The vmstate should be valid on win32

---
 tests/test-vmstate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/test-vmstate.c +1 -1
index f8de709a0b..4c453575bb 100644
@@ -34,7 +34,6 @@
 #include "qemu/module.h"
 #include "io/channel-file.h"
 
-static char temp_file[] = "/tmp/vmst.test.XXXXXX";
 static int temp_fd;
 
 
@@ -1487,6 +1486,7 @@ static void test_tmp_struct(void)
 
 int main(int argc, char **argv)
 {
+    g_autofree char* temp_file = g_strdup_printf("%s/vmst.test.XXXXXX", g_get_tmp_dir());
     temp_fd = mkstemp(temp_file);
 
     module_call_init(MODULE_INIT_QOM);
Signature · 1 line
2.28.0.windows.1
Reviewed-by on v3 1/4
#2 lore raw

Re: [PATCH v3 1/4] vmstate: Trying fixes test-vmstate.c

"Trying fixes" or "Fixes" in subject?

Anyway:

Quoted 28 lines · Yonggang Luo

The vmstate should be valid on win32

---
 tests/test-vmstate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/test-vmstate.c +1 -1
index f8de709a0b..4c453575bb 100644
@@ -34,7 +34,6 @@
 #include "qemu/module.h"
 #include "io/channel-file.h"
 
-static char temp_file[] = "/tmp/vmst.test.XXXXXX";
 static int temp_fd;
 
 
@@ -1487,6 +1486,7 @@ static void test_tmp_struct(void)
 
 int main(int argc, char **argv)
 {
+    g_autofree char* temp_file = g_strdup_printf("%s/vmst.test.XXXXXX", g_get_tmp_dir());
     temp_fd = mkstemp(temp_file);
 
     module_call_init(MODULE_INIT_QOM);
#3 lore raw

PATCH v3 2/4 meson: Fixes jemalloc and tcmalloc can not building.

In reply to Yonggang Luo

Currently, the LIBS are not exposed to meson and meson didn't use that Use base_lib = declare_dependency(link_args: config_host['LIBS'].split()) to force use it

---
 configure   | 9 +++++++++
 meson.build | 5 ++++-
 2 files changed, 13 insertions(+), 1 deletion(-)
configure +9 -0
index 823756f4a4..7b2f3d64b0 100755
@@ -7245,6 +7245,14 @@ if test "$libxml2" = "yes" ; then
   echo "LIBXML2_LIBS=$libxml2_libs" >> $config_host_mak
 fi
 
+if test "$tcmalloc" = "yes" ; then
+  echo "CONFIG_TCMALLOC=y" >> $config_host_mak
+fi
+
+if test "$jemalloc" = "yes" ; then
+  echo "CONFIG_JEMALLOC=y" >> $config_host_mak
+fi
+
 if test "$replication" = "yes" ; then
   echo "CONFIG_REPLICATION=y" >> $config_host_mak
 fi
@@ -7416,6 +7424,7 @@ echo "PKG_CONFIG=$pkg_config_exe" >> $config_host_mak
 echo "WINDRES=$windres" >> $config_host_mak
 echo "CFLAGS=$CFLAGS" >> $config_host_mak
 echo "CFLAGS_NOPIE=$CFLAGS_NOPIE" >> $config_host_mak
+echo "LIBS=$LIBS" >> $config_host_mak
 echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
 echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak
 echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak
meson.build +4 -1
index 5421eca66a..6e909213ee 100644
@@ -116,6 +116,9 @@ endif
 # grandfathered in from the QEMU Makefiles.
 add_project_arguments(config_host['GLIB_CFLAGS'].split(),
                       native: false, language: ['c', 'cpp', 'objc'])
+
+base_lib = declare_dependency(link_args: config_host['LIBS'].split())
+
 glib = declare_dependency(link_args: config_host['GLIB_LIBS'].split())
 gio = not_found
 if 'CONFIG_GIO' in config_host
@@ -818,7 +821,7 @@ util_ss.add_all(trace_ss)
 util_ss = util_ss.apply(config_all, strict: false)
 libqemuutil = static_library('qemuutil',
                              sources: util_ss.sources() + stub_ss.sources() + genh,
-                             dependencies: [util_ss.dependencies(), m, glib, socket])
+                             dependencies: [util_ss.dependencies(), m, base_lib, glib, socket])
 qemuutil = declare_dependency(link_with: libqemuutil,
                               sources: genh + version_res)
 
Signature · 1 line
2.28.0.windows.1
#4 lore raw

Re: [PATCH v3 2/4] meson: Fixes jemalloc and tcmalloc can not building.

Hi, LIBS is going away soon. I have a few more Meson patches including one for tcmalloc and jemalloc, I won't post them super soon though.

Paolo

Il lun 7 set 2020, 21:50 Yonggang Luo <[email protected]> ha scritto:

Quoted 68 lines

Currently, the LIBS are not exposed to meson and meson didn't use that Use base_lib = declare_dependency(link_args: config_host['LIBS'].split()) to force use it

---
 configure   | 9 +++++++++
 meson.build | 5 ++++-
 2 files changed, 13 insertions(+), 1 deletion(-)
configure +9 -0
index 823756f4a4..7b2f3d64b0 100755
@@ -7245,6 +7245,14 @@ if test "$libxml2" = "yes" ; then
   echo "LIBXML2_LIBS=$libxml2_libs" >> $config_host_mak
 fi
 
+if test "$tcmalloc" = "yes" ; then
+  echo "CONFIG_TCMALLOC=y" >> $config_host_mak
+fi
+
+if test "$jemalloc" = "yes" ; then
+  echo "CONFIG_JEMALLOC=y" >> $config_host_mak
+fi
+
 if test "$replication" = "yes" ; then
   echo "CONFIG_REPLICATION=y" >> $config_host_mak
 fi
@@ -7416,6 +7424,7 @@ echo "PKG_CONFIG=$pkg_config_exe" >> $config_host_mak
 echo "WINDRES=$windres" >> $config_host_mak
 echo "CFLAGS=$CFLAGS" >> $config_host_mak
 echo "CFLAGS_NOPIE=$CFLAGS_NOPIE" >> $config_host_mak
+echo "LIBS=$LIBS" >> $config_host_mak
 echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
 echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak
 echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak
meson.build +4 -1
index 5421eca66a..6e909213ee 100644
@@ -116,6 +116,9 @@ endif
 # grandfathered in from the QEMU Makefiles.
 add_project_arguments(config_host['GLIB_CFLAGS'].split(),
                       native: false, language: ['c', 'cpp', 'objc'])
+
+base_lib = declare_dependency(link_args: config_host['LIBS'].split())
+
 glib = declare_dependency(link_args: config_host['GLIB_LIBS'].split())
 gio = not_found
 if 'CONFIG_GIO' in config_host
@@ -818,7 +821,7 @@ util_ss.add_all(trace_ss)
 util_ss = util_ss.apply(config_all, strict: false)
 libqemuutil = static_library('qemuutil',
                              sources: util_ss.sources() +
 stub_ss.sources() + genh,
-                             dependencies: [util_ss.dependencies(), m,
 glib, socket])
+                             dependencies: [util_ss.dependencies(), m,
 base_lib, glib, socket])

qemuutil = declare_dependency(link_with: libqemuutil,
sources: genh + version_res)

--
2.28.0.windows.1

#5 lore raw

Re: [PATCH v3 2/4] meson: Fixes jemalloc and tcmalloc can not building.

Quoted 3 lines · Paolo Bonzini

Hi, LIBS is going away soon. I have a few more Meson patches including one for tcmalloc and jemalloc, I won't post them super soon though.

OK, then I'll skip this

Quoted 74 lines

Paolo

Il lun 7 set 2020, 21:50 Yonggang Luo <[email protected]> ha scritto:

Quoted 69 lines

Currently, the LIBS are not exposed to meson and meson didn't use that Use base_lib = declare_dependency(link_args: config_host['LIBS'].split()) to force use it

---
 configure   | 9 +++++++++
 meson.build | 5 ++++-
 2 files changed, 13 insertions(+), 1 deletion(-)
configure +8 -0
index 823756f4a4..7b2f3d64b0 100755
@@ -7245,6 +7245,14 @@ if test "$libxml2" = "yes" ; then
   echo "LIBXML2_LIBS=$libxml2_libs" >> $config_host_mak
 fi
 
+if test "$tcmalloc" = "yes" ; then
+  echo "CONFIG_TCMALLOC=y" >> $config_host_mak
+fi
+
+if test "$jemalloc" = "yes" ; then
+  echo "CONFIG_JEMALLOC=y" >> $config_host_mak
+fi
+
 if test "$replication" = "yes" ; then
   echo "CONFIG_REPLICATION=y" >> $config_host_mak
 fi
@@ -7416,6 +7424,7 @@ echo "PKG_CONFIG=$pkg_config_exe" >>

$config_host_mak
echo "WINDRES=$windres" >> $config_host_mak echo "CFLAGS=$CFLAGS" >> $config_host_mak echo "CFLAGS_NOPIE=$CFLAGS_NOPIE" >> $config_host_mak

configure +1 -0
+echo "LIBS=$LIBS" >> $config_host_mak
 echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
 echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak
 echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak
meson.build +4 -1
index 5421eca66a..6e909213ee 100644
@@ -116,6 +116,9 @@ endif
 # grandfathered in from the QEMU Makefiles.
 add_project_arguments(config_host['GLIB_CFLAGS'].split(),
                       native: false, language: ['c', 'cpp', 'objc'])
+
+base_lib = declare_dependency(link_args: config_host['LIBS'].split())
+
 glib = declare_dependency(link_args: config_host['GLIB_LIBS'].split())
 gio = not_found
 if 'CONFIG_GIO' in config_host
@@ -818,7 +821,7 @@ util_ss.add_all(trace_ss)
 util_ss = util_ss.apply(config_all, strict: false)
 libqemuutil = static_library('qemuutil',
                              sources: util_ss.sources() +
 stub_ss.sources() + genh,
-                             dependencies: [util_ss.dependencies(), m,
 glib, socket])
+                             dependencies: [util_ss.dependencies(), m,
 base_lib, glib, socket])

qemuutil = declare_dependency(link_with: libqemuutil,
sources: genh + version_res)

--
2.28.0.windows.1

Signature · 6 lines
         此致
礼
罗勇刚
Yours
    sincerely,
Yonggang Luo
#6 lore raw

PATCH v3 3/4 meson: remove empty else and duplicated gio deps

In reply to Yonggang Luo
---
 meson.build | 6 ------
 1 file changed, 6 deletions(-)
meson.build +0 -6
index 6e909213ee..d6a1949b2f 100644
@@ -320,7 +320,6 @@ opengl = not_found
 if 'CONFIG_OPENGL' in config_host
   opengl = declare_dependency(compile_args: config_host['OPENGL_CFLAGS'].split(),
                               link_args: config_host['OPENGL_LIBS'].split())
-else
 endif
 gtk = not_found
 if 'CONFIG_GTK' in config_host
@@ -347,11 +346,6 @@ if 'CONFIG_ICONV' in config_host
   iconv = declare_dependency(compile_args: config_host['ICONV_CFLAGS'].split(),
                              link_args: config_host['ICONV_LIBS'].split())
 endif
-gio = not_found
-if 'CONFIG_GIO' in config_host
-  gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(),
-                           link_args: config_host['GIO_LIBS'].split())
-endif
 vnc = not_found
 png = not_found
 jpeg = not_found
Signature · 1 line
2.28.0.windows.1
#7 lore raw

PATCH v3 4/4 vmstate: Enable test-vmstate on all platform:

In reply to Yonggang Luo
---
 tests/meson.build | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
tests/meson.build +1 -3
index 7f27a15cee..39fa822be3 100644
@@ -185,11 +185,9 @@ if have_system
     'test-timed-average': [],
     'test-util-sockets': ['socket-helpers.c'],
     'test-base64': [],
+    'test-vmstate': [migration, io],
     'test-bufferiszero': [],
   }
-  if 'CONFIG_POSIX' in config_host
-    tests += {'test-vmstate': [migration, io]}
-  endif
   if 'CONFIG_INOTIFY1' in config_host
     tests += {'test-util-filemonitor': []}
   endif
Signature · 1 line
2.28.0.windows.1
Reviewed-by on v3 4/4
#8 lore raw

Re: [PATCH v3 4/4] vmstate: Enable test-vmstate on all platform:

Quoted 1 line · Yonggang Luo

Trailing ':' in subject, otherwise:

Quoted 22 lines
---
 tests/meson.build | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
tests/meson.build +1 -3
index 7f27a15cee..39fa822be3 100644
@@ -185,11 +185,9 @@ if have_system
     'test-timed-average': [],
     'test-util-sockets': ['socket-helpers.c'],
     'test-base64': [],
+    'test-vmstate': [migration, io],
     'test-bufferiszero': [],
   }
-  if 'CONFIG_POSIX' in config_host
-    tests += {'test-vmstate': [migration, io]}
-  endif
   if 'CONFIG_INOTIFY1' in config_host
     tests += {'test-util-filemonitor': []}
   endif