W32, W64 patches
Subsystems (2)
cover W32, W64 patches
It first introduce msys2 CI on cirrus by fixes nfs, capstone, curses and disable partial test-char tests.
And then fixes a number of unit tests failure on msys2/mingw
Yonggang Luo (16):
block: Fixes nfs compiling error on msys2/mingw
ci: fixes msys2 build by upgrading capstone to 4.0.2
configure: Fixes ncursesw detection under msys2/mingw and enable
curses
curses: Fixes curses compiling errors.
tests: disable /char/stdio/* tests in test-char.c on win32
ci: Enable msys2 ci in cirrus
tests: Trying fixes test-replication.c on msys2/mingw.
block: get file-win32.c handle locking option consistence with
file-posix.c
osdep: These function are only available on Non-Win32 system.
meson: Use -b to ignore CR vs. CR-LF issues on Windows
meson: disable crypto tests are empty under win32
meson: remove empty else and duplicated gio deps
vmstate: Fixes test-vmstate.c on msys2/mingw
cirrus: Building freebsd in a single short
logging: Fixes memory leak in test-logging.c
rcu: add uninit destructor for rcu
.cirrus.yml | 59 ++++++++++++++++------------- block/file-win32.c | 23 ++++++++++- block/nfs.c | 26 ++++++++----- capstone | 2 +- configure | 11 ++---- include/qemu/osdep.h | 2 +- include/qemu/rcu.h | 5 +++ meson.build | 6 --- scripts/ci/windows/msys2-build.sh | 28 ++++++++++++++ scripts/ci/windows/msys2-install.sh | 33 ++++++++++++++++ tests/meson.build | 3 +- tests/qapi-schema/meson.build | 2 +- tests/test-char.c | 4 ++ tests/test-logging.c | 4 +- tests/test-replication.c | 13 +++++-- tests/test-vmstate.c | 2 +- ui/curses.c | 14 +++---- util/rcu.c | 37 +++++++++++++++++- 18 files changed, 205 insertions(+), 69 deletions(-) create mode 100644 scripts/ci/windows/msys2-build.sh create mode 100644 scripts/ci/windows/msys2-install.sh
Signature · 1 line
2.28.0.windows.1
PATCH 1/16 block: Fixes nfs compiling error on msys2/mingw
These compiling errors are fixed:../block/nfs.c:27:10: fatal error: poll.h: No such file or directory
27 | #include <poll.h>
| ^~~~~~~~
compilation terminated.
../block/nfs.c:63:5: error: unknown type name 'blkcnt_t'
63 | blkcnt_t st_blocks;
| ^~~~~~~~../block/nfs.c: In function 'nfs_client_open':../block/nfs.c:550:27: error: 'struct _stat64' has no member named 'st_blocks'
550 | client->st_blocks = st.st_blocks;
| ^../block/nfs.c: In function 'nfs_get_allocated_file_size':../block/nfs.c:751:41: error: 'struct _stat64' has no member named 'st_blocks'
751 | return (task.ret < 0 ? task.ret : st.st_blocks * 512);
| ^../block/nfs.c: In function 'nfs_reopen_prepare':../block/nfs.c:805:31: error: 'struct _stat64' has no member named 'st_blocks'
805 | client->st_blocks = st.st_blocks;
| ^../block/nfs.c: In function 'nfs_get_allocated_file_size':../block/nfs.c:752:1: error: control reaches end of non-void function [-Werror=return-type]
752 | }
| ^
On msys2/mingw, there is no st_blocks in struct _stat64, so we use consistence st_size instead.
--- block/nfs.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-)
block/nfs.c +17 -9
@@ -24,7 +24,9 @@#include "qemu/osdep.h" +#if !defined(_WIN32)#include <poll.h> +#endif #include "qemu/config-file.h" #include "qemu/error-report.h" #include "qapi/error.h"
@@ -51,6 +53,12 @@#define QEMU_NFS_MAX_PAGECACHE_SIZE (8388608 / NFS_BLKSIZE)#define QEMU_NFS_MAX_DEBUG_LEVEL 2 +#if defined (_WIN32) +#define nfs_stat __stat64 +#else +#define nfs_stat stat +#endif + typedef struct NFSClient { struct nfs_context *context; struct nfsfh *fh;
@@ -58,7 +66,7 @@ typedef struct NFSClient {bool has_zero_init;AioContext *aio_context;QemuMutex mutex; -blkcnt_t st_blocks; +int64_t st_size;bool cache_used;NFSServer *server;char *path;
@@ -70,7 +78,7 @@ typedef struct NFSRPC {int ret;int complete;QEMUIOVector *iov; -struct stat *st; +struct nfs_stat *st;Coroutine *co;NFSClient *client; }NFSRPC ;
@@ -419,7 +427,7 @@ static int64_t nfs_client_open(NFSClient *client, BlockdevOptionsNfs *opts, int flags, int open_flags, Error **errp) { int64_t ret = -EINVAL; -struct stat st; +struct nfs_stat st;char *file =NULL , *strp =NULL ;qemu_mutex_init (&client->mutex);
@@ -545,7 +553,7 @@ static int64_t nfs_client_open(NFSClient *client, BlockdevOptionsNfs *opts, } ret =DIV_ROUND_UP (st.st_size,BDRV_SECTOR_SIZE ); - client->st_blocks = st.st_blocks; + client->st_size = st.st_size; client->has_zero_init =S_ISREG (st.st_mode); *strp ='/' ; goto out;
@@ -729,11 +737,11 @@ static int64_t nfs_get_allocated_file_size(BlockDriverState *bs) {NFSClient *client = bs->opaque;NFSRPC task = {0 }; -struct stat st; +struct nfs_stat st;if (bdrv_is_read_only (bs) && !(bs->open_flags &BDRV_O_NOCACHE )) { -return client->st_blocks *512 ; +return client->st_size; } task.bs = bs;
@@ -746,7 +754,7 @@ static int64_t nfs_get_allocated_file_size(BlockDriverState *bs)nfs_set_events (client);BDRV_POLL_WHILE (bs, !task.complete); -return (task.ret <0 ? task.ret : st.st_blocks *512 ); +return (task.ret <0 ? task.ret : st.st_size); }static int coroutine_fn
@@ -778,7 +786,7 @@ static int nfs_reopen_prepare(BDRVReopenState *state, BlockReopenQueue *queue, Error **errp) {NFSClient *client = state->bs->opaque; -struct stat st; +struct nfs_stat st;int ret =0 ;if (state->flags &BDRV_O_RDWR &&bdrv_is_read_only (state->bs)) {
@@ -800,7 +808,7 @@ static int nfs_reopen_prepare(BDRVReopenState *state, nfs_get_error(client->context));return ret; } - client->st_blocks = st.st_blocks; + client->st_size = st.st_size; }return 0 ;
Signature · 1 line
2.28.0.windows.1
PATCH 2/16 ci: fixes msys2 build by upgrading capstone to 4.0.2
In reply to Yonggang LuoThe currently random version capstone have the following compiling issue:
CC /c/work/xemu/qemu/build/slirp/src/arp_table.o
make[1]: *** No rule to make target “/c/work/xemu/qemu/build/capstone/capstone.lib”。 Stop.
Subproject commit 1d230532840a37ac032c6ab80128238fc930c6c1 are the tagged version 4.0.2 when upgrading to this version, the folder structure of include are changed to qemu\capstone\include
│ platform.h │ ├─capstone │ arm.h │ arm64.h │ capstone.h │ evm.h │ m680x.h │ m68k.h │ mips.h │ platform.h │ ppc.h │ sparc.h │ systemz.h │ tms320c64x.h │ x86.h │ xcore.h │ └─windowsce
intrin.h
stdint.h
in capstone. so we need add extra include path -I${source_path}/capstone/include/capstone for directly #include <capstone.h>, and the exist include path should preserve, because in capstone code there something like #include "capstone/capstone.h"
--- capstone | 2 +- configure | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
capstone +1 -1
@@ -1 +1 @@ -Subproject commit 22ead3e0bfdb87516656453336160e0a37b066bf +Subproject commit 1d230532840a37ac032c6ab80128238fc930c6c1
configure +1 -1
@@ -5156,7 +5156,7 @@ case "$capstone" in LIBCAPSTONE=libcapstone.a fi capstone_libs="-Lcapstone -lcapstone" - capstone_cflags="-I${source_path}/capstone/include" + capstone_cflags="-I${source_path}/capstone/include -I${source_path}/capstone/include/capstone" ;; system)
Signature · 1 line
2.28.0.windows.1
Re: [PATCH 02/16] ci: fixes msys2 build by upgrading capstone to 4.0.2
Quoted 6 lines · Yonggang Luo
The currently random version capstone have the following compiling issue:
CC /c/work/xemu/qemu/build/slirp/src/arp_table.o
make[1]: *** No rule to make target “/c/work/xemu/qemu/build/capstone/capstone.lib”。 Stop.Subproject commit
1d230532840a37ac032c6ab80128238fc930c6c1are the tagged version 4.0.2
Richard H says that last time we tried to move the capstone submodule forward there were "all sorts of random portability problems across old/odd systems", so this is probably likely to have issues when it gets tested on other systems.
thanks
-- PMm
Re: [PATCH 02/16] ci: fixes msys2 build by upgrading capstone to 4.0.2
Quoted 7 lines · Peter Maydell
Quoted 4 lines · Yonggang Luo
The currently random version capstone have the following compiling issue:
CC /c/work/xemu/qemu/build/slirp/src/arp_table.o
make[1]: *** No rule to make target“/c/work/xemu/qemu/build/capstone/capstone.lib”。 Stop.
Quoted 1 line
Quoted 8 lines
Quoted 1 line
Subproject commit
1d230532840a37ac032c6ab80128238fc930c6c1are thetagged version 4.0.2
Richard H says that last time we tried to move the capstone submodule forward there were "all sorts of random portability problems across old/odd systems", so this is probably likely to have issues when it gets tested on other systems.
Which system specifically, maybe they are dropped now or we can convert capstone to meson?
Quoted 4 lines
thanks
-- PMm
Signature · 6 lines
此致
礼
罗勇刚
Yours
sincerely,
Yonggang LuoPATCH 3/16 configure: Fixes ncursesw detection under msys2/mingw and enable curses
In reply to Yonggang LuoThe mingw pkg-config are showing following absolute path and contains : as the separator, so we must handling : properly.
-D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC:/CI-Tools/msys64/mingw64/include/ncursesw:-I/usr/include/ncursesw:
-DNCURSES_WIDECHAR -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC -pipe -lncursesw -lgnurx -ltre -lintl -liconv -DNCURSES_WIDECHAR -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC -lncursesw -DNCURSES_WIDECHAR -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC -lcursesw
-DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -pipe -lncursesw -lgnurx -ltre -lintl -liconv -DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -lncursesw
-DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -lcursesw
-DNCURSES_WIDECHAR -I/usr/include/ncursesw -pipe -lncursesw -lgnurx -ltre -lintl -liconv -DNCURSES_WIDECHAR -I/usr/include/ncursesw -lncursesw
-DNCURSES_WIDECHAR -I/usr/include/ncursesw -lcursesw
msys2/mingw lacks the POSIX-required langinfo.h.
gcc test.c -DNCURSES_WIDECHAR -I/mingw64/include/ncursesw -pipe -lncursesw -lgnurx -ltre -lintl -liconv test.c:4:10: fatal error: langinfo.h: No such file or directory
4 | #include <langinfo.h>
| ^~~~~~~~~~~~
compilation terminated.
So we using g_get_codeset instead of nl_langinfo(CODESET)
--- configure | 9 +++------ ui/curses.c | 10 +++++----- 2 files changed, 8 insertions(+), 11 deletions(-)
configure +3 -6
@@ -3653,8 +3653,8 @@ if test "$iconv" = "no" ; then fi if test "$curses" != "no" ; then if test "$mingw32" = "yes" ; then - curses_inc_list="$($pkg_config --cflags ncurses 2>/dev/null):" - curses_lib_list="$($pkg_config --libs ncurses 2>/dev/null):-lpdcurses" + curses_inc_list="$($pkg_config --cflags ncursesw 2>/dev/null):-I/${MSYSTEM,,}/include/ncursesw:" + curses_lib_list="$($pkg_config --libs ncursesw 2>/dev/null):-lncursesw" else curses_inc_list="$($pkg_config --cflags ncursesw 2>/dev/null):-I/usr/include/ncursesw:" curses_lib_list="$($pkg_config --libs ncursesw 2>/dev/null):-lncursesw:-lcursesw"
@@ -3664,17 +3664,14 @@ if test "$curses" != "no" ; then #include <locale.h> #include <curses.h> #include <wchar.h> -#include <langinfo.h> int main(void) { - const char *codeset; wchar_t wch = L'w'; setlocale(LC_ALL, ""); resize_term(0, 0); addwstr(L"wide chars\n"); addnwstr(&wch, 1); add_wch(WACS_DEGREE); - codeset = nl_langinfo(CODESET); - return codeset != 0; + return 0; } EOF IFS=:
ui/curses.c +5 -5
@@ -30,7 +30,6 @@#endif #include <locale.h> #include <wchar.h> -#include <langinfo.h> #include <iconv.h> #include "qapi/error.h"
@@ -526,6 +525,7 @@ static void font_setup(void)iconv_t nativecharset_to_ucs2;iconv_t font_conv;int i; + g_autofree gchar *local_codeset = g_get_codeset();/* * Control characters are normally non-printable, but VGA does have
@@ -566,14 +566,14 @@ static void font_setup(void)0x25bc }; - ucs2_to_nativecharset =iconv_open (nl_langinfo (CODESET ),"UCS-2" ); + ucs2_to_nativecharset =iconv_open (local_codeset,"UCS-2" );if (ucs2_to_nativecharset == (iconv_t) -1 ) {fprintf (stderr,"Could not convert font glyphs from UCS-2: '%s'\n" ,strerror (errno));exit (1 ); } - nativecharset_to_ucs2 =iconv_open ("UCS-2" ,nl_langinfo (CODESET )); + nativecharset_to_ucs2 =iconv_open ("UCS-2" , local_codeset);if (nativecharset_to_ucs2 == (iconv_t) -1 ) {iconv_close (ucs2_to_nativecharset); fprintf(stderr, "Could not convert font glyphs to UCS-2: '%s'\n",
@@ -581,7 +581,7 @@ static void font_setup(void)exit (1 ); } - font_conv =iconv_open (nl_langinfo (CODESET ), font_charset); + font_conv =iconv_open (local_codeset, font_charset);if (font_conv == (iconv_t) -1 ) {iconv_close (ucs2_to_nativecharset);iconv_close (nativecharset_to_ucs2);
@@ -602,7 +602,7 @@ static void font_setup(void)/* DEL */ convert_ucs (0x7F ,0x2302 , ucs2_to_nativecharset); -if (strcmp (nl_langinfo (CODESET ),"UTF-8" )) { +if (strcmp (local_codeset,"UTF-8" )) {/* Non-Unicode capable, use termcap equivalents for those available */ for (i =0 ; i <=0xFF ; i++) {wchar_t wch[CCHARW_MAX ];
Signature · 1 line
2.28.0.windows.1
Re: [PATCH 03/16] configure: Fixes ncursesw detection under msys2/mingw and enable curses
Quoted 22 lines · Yonggang Luo
The mingw pkg-config are showing following absolute path and contains : as the separator, so we must handling : properly.
(quoted diff) +0
-10-D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC:/CI-Tools/msys64/mingw64/include/ncursesw:-I/usr/include/ncursesw: -DNCURSES_WIDECHAR -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC -pipe -lncursesw -lgnurx -ltre -lintl -liconv -DNCURSES_WIDECHAR -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC -lncursesw -DNCURSES_WIDECHAR -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC -lcursesw -DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -pipe -lncursesw -lgnurx -ltre -lintl -liconv -DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -lncursesw -DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -lcursesw -DNCURSES_WIDECHAR -I/usr/include/ncursesw -pipe -lncursesw -lgnurx -ltre -lintl -liconv -DNCURSES_WIDECHAR -I/usr/include/ncursesw -lncursesw -DNCURSES_WIDECHAR -I/usr/include/ncursesw -lcurseswmsys2/mingw lacks the POSIX-required
langinfo.h.gcc
test.c-DNCURSES_WIDECHAR -I/mingw64/include/ncursesw -pipe -lncursesw -lgnurx -ltre -lintl -liconv test.c:4:10: fatal error:langinfo.h: No such file or directory
4 | #include <langinfo.h>
| ^~~~~~~~~~~~
compilation terminated.
Quoted 3 lines
So we using
g_get_codesetinstead ofnl_langinfo(CODESET)Signed-off-by Yonggang Luo <[email protected]>
PATCH 4/16 curses: Fixes curses compiling errors.
In reply to Yonggang LuoThis is the compiling error:../ui/curses.c: In function 'curses_refresh':../ui/curses.c:256:5: error: 'next_maybe_keycode' may be used uninitialized in this function [-Werror=maybe-uninitialized]
256 | curses2foo(_curses2keycode, _curseskey2keycode, chr, maybe_keycode)
| ^~~~~~~~~~
../ui/curses.c:302:32: note: 'next_maybe_keycode' was declared here
302 | enum maybe_keycode next_maybe_keycode;
| ^~~~~~~~~~~~~~~~~~
../ui/curses.c:256:5: error: 'maybe_keycode' may be used uninitialized in this function [-Werror=maybe-uninitialized]
256 | curses2foo(_curses2keycode, _curseskey2keycode, chr, maybe_keycode)
| ^~~~~~~~~~
../ui/curses.c:265:24: note: 'maybe_keycode' was declared here
265 | enum maybe_keycode maybe_keycode;
| ^~~~~~~~~~~~~cc1.exe: all warnings being treated as errors
--- ui/curses.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
ui/curses.c +2 -2
@@ -262,7 +262,7 @@ static int curses2foo(const int _curses2foo[], const int _curseskey2foo[],static void curses_refresh (DisplayChangeListener *dcl) {int chr, keysym, keycode, keycode_alt; -enum maybe_keycode maybe_keycode; +enum maybe_keycode maybe_keycode =CURSES_KEYCODE ;curses_winch_check ();
@@ -299,7 +299,7 @@ static void curses_refresh(DisplayChangeListener *dcl)/* alt or esc key */ if (keycode ==1 ) { -enum maybe_keycode next_maybe_keycode; +enum maybe_keycode next_maybe_keycode =CURSES_KEYCODE ;int nextchr =console_getch (&next_maybe_keycode);if (nextchr !=-1 ) {
Signature · 1 line
2.28.0.windows.1
Re: [PATCH 04/16] curses: Fixes curses compiling errors.
Quoted 14 lines · Yonggang Luo
This is the compiling error:
../ui/curses.c: In function 'curses_refresh':../ui/curses.c:256:5: error: 'next_maybe_keycode' may be used uninitialized in this function [-Werror=maybe-uninitialized]256 | curses2foo(_curses2keycode, _curseskey2keycode, chr, maybe_keycode) | ^~~~~~~~~~ ../ui/curses.c:302:32: note: 'next_maybe_keycode' was declared here 302 | enum maybe_keycode next_maybe_keycode; | ^~~~~~~~~~~~~~~~~~ ../ui/curses.c:256:5: error: 'maybe_keycode' may be used uninitialized in this function [-Werror=maybe-uninitialized] 256 | curses2foo(_curses2keycode, _curseskey2keycode, chr, maybe_keycode) | ^~~~~~~~~~ ../ui/curses.c:265:24: note: 'maybe_keycode' was declared here 265 | enum maybe_keycode maybe_keycode; | ^~~~~~~~~~~~~
Quoted 3 lines
cc1.exe: all warnings being treated as errors
Signed-off-by Yonggang Luo <[email protected]>
PATCH 5/16 tests: disable /char/stdio/* tests in test-char.c on win32
In reply to Yonggang LuoThese tests are blocking test-char to be finished.
--- tests/test-char.c | 4 ++++ 1 file changed, 4 insertions(+)
tests/test-char.c +4 -0
@@ -103,6 +103,7 @@ static void char_console_test(void)g_test_trap_assert_stdout ("CONSOLE" ); }#endif +#ifndef _WIN32static void char_stdio_test_subprocess (void ) {Chardev *chr;
@@ -126,6 +127,7 @@ static void char_stdio_test(void)g_test_trap_assert_passed (); g_test_trap_assert_stdout("buf"); } +#endif static void char_ringbuf_test (void ) {
@@ -1471,8 +1473,10 @@ int main(int argc, char **argv)g_test_add_func ("/char/console/subprocess" , char_console_test_subprocess);g_test_add_func ("/char/console" , char_console_test);#endif +#ifndef _WIN32g_test_add_func ("/char/stdio/subprocess" , char_stdio_test_subprocess);g_test_add_func ("/char/stdio" , char_stdio_test); +#endif #ifndef _WIN32g_test_add_func ("/char/pipe" , char_pipe_test);#endif
Signature · 1 line
2.28.0.windows.1
Re: [PATCH 05/16] tests: disable /char/stdio/* tests in test-char.c on win32
Quoted 28 lines · Yonggang Luo
These tests are blocking test-char to be finished.
Signed-off-by Yonggang Luo <[email protected]>--- tests/test-char.c | 4 ++++ 1 file changed, 4 insertions(+)tests/test-char.c +2
-0@@ -103,6 +103,7 @@ static void char_console_test(void)g_test_trap_assert_stdout ("CONSOLE" ); }#endif +#ifndef _WIN32static void char_stdio_test_subprocess (void ) {Chardev *chr;@@ -126,6 +127,7 @@ static void char_stdio_test(void)g_test_trap_assert_passed (); g_test_trap_assert_stdout("buf"); } +#endif static void char_ringbuf_test (void ) {
tests/test-char.c int main(int argc, char **argv) · line 1482
Quoted 10 lines
tests/test-char.c +2
-0@@ -1471,8 +1473,10 @@ int main(int argc, char **argv)g_test_add_func ("/char/console/subprocess" , char_console_test_subprocess);g_test_add_func ("/char/console" , char_console_test);#endif +#ifndef _WIN32g_test_add_func ("/char/stdio/subprocess" , char_stdio_test_subprocess);g_test_add_func ("/char/stdio" , char_stdio_test); +#endif #ifndef _WIN32g_test_add_func ("/char/pipe" , char_pipe_test);#endif
I think you could rather simply replace the three #ifndef _WIN32 sections with only one?
Thomas
Re: [PATCH 05/16] tests: disable /char/stdio/* tests in test-char.c on win32
Quoted 36 lines · Thomas Huth
Quoted 28 lines · Yonggang Luo
These tests are blocking test-char to be finished.
Signed-off-by Yonggang Luo <[email protected]>--- tests/test-char.c | 4 ++++ 1 file changed, 4 insertions(+)tests/test-char.c +2
-0@@ -103,6 +103,7 @@ static void char_console_test(void)g_test_trap_assert_stdout ("CONSOLE" ); }#endif +#ifndef _WIN32static void char_stdio_test_subprocess (void ) {Chardev *chr;@@ -126,6 +127,7 @@ static void char_stdio_test(void)g_test_trap_assert_passed (); g_test_trap_assert_stdout("buf"); } +#endif static void char_ringbuf_test (void ) {tests/test-char.c int main(int argc, char **argv) · line 1473
Quoted 1 line
tests/test-char.c +0
-0@@ -1471,8 +1473,10 @@ int main(int argc, char **argv) g_test_add_func("/char/console/subprocess",
char_console_test_subprocess);tests/test-char.c int main(int argc, char **argv)
Quoted 4 lines
tests/test-char.c +1
-0g_test_add_func ("/char/console" , char_console_test);#endif +#ifndef _WIN32 g_test_add_func("/char/stdio/subprocess",
char_stdio_test_subprocess);
Quoted 9 lines
tests/test-char.c int main(int argc, char **argv) · line 1482
Quoted 5 lines
tests/test-char.c +1
-0g_test_add_func ("/char/stdio" , char_stdio_test); +#endif #ifndef _WIN32g_test_add_func ("/char/pipe" , char_pipe_test);#endif I think you could rather simply replace the three #ifndef
_WIN32sections with only one?
That's easy, I am wondering if /char/stdio are able works under win32? And also the /char/pipe, anyway disable it first, trying it latter
Quoted 4 lines
Thomas
Signature · 6 lines
此致
礼
罗勇刚
Yours
sincerely,
Yonggang LuoPATCH 6/16 ci: Enable msys2 ci in cirrus
In reply to Yonggang LuoInstall msys2 in a proper way refer to https://github.com/cirruslabs/cirrus-ci-docs/issues/699
The https://wiki.qemu.org/Hosts/W32#Native_builds_with_MSYS2 need to be updated. There is no need of --cross-prefix, open mingw64.exe instead of msys2.exe then we don't need the --cross-prefix, besides we using environment variable settings:
MSYS: winsymlinks:nativestrict
MSYSTEM: MINGW64
CHERE_INVOKING: 1
to opening mingw64 native shell.
We now running tests with make -i check to skip tests errors.
--- .cirrus.yml | 24 +++++++++++++++++++++ scripts/ci/windows/msys2-build.sh | 28 ++++++++++++++++++++++++ scripts/ci/windows/msys2-install.sh | 33 +++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 scripts/ci/windows/msys2-build.sh create mode 100644 scripts/ci/windows/msys2-install.sh
.cirrus.yml +24 -0
@@ -63,3 +63,27 @@ macos_xcode_task: --enable-werror --cc=clang || { cat config.log; exit 1; } - gmake -j$(sysctl -n hw.ncpu) - gmake check + +windows_msys2_task: + windows_container: + image: cirrusci/windowsservercore:cmake + os_version: 2019 + cpu: 8 + memory: 8G + env: + MSYS: winsymlinks:nativestrict + MSYSTEM: MINGW64 + CHERE_INVOKING: 1 + printenv_script: + - C:\tools\msys64\usr\bin\bash.exe -lc 'printenv' + install_script: + - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools && curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz" + - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools && curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig" + - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools && pacman -U --noconfirm msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz" + - C:\tools\msys64\usr\bin\bash.exe -lc "pacman -Sy --noconfirm" + - C:\tools\msys64\usr\bin\bash.exe -lc "pacman --needed --noconfirm -S bash pacman pacman-mirrors msys2-runtime" + - taskkill /F /IM gpg-agent.exe + - C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Su" + - C:\tools\msys64\usr\bin\bash.exe -lc "sh scripts/ci/windows/msys2-install.sh" + script: + - C:\tools\msys64\usr\bin\bash.exe -lc "sh scripts/ci/windows/msys2-build.sh"
scripts/ci/windows/msys2-build.sh new file +28 -0
@@ -0,0 +1,28 @@ +mkdir build +cd build +../configure \ +--python=python3 \ +--ninja=ninja \ +--enable-stack-protector \ +--enable-guest-agent \ +--disable-pie \ +--enable-gnutls --enable-nettle \ +--enable-sdl --enable-sdl-image --enable-gtk --disable-vte --enable-curses --enable-iconv \ +--enable-vnc --enable-vnc-sasl --enable-vnc-jpeg --enable-vnc-png \ +--enable-slirp=git \ +--disable-brlapi --enable-curl \ +--enable-fdt \ +--disable-kvm --enable-hax --enable-whpx \ +--enable-libnfs --enable-libusb --enable-live-block-migration --enable-usb-redir \ +--enable-lzo --enable-snappy --enable-bzip2 --enable-zstd \ +--enable-membarrier --enable-coroutine-pool \ +--enable-libssh --enable-libxml2 \ +--enable-jemalloc --enable-avx2 \ +--enable-replication \ +--enable-tools \ +--enable-bochs --enable-cloop --enable-dmg --enable-qcow1 --enable-vdi --enable-vvfat --enable-qed --enable-parallels \ +--enable-sheepdog \ +--enable-capstone=git + +make -j$NUMBER_OF_PROCESSORS +make -i -j$NUMBER_OF_PROCESSORS check
scripts/ci/windows/msys2-install.sh new file +33 -0
@@ -0,0 +1,33 @@ +pacman --noconfirm -S --needed \ +base-devel \ +git \ +mingw-w64-x86_64-python \ +mingw-w64-x86_64-python-setuptools \ +mingw-w64-x86_64-toolchain \ +mingw-w64-x86_64-SDL2 \ +mingw-w64-x86_64-SDL2_image \ +mingw-w64-x86_64-gtk3 \ +mingw-w64-x86_64-glib2 \ +mingw-w64-x86_64-ninja \ +mingw-w64-x86_64-make \ +mingw-w64-x86_64-jemalloc \ +mingw-w64-x86_64-lzo2 \ +mingw-w64-x86_64-zstd \ +mingw-w64-x86_64-libjpeg-turbo \ +mingw-w64-x86_64-pixman \ +mingw-w64-x86_64-libgcrypt \ +mingw-w64-x86_64-capstone \ +mingw-w64-x86_64-libpng \ +mingw-w64-x86_64-libssh \ +mingw-w64-x86_64-libxml2 \ +mingw-w64-x86_64-snappy \ +mingw-w64-x86_64-libusb \ +mingw-w64-x86_64-usbredir \ +mingw-w64-x86_64-libtasn1 \ +mingw-w64-x86_64-libnfs \ +mingw-w64-x86_64-nettle \ +mingw-w64-x86_64-cyrus-sasl \ +mingw-w64-x86_64-curl \ +mingw-w64-x86_64-gnutls \ +mingw-w64-x86_64-zstd \ +
Signature · 1 line
2.28.0.windows.1
Re: [PATCH 06/16] ci: Enable msys2 ci in cirrus
Quoted 72 lines · Yonggang Luo
Install msys2 in a proper way refer to https://github.com/cirruslabs/cirrus-ci-docs/issues/699
The https://wiki.qemu.org/Hosts/W32#Native_builds_with_MSYS2 need to be updated. There is no need of --cross-prefix, open mingw64.exe instead of msys2.exe then we don't need the --cross-prefix, besides we using environment variable settings:
MSYS: winsymlinks:nativestrict
MSYSTEM: MINGW64
CHERE_INVOKING: 1
to opening mingw64 native shell.
We now running tests with make -i check to skip tests errors.Signed-off-by Yonggang Luo <[email protected]>--- .cirrus.yml | 24 +++++++++++++++++++++ scripts/ci/windows/msys2-build.sh | 28 ++++++++++++++++++++++++ scripts/ci/windows/msys2-install.sh | 33 +++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 scripts/ci/windows/msys2-build.sh create mode 100644 scripts/ci/windows/msys2-install.sh.cirrus.yml +24
-0@@ -63,3 +63,27 @@ macos_xcode_task: --enable-werror --cc=clang || { cat config.log; exit 1; } - gmake -j$(sysctl -n hw.ncpu) - gmake check + +windows_msys2_task: + windows_container: + image: cirrusci/windowsservercore:cmake + os_version: 2019 + cpu: 8 + memory: 8G + env: + MSYS: winsymlinks:nativestrict + MSYSTEM: MINGW64 + CHERE_INVOKING: 1 + printenv_script: + - C:\tools\msys64\usr\bin\bash.exe -lc 'printenv' + install_script: + - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools && curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz" + - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools && curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig" + - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools && pacman -U --noconfirm msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz" + - C:\tools\msys64\usr\bin\bash.exe -lc "pacman -Sy --noconfirm" + - C:\tools\msys64\usr\bin\bash.exe -lc "pacman --needed --noconfirm -S bash pacman pacman-mirrors msys2-runtime" + - taskkill /F /IM gpg-agent.exe + - C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Su" + - C:\tools\msys64\usr\bin\bash.exe -lc "sh scripts/ci/windows/msys2-install.sh" + script: + - C:\tools\msys64\usr\bin\bash.exe -lc "sh scripts/ci/windows/msys2-build.sh"scripts/ci/windows/msys2-build.sh new file +15
-0@@ -0,0 +1,28 @@ +mkdir build +cd build +../configure \ +--python=python3 \ +--ninja=ninja \ +--enable-stack-protector \ +--enable-guest-agent \ +--disable-pie \ +--enable-gnutls --enable-nettle \ +--enable-sdl --enable-sdl-image --enable-gtk --disable-vte --enable-curses --enable-iconv \ +--enable-vnc --enable-vnc-sasl --enable-vnc-jpeg --enable-vnc-png \ +--enable-slirp=git \ +--disable-brlapi --enable-curl \ +--enable-fdt \ +--disable-kvm --enable-hax --enable-whpx \
scripts/ci/windows/msys2-build.sh line 25
Quoted 10 lines
scripts/ci/windows/msys2-build.sh new file +10
-0+--enable-libnfs --enable-libusb --enable-live-block-migration --enable-usb-redir \ +--enable-lzo --enable-snappy --enable-bzip2 --enable-zstd \ +--enable-membarrier --enable-coroutine-pool \ +--enable-libssh --enable-libxml2 \ +--enable-jemalloc --enable-avx2 \ +--enable-replication \ +--enable-tools \ +--enable-bochs --enable-cloop --enable-dmg --enable-qcow1 --enable-vdi --enable-vvfat --enable-qed --enable-parallels \ +--enable-sheepdog \ +--enable-capstone=git
Why do we need to have all these disable/enable args ? AFAIK, configure
should just "do the right thing" and automatically detect and enable libraries which are present in the environment.
Te intent is that a bare "configure" should complete successfully on all supported platforms. Ff something breaks at build time, that is generally considered a bug in the configure script as it should automatically disable any features that are broken on a given platform.
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Re: [PATCH 06/16] ci: Enable msys2 ci in cirrus
Quoted 104 lines · Daniel P. Berrangé
Quoted 1 line · Yonggang Luo
Install msys2 in a proper way refer to
https://github.com/cirruslabs/cirrus-ci-docs/issues/699
Quoted 1 line
The https://wiki.qemu.org/Hosts/W32#Native_builds_with_MSYS2 need to be
updated.
Quoted 1 line
There is no need of --cross-prefix, open mingw64.exe instead of
msys2.exe then we don't
Quoted 21 lines
need the --cross-prefix, besides we using environment variable settings:
MSYS: winsymlinks:nativestrict
MSYSTEM: MINGW64
CHERE_INVOKING: 1
to opening mingw64 native shell.
We now running tests with make -i check to skip tests errors.Signed-off-by Yonggang Luo <[email protected]>--- .cirrus.yml | 24 +++++++++++++++++++++ scripts/ci/windows/msys2-build.sh | 28 ++++++++++++++++++++++++ scripts/ci/windows/msys2-install.sh | 33 +++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 scripts/ci/windows/msys2-build.sh create mode 100644 scripts/ci/windows/msys2-install.sh.cirrus.yml +0
-0.cirrus.yml macos_xcode_task: · line 63
Quoted 1 line
.cirrus.yml +0
-0@@ -63,3 +63,27 @@ macos_xcode_task: --enable-werror --cc=clang || { cat config.log; exit1; }
Quoted 7 lines
.cirrus.yml +5
-0- gmake -j$(sysctl -n hw.ncpu) - gmake check + +windows_msys2_task: + windows_container: + image: cirrusci/windowsservercore:cmake + os_version: 2019.cirrus.yml macos_xcode_task:
Quoted 10 lines
.cirrus.yml +10
-0+ cpu: 8 + memory: 8G + env: + MSYS: winsymlinks:nativestrict + MSYSTEM: MINGW64 + CHERE_INVOKING: 1 + printenv_script: + - C:\tools\msys64\usr\bin\bash.exe -lc 'printenv' + install_script: + - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools && curl -Ohttp://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz
".cirrus.yml macos_xcode_task: · line 81
Quoted 1 line
.cirrus.yml +1
-0+ - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools && curl -Ohttp://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig
".cirrus.yml macos_xcode_task: · line 82
Quoted 1 line
.cirrus.yml +1
-0+ - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools && pacman -U--noconfirm msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz"
.cirrus.yml macos_xcode_task: · line 84
Quoted 2 lines
.cirrus.yml +2
-0+ - C:\tools\msys64\usr\bin\bash.exe -lc "pacman -Sy --noconfirm" + - C:\tools\msys64\usr\bin\bash.exe -lc "pacman --needed --noconfirm-S bash pacman pacman-mirrors msys2-runtime"
.cirrus.yml macos_xcode_task:
Quoted 3 lines
.cirrus.yml +3
-0+ - taskkill /F /IM gpg-agent.exe + - C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Su" + - C:\tools\msys64\usr\bin\bash.exe -lc "sh
scripts/ci/windows/msys2-install.sh".cirrus.yml macos_xcode_task: · line 89
Quoted 2 lines
.cirrus.yml +2
-0+ script: + - C:\tools\msys64\usr\bin\bash.exe -lc "sh
scripts/ci/windows/msys2-build.sh"Review
Quoted 1 line
(quoted diff) +0
-0
b/scripts/ci/windows/msys2-build.shQuoted 5 lines
new file mode 100644
index 0000000000..d9d046b5b0scripts/ci/windows/msys2-build.sh line 10
Quoted 10 lines
scripts/ci/windows/msys2-build.sh new file +10
-0@@ -0,0 +1,28 @@ +mkdir build +cd build +../configure \ +--python=python3 \ +--ninja=ninja \ +--enable-stack-protector \ +--enable-guest-agent \ +--disable-pie \ +--enable-gnutls --enable-nettle \ +--enable-sdl --enable-sdl-image --enable-gtk --disable-vte--enable-curses --enable-iconv \
scripts/ci/windows/msys2-build.sh
Quoted 6 lines
scripts/ci/windows/msys2-build.sh new file +6
-0+--enable-vnc --enable-vnc-sasl --enable-vnc-jpeg --enable-vnc-png \ +--enable-slirp=git \ +--disable-brlapi --enable-curl \ +--enable-fdt \ +--disable-kvm --enable-hax --enable-whpx \ +--enable-libnfs --enable-libusb --enable-live-block-migration--enable-usb-redir \
scripts/ci/windows/msys2-build.sh
Quoted 7 lines
scripts/ci/windows/msys2-build.sh new file +7
-0+--enable-lzo --enable-snappy --enable-bzip2 --enable-zstd \ +--enable-membarrier --enable-coroutine-pool \ +--enable-libssh --enable-libxml2 \ +--enable-jemalloc --enable-avx2 \ +--enable-replication \ +--enable-tools \ +--enable-bochs --enable-cloop --enable-dmg --enable-qcow1 --enable-vdi--enable-vvfat --enable-qed --enable-parallels \
scripts/ci/windows/msys2-build.sh line 25
Quoted 2 lines
scripts/ci/windows/msys2-build.sh new file +2
-0+--enable-sheepdog \ +--enable-capstone=gitWhy do we need to have all these disable/enable args ? AFAIK, configure
should just "do the right thing" and automatically detect and enable libraries which are present in the environment.
Quoted 6 lines
Te intent is that a bare "configure" should complete successfully on all supported platforms. Ff something breaks at build time, that is generally considered a bug in the configure script as it should automatically
disable any features that are broken on a given platform.
Gotcha, I'll leave only configure latter, currently I use this to detect which msys2 package not installed yet.
Quoted 13 lines
Regards,
Daniel
--
|: https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-
https://fstop138.berrange.com :|
|: https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|
Signature · 6 lines
此致
礼
罗勇刚
Yours
sincerely,
Yonggang LuoRe: [PATCH 06/16] ci: Enable msys2 ci in cirrus
Quoted 107 lines · 罗勇刚(Yonggang Luo)
Quoted 104 lines · Daniel P. Berrangé
Quoted 1 line · Yonggang Luo
Install msys2 in a proper way refer to
https://github.com/cirruslabs/cirrus-ci-docs/issues/699
Quoted 1 line
The https://wiki.qemu.org/Hosts/W32#Native_builds_with_MSYS2 need to be
updated.
Quoted 1 line
There is no need of --cross-prefix, open mingw64.exe instead of
msys2.exe then we don't
Quoted 21 lines
need the --cross-prefix, besides we using environment variable settings:
MSYS: winsymlinks:nativestrict
MSYSTEM: MINGW64
CHERE_INVOKING: 1
to opening mingw64 native shell.
We now running tests with make -i check to skip tests errors.Signed-off-by Yonggang Luo <[email protected]>--- .cirrus.yml | 24 +++++++++++++++++++++ scripts/ci/windows/msys2-build.sh | 28 ++++++++++++++++++++++++ scripts/ci/windows/msys2-install.sh | 33 +++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 scripts/ci/windows/msys2-build.sh create mode 100644 scripts/ci/windows/msys2-install.sh.cirrus.yml +0
-0.cirrus.yml macos_xcode_task: · line 63
Quoted 1 line
.cirrus.yml +0
-0@@ -63,3 +63,27 @@ macos_xcode_task: --enable-werror --cc=clang || { cat config.log; exit1; }
Quoted 7 lines
.cirrus.yml +5
-0- gmake -j$(sysctl -n hw.ncpu) - gmake check + +windows_msys2_task: + windows_container: + image: cirrusci/windowsservercore:cmake + os_version: 2019.cirrus.yml macos_xcode_task:
Quoted 10 lines
.cirrus.yml +10
-0+ cpu: 8 + memory: 8G + env: + MSYS: winsymlinks:nativestrict + MSYSTEM: MINGW64 + CHERE_INVOKING: 1 + printenv_script: + - C:\tools\msys64\usr\bin\bash.exe -lc 'printenv' + install_script: + - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools && curl -Ohttp://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz
".cirrus.yml macos_xcode_task: · line 81
Quoted 1 line
.cirrus.yml +1
-0+ - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools && curl -Ohttp://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig
".cirrus.yml macos_xcode_task: · line 82
Quoted 1 line
.cirrus.yml +1
-0+ - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools && pacman -U--noconfirm msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz"
.cirrus.yml macos_xcode_task: · line 84
Quoted 2 lines
.cirrus.yml +2
-0+ - C:\tools\msys64\usr\bin\bash.exe -lc "pacman -Sy --noconfirm" + - C:\tools\msys64\usr\bin\bash.exe -lc "pacman --needed --noconfirm-S bash pacman pacman-mirrors msys2-runtime"
.cirrus.yml macos_xcode_task:
Quoted 3 lines
.cirrus.yml +3
-0+ - taskkill /F /IM gpg-agent.exe + - C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Su" + - C:\tools\msys64\usr\bin\bash.exe -lc "sh
scripts/ci/windows/msys2-install.sh".cirrus.yml macos_xcode_task: · line 89
Quoted 2 lines
.cirrus.yml +2
-0+ script: + - C:\tools\msys64\usr\bin\bash.exe -lc "sh
scripts/ci/windows/msys2-build.sh"Review
Quoted 1 line
(quoted diff) +0
-0
b/scripts/ci/windows/msys2-build.shQuoted 5 lines
new file mode 100644
index 0000000000..d9d046b5b0scripts/ci/windows/msys2-build.sh line 10
Quoted 10 lines
scripts/ci/windows/msys2-build.sh new file +10
-0@@ -0,0 +1,28 @@ +mkdir build +cd build +../configure \ +--python=python3 \ +--ninja=ninja \ +--enable-stack-protector \ +--enable-guest-agent \ +--disable-pie \ +--enable-gnutls --enable-nettle \ +--enable-sdl --enable-sdl-image --enable-gtk --disable-vte--enable-curses --enable-iconv \
scripts/ci/windows/msys2-build.sh
Quoted 6 lines
scripts/ci/windows/msys2-build.sh new file +6
-0+--enable-vnc --enable-vnc-sasl --enable-vnc-jpeg --enable-vnc-png \ +--enable-slirp=git \ +--disable-brlapi --enable-curl \ +--enable-fdt \ +--disable-kvm --enable-hax --enable-whpx \ +--enable-libnfs --enable-libusb --enable-live-block-migration--enable-usb-redir \
scripts/ci/windows/msys2-build.sh
Quoted 7 lines
scripts/ci/windows/msys2-build.sh new file +7
-0+--enable-lzo --enable-snappy --enable-bzip2 --enable-zstd \ +--enable-membarrier --enable-coroutine-pool \ +--enable-libssh --enable-libxml2 \ +--enable-jemalloc --enable-avx2 \ +--enable-replication \ +--enable-tools \ +--enable-bochs --enable-cloop --enable-dmg --enable-qcow1 --enable-vdi--enable-vvfat --enable-qed --enable-parallels \
scripts/ci/windows/msys2-build.sh line 25
Quoted 2 lines
scripts/ci/windows/msys2-build.sh new file +2
-0+--enable-sheepdog \ +--enable-capstone=gitWhy do we need to have all these disable/enable args ? AFAIK, configure
should just "do the right thing" and automatically detect and enable libraries which are present in the environment.
Quoted 8 lines
Quoted 6 lines
Te intent is that a bare "configure" should complete successfully on all supported platforms. Ff something breaks at build time, that is generally considered a bug in the configure script as it should automatically
disable any features that are broken on a given platform.Gotcha, I'll leave only configure latter, currently I use this to detect which msys2 package not installed yet.
With all those args removed, there's no real reason for this separate shell script. Just put the configure && make commands dirctly in the cirrus.yml file, similar to the other builds in that file.
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
PATCH 7/16 tests: Trying fixes test-replication.c on msys2/mingw.
In reply to Yonggang LuoOn Windows there is no path like /tmp/s_local_disk.XXXXXX
--- tests/test-replication.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
tests/test-replication.c +9 -4
@@ -23,14 +23,14 @@/* primary */ #define P_ID "primary-id" -static char p_local_disk[] ="/tmp/p_local_disk.XXXXXX" ; +static char p_local_disk[PATH_MAX ];/* secondary */ #define S_ID "secondary-id"#define S_LOCAL_DISK_ID "secondary-local-disk-id" -static char s_local_disk[] ="/tmp/s_local_disk.XXXXXX" ; -static char s_active_disk[] ="/tmp/s_active_disk.XXXXXX" ; -static char s_hidden_disk[] ="/tmp/s_hidden_disk.XXXXXX" ; +static char s_local_disk[PATH_MAX ]; +static char s_active_disk[PATH_MAX ]; +static char s_hidden_disk[PATH_MAX ];/* FIXME: steal from blockdev.c */ QemuOptsList qemu_drive_opts = {
@@ -571,6 +571,11 @@ static void setup_sigabrt_handler(void)int main (int argc,char **argv) {int ret; +const char *tmpdir =g_get_tmp_dir (); +snprintf (p_local_disk,sizeof (p_local_disk),"%s/p_local_disk.XXXXXX" , tmpdir); +snprintf (s_local_disk,sizeof (s_local_disk),"%s/s_local_disk.XXXXXX" , tmpdir); +snprintf (s_active_disk,sizeof (s_active_disk),"%s/s_active_disk.XXXXXX" , tmpdir); +snprintf (s_hidden_disk,sizeof (s_hidden_disk),"%s/s_hidden_disk.XXXXXX" , tmpdir);qemu_init_main_loop (&error_fatal);bdrv_init ();
Signature · 1 line
2.28.0.windows.1
Re: [PATCH 07/16] tests: Trying fixes test-replication.c on msys2/mingw.
Quoted 31 lines · Yonggang Luo
On Windows there is no path like
/tmp/s_local_disk.XXXXXXSigned-off-by Yonggang Luo <[email protected]>--- tests/test-replication.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)tests/test-replication.c +4
-4@@ -23,14 +23,14 @@/* primary */ #define P_ID "primary-id" -static char p_local_disk[] ="/tmp/p_local_disk.XXXXXX" ; +static char p_local_disk[PATH_MAX ];/* secondary */ #define S_ID "secondary-id"#define S_LOCAL_DISK_ID "secondary-local-disk-id" -static char s_local_disk[] ="/tmp/s_local_disk.XXXXXX" ; -static char s_active_disk[] ="/tmp/s_active_disk.XXXXXX" ; -static char s_hidden_disk[] ="/tmp/s_hidden_disk.XXXXXX" ; +static char s_local_disk[PATH_MAX ]; +static char s_active_disk[PATH_MAX ]; +static char s_hidden_disk[PATH_MAX ];/* FIXME: steal from blockdev.c */ QemuOptsList qemu_drive_opts = {
tests/test-replication.c static void setup_sigabrt_handler(void) · line 578
Quoted 8 lines
tests/test-replication.c +5
-0@@ -571,6 +571,11 @@ static void setup_sigabrt_handler(void)int main (int argc,char **argv) {int ret; +const char *tmpdir =g_get_tmp_dir (); +snprintf (p_local_disk,sizeof (p_local_disk),"%s/p_local_disk.XXXXXX" , tmpdir); +snprintf (s_local_disk,sizeof (s_local_disk),"%s/s_local_disk.XXXXXX" , tmpdir); +snprintf (s_active_disk,sizeof (s_active_disk),"%s/s_active_disk.XXXXXX" , tmpdir); +snprintf (s_hidden_disk,sizeof (s_hidden_disk),"%s/s_hidden_disk.XXXXXX" , tmpdir);
Don't use PATH_MAX and snprintf. Please use g_strdup_printf() as suggested already in previous reviews.
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
PATCH 8/16 block: get file-win32.c handle locking option consistence with file-posix.c
In reply to Yonggang Luo--- block/file-win32.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
block/file-win32.c +21 -2
@@ -299,6 +299,11 @@ static QemuOptsList raw_runtime_opts = { .type = QEMU_OPT_STRING, .help = "host AIO implementation (threads, native)", }, + { + .name = "locking", + .type = QEMU_OPT_STRING, + .help = "file locking mode (on/off/auto, default: auto)", + }, {/* end of list */ } }, };
@@ -334,6 +339,7 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags,const char *filename;bool use_aio;int ret; +OnOffAuto locking; s->type =FTYPE_FILE ;
@@ -342,11 +348,24 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags, ret = -EINVAL ; goto fail; } - -if (qdict_get_try_bool (options,"locking" , false)) { + locking =qapi_enum_parse (&OnOffAuto_lookup, +qemu_opt_get (opts,"locking" ), +ON_OFF_AUTO_AUTO , &local_err); +if (local_err) { +error_propagate (errp, local_err); + ret = -EINVAL ; + goto fail; + } +switch (locking) { +case ON_OFF_AUTO_ON :error_setg (errp,"locking=on is not supported on Windows" ); ret = -EINVAL ; goto fail; +case ON_OFF_AUTO_OFF : +case ON_OFF_AUTO_AUTO : +break ; +default : +g_assert_not_reached (); } filename =qemu_opt_get (opts,"filename" );
Signature · 1 line
2.28.0.windows.1
Re: [PATCH 08/16] block: get file-win32.c handle locking option consistence with file-posix.c
Am 08.09.2020 um 21:48 hat Yonggang Luo geschrieben:
Quoted 4 lines
Signed-off-by Yonggang Luo <[email protected]>--- block/file-win32.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
This is almost the same as my separately posted 'file-win32: Fix "locking" option', except that you changed the order of variable definitions which will cause a merge conflict.
When you take patches from other people, you should correctly attribute them and not make them look as if they were your own.
Commit messages should not be empty, but explain the motivation for the change.
In this case, dropping the patch is easiest because my patch is already in a pull request and will probably be merged soon.
Kevin
Re: [PATCH 08/16] block: get file-win32.c handle locking option consistence with file-posix.c
Quoted 10 lines · Kevin Wolf
Am 08.09.2020 um 21:48 hat Yonggang Luo geschrieben:
Quoted 4 lines
Signed-off-by Yonggang Luo <[email protected]>--- block/file-win32.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)This is almost the same as my separately posted 'file-win32: Fix "locking" option', except that you changed the order of variable definitions which will cause a merge conflict.
Quoted 6 lines
When you take patches from other people, you should correctly attribute them and not make them look as if they were your own.
Commit messages should not be empty, but explain the motivation for the change.
I know someone else have already have fixes for it, so I didn't detail it much, Ineed
I wanna skip it when sending patches, but git-publish.py didn't handle it well under Win32 yet
Quoted 4 lines
In this case, dropping the patch is easiest because my patch is already in a pull request and will probably be merged soon.
I am waiting it to merged, at the current stage, if I don't include this patch the
test runner will fail.
Quoted 4 lines
Kevin
Signature · 6 lines
此致
礼
罗勇刚
Yours
sincerely,
Yonggang LuoRe: [PATCH 08/16] block: get file-win32.c handle locking option consistence with file-posix.c
Am 09.09.2020 um 10:41 hat 罗勇刚(Yonggang Luo) geschrieben:
Quoted 23 lines · Kevin Wolf
Quoted 11 lines
Am 08.09.2020 um 21:48 hat Yonggang Luo geschrieben:
Quoted 4 lines
Signed-off-by Yonggang Luo <[email protected]>--- block/file-win32.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)This is almost the same as my separately posted 'file-win32: Fix "locking" option', except that you changed the order of variable definitions which will cause a merge conflict.
Quoted 6 lines
When you take patches from other people, you should correctly attribute them and not make them look as if they were your own.
Commit messages should not be empty, but explain the motivation for the change.
I know someone else have already have fixes for it, so I didn't detail it much, Ineed I wanna skip it when sending patches, but
git-publish.pydidn't handle it well under Win32 yetQuoted 1 line
Quoted 5 lines
Quoted 2 lines
In this case, dropping the patch is easiest because my patch is already in a pull request and will probably be merged soon.
I am waiting it to merged, at the current stage, if I don't include this patch the test runner will fail.
I see. This is not obvious to others and it will look like you want to get the patch included as you sent it.
What I do in situations like this is that I put any patches from other series first in my branch and then send out only what is on top of them, noting the dependency in the cover letter.
Kevin
PATCH 9/16 osdep: These function are only available on Non-Win32 system.
In reply to Yonggang Luoint qemu_lock_fd(int fd, int64_t start, int64_t len, bool exclusive); int qemu_unlock_fd(int fd, int64_t start, int64_t len);
int qemu_lock_fd_test(int fd, int64_t start, int64_t len, bool exclusive); bool qemu_has_ofd_lock(void);
--- include/qemu/osdep.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/qemu/osdep.h +1 -1
@@ -502,11 +502,11 @@ int qemu_close(int fd);int qemu_unlink (const char *name);#ifndef _WIN32int qemu_dup (int fd); -#endif int qemu_lock_fd (int fd,int64_t start,int64_t len,bool exclusive);int qemu_unlock_fd (int fd,int64_t start,int64_t len);int qemu_lock_fd_test (int fd,int64_t start,int64_t len,bool exclusive);bool qemu_has_ofd_lock (void ); +#endif #if defined(__HAIKU__) && defined(__i386__)#define FMT_pid "%ld"
Signature · 1 line
2.28.0.windows.1
PATCH 10/16 meson: Use -b to ignore CR vs. CR-LF issues on Windows
In reply to Yonggang LuoOn windows, a difference in line endings causes testsuite failures complaining that every single line in files such as 'tests/qapi-schemadoc-good.texi' is wrong. Fix it by adding -b to diff.
--- tests/qapi-schema/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qapi-schema/meson.build +1 -1
@@ -220,6 +220,6 @@ qapi_doc = custom_target('QAPI doc', # "full_path()" needed here to work around # https://github.com/mesonbuild/meson/issues/7585 -test('QAPI doc', diff, args: ['-u', files('doc-good.texi'), qapi_doc[0].full_path()], +test('QAPI doc', diff, args: ['-b', '-u', files('doc-good.texi'), qapi_doc[0].full_path()], depends: qapi_doc, suite: ['qapi-schema', 'qapi-doc'])
Signature · 1 line
2.28.0.windows.1
PATCH 11/16 meson: disable crypto tests are empty under win32
In reply to Yonggang LuoDisable following tests on msys2/mingw
'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c',
tasn1, crypto],
'test-crypto-tlssession': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', 'crypto-tls-psk-helpers.c',
tasn1, crypto],
'test-io-channel-tls': ['io-channel-helpers.c', 'crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c',
tasn1, io, crypto]}--- tests/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tests/meson.build +2 -1
@@ -145,7 +145,8 @@ if have_block 'test-crypto-block': [io], } if 'CONFIG_GNUTLS' in config_host and \ - 'CONFIG_TASN1' in config_host + 'CONFIG_TASN1' in config_host and \ + 'CONFIG_POSIX' in config_host tests += { 'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', tasn1, crypto],
Signature · 1 line
2.28.0.windows.1
Re: [PATCH 11/16] meson: disable crypto tests are empty under win32
Quoted 19 lines · Yonggang Luo
Disable following tests on msys2/mingw
'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', tasn1, crypto], 'test-crypto-tlssession': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', 'crypto-tls-psk-helpers.c', tasn1, crypto], 'test-io-channel-tls': ['io-channel-helpers.c', 'crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', tasn1, io, crypto]}Signed-off-by Yonggang Luo <[email protected]>--- tests/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)tests/meson.build +0
-0
tests/meson.build if have_block · line 152
Quoted 9 lines
tests/meson.build +2
-1@@ -145,7 +145,8 @@ if have_block 'test-crypto-block': [io], } if 'CONFIG_GNUTLS' in config_host and \ - 'CONFIG_TASN1' in config_host + 'CONFIG_TASN1' in config_host and \ + 'CONFIG_POSIX' in config_host tests += { 'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', tasn1, crypto],
Re: [PATCH 11/16] meson: disable crypto tests are empty under win32
In reply to Yonggang LuoQuoted 7 lines · Yonggang Luo
Disable following tests on msys2/mingw
'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', tasn1, crypto], 'test-crypto-tlssession': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', 'crypto-tls-psk-helpers.c', tasn1, crypto], 'test-io-channel-tls': ['io-channel-helpers.c', 'crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', tasn1, io, crypto]}
Why ? GNUTLS is available on Windows and if it is enabled
at build time, then we should certainly be running the tests.
Quoted 24 lines
Signed-off-by Yonggang Luo <[email protected]>--- tests/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)tests/meson.build +2
-1@@ -145,7 +145,8 @@ if have_block 'test-crypto-block': [io], } if 'CONFIG_GNUTLS' in config_host and \ - 'CONFIG_TASN1' in config_host + 'CONFIG_TASN1' in config_host and \ + 'CONFIG_POSIX' in config_host tests += { 'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', tasn1, crypto],Signature · 1 line
2.28.0.windows.1
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Re: [PATCH 11/16] meson: disable crypto tests are empty under win32
Quoted 6 lines · Daniel P. Berrangé
Quoted 2 lines · Yonggang Luo
Disable following tests on msys2/mingw
'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c','
pkix_asn1_tab.c',Quoted 2 lines
tasn1, crypto], 'test-crypto-tlssession': ['crypto-tls-x509-helpers.c',
Quoted 9 lines
'
pkix_asn1_tab.c', 'crypto-tls-psk-helpers.c',Quoted 2 lines
tasn1, crypto], 'test-io-channel-tls': ['io-channel-helpers.c','
crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c',Quoted 1 line
tasn1, io, crypto]}Why ? GNUTLS is available on Windows and if it is enabled
at build time, then we should certainly be running the tests.
Don't know why., the header disable it totally. and it's requires CONFIG_TASN1, don't know if CONFIG_TASN1 works under win32
```
#ifndef TESTS_CRYPTO_TLS_X509_HELPERS_H
#define TESTS_CRYPTO_TLS_X509_HELPERS_H
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
#if !(defined WIN32) && \
defined(CONFIG_TASN1)
# define QCRYPTO_HAVE_TLS_TEST_SUPPORT
#endif
#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
# include <libtasn1.h>
```Quoted 38 lines
Quoted 12 lines
Signed-off-by Yonggang Luo <[email protected]>--- tests/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)tests/meson.build +0
-0tests/meson.build if have_block · line 151
Quoted 8 lines
tests/meson.build +2
-1@@ -145,7 +145,8 @@ if have_block 'test-crypto-block': [io], } if 'CONFIG_GNUTLS' in config_host and \ - 'CONFIG_TASN1' in config_host + 'CONFIG_TASN1' in config_host and \ + 'CONFIG_POSIX' in config_host tests += { 'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c','
pkix_asn1_tab.c',Quoted 5 lines
tests/meson.build +0
-1tasn1, crypto], --2.28.0.windows.1
Regards,
Daniel
--
|: https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-
https://fstop138.berrange.com :|
|: https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|
Signature · 6 lines
此致
礼
罗勇刚
Yours
sincerely,
Yonggang LuoRe: [PATCH 11/16] meson: disable crypto tests are empty under win32
Quoted 12 lines · 罗勇刚(Yonggang Luo)
Quoted 9 lines · Daniel P. Berrangé
Quoted 2 lines · Yonggang Luo
Disable following tests on msys2/mingw
'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c','
pkix_asn1_tab.c',Quoted 2 lines
tasn1, crypto], 'test-crypto-tlssession': ['crypto-tls-x509-helpers.c','
pkix_asn1_tab.c', 'crypto-tls-psk-helpers.c',Quoted 2 lines
tasn1, crypto], 'test-io-channel-tls': ['io-channel-helpers.c',
Quoted 8 lines
Quoted 6 lines
'
crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c',Quoted 1 line
tasn1, io, crypto]}Why ? GNUTLS is available on Windows and if it is enabled
at build time, then we should certainly be running the tests.Don't know why., the header disable it totally.
Yes, I know the source disables it, because it creates various files and no effort has been made to use WIndows filename building code.
Given that it is already disabled in the source, why do we need to disable it a second time in meson.build ?
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Re: [PATCH 11/16] meson: disable crypto tests are empty under win32
Quoted 20 lines · Daniel P. Berrangé
Quoted 19 lines · 罗勇刚(Yonggang Luo)
Quoted 15 lines · Daniel P. Berrangé
Quoted 2 lines · Yonggang Luo
Disable following tests on msys2/mingw
'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c','
pkix_asn1_tab.c',Quoted 2 lines
tasn1, crypto], 'test-crypto-tlssession': ['crypto-tls-x509-helpers.c','
pkix_asn1_tab.c', 'crypto-tls-psk-helpers.c',Quoted 2 lines
tasn1, crypto], 'test-io-channel-tls': ['io-channel-helpers.c','
crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c',Quoted 1 line
tasn1, io, crypto]}Why ? GNUTLS is available on Windows and if it is enabled
at build time, then we should certainly be running the tests.
Quoted 9 lines
Quoted 1 line
Don't know why., the header disable it totally.
Yes, I know the source disables it, because it creates various files and no effort has been made to use WIndows filename building code.
Given that it is already disabled in the source, why do we need to disable it a second time in meson.build ?
Because when there is no testcase ,the test runner would complain ERROR - missing test plan
Quoted 12 lines
Regards,
Daniel
--
|: https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-
https://fstop138.berrange.com :|
|: https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|
Signature · 6 lines
此致
礼
罗勇刚
Yours
sincerely,
Yonggang LuoRe: [PATCH 11/16] meson: disable crypto tests are empty under win32
Quoted 29 lines · 罗勇刚(Yonggang Luo)
Quoted 26 lines · Daniel P. Berrangé
Quoted 12 lines · 罗勇刚(Yonggang Luo)
Quoted 9 lines · Daniel P. Berrangé
Quoted 2 lines · Yonggang Luo
Disable following tests on msys2/mingw
'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c','
pkix_asn1_tab.c',Quoted 2 lines
tasn1, crypto], 'test-crypto-tlssession': ['crypto-tls-x509-helpers.c','
pkix_asn1_tab.c', 'crypto-tls-psk-helpers.c',Quoted 2 lines
tasn1, crypto], 'test-io-channel-tls': ['io-channel-helpers.c',Quoted 8 lines
Quoted 6 lines
'
crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c',Quoted 1 line
tasn1, io, crypto]}Why ? GNUTLS is available on Windows and if it is enabled
at build time, then we should certainly be running the tests.Don't know why., the header disable it totally.
Yes, I know the source disables it, because it creates various files and no effort has been made to use WIndows filename building code.
Quoted 5 lines
Quoted 3 lines
Given that it is already disabled in the source, why do we need to disable it a second time in meson.build ?
Because when there is no testcase ,the test runner would complain ERROR - missing test plan
Ok, please say that in the commit message to explain why the change is needed.
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
PATCH 12/16 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
@@ -317,7 +317,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
@@ -344,11 +343,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
PATCH 13/16 vmstate: Fixes test-vmstate.c on msys2/mingw
In reply to Yonggang LuoThe vmstate are valid on win32, just need generate tmp path properly
--- tests/test-vmstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/test-vmstate.c +1 -1
@@ -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
Re: [PATCH 13/16] vmstate: Fixes test-vmstate.c on msys2/mingw
Quoted 22 lines · Yonggang Luo
The vmstate are valid on win32, just need generate tmp path properly
Signed-off-by Yonggang Luo <[email protected]>Reviewed-by Philippe Mathieu-Daudé <[email protected]>--- tests/test-vmstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/test-vmstate.c +0
-1@@ -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;
tests/test-vmstate.c static void test_tmp_struct(void) · line 1492
Quoted 7 lines
tests/test-vmstate.c +1
-0@@ -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 );
PATCH 14/16 cirrus: Building freebsd in a single short
In reply to Yonggang Luofreebsd 1 hour limit not hit anymore
--- .cirrus.yml | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-)
.cirrus.yml +8 -27
@@ -1,38 +1,19 @@ env: CIRRUS_CLONE_DEPTH: 1 -freebsd_1st_task: +freebsd_12_task: freebsd_instance: image_family: freebsd-12-1 - cpu: 4 - memory: 4G - install_script: ASSUME_ALWAYS_YES=yes pkg bootstrap -f ; pkg install -y - bash curl cyrus-sasl git glib gmake gnutls gsed - nettle perl5 pixman pkgconf png usbredir + cpu: 8 + memory: 8G + install_script: + - ASSUME_ALWAYS_YES=yes pkg bootstrap -f ; + - pkg install -y bash curl cyrus-sasl git glib gmake gnutls gsed + nettle perl5 pixman pkgconf png usbredir script: - mkdir build - cd build - - ../configure --disable-user --target-list-exclude='alpha-softmmu - ppc64-softmmu ppc-softmmu riscv32-softmmu riscv64-softmmu s390x-softmmu - sparc64-softmmu sparc-softmmu x86_64-softmmu i386-softmmu' - --enable-werror || { cat config.log; exit 1; } - - gmake -j$(sysctl -n hw.ncpu) - - gmake -j$(sysctl -n hw.ncpu) check - -freebsd_2nd_task: - freebsd_instance: - image_family: freebsd-12-1 - cpu: 4 - memory: 4G - install_script: ASSUME_ALWAYS_YES=yes pkg bootstrap -f ; pkg install -y - bash curl cyrus-sasl git glib gmake gnutls gtk3 gsed libepoxy mesa-libs - nettle perl5 pixman pkgconf png SDL2 usbredir - script: - - ./configure --enable-werror --target-list='alpha-softmmu ppc64-softmmu - ppc-softmmu riscv32-softmmu riscv64-softmmu s390x-softmmu - sparc64-softmmu sparc-softmmu x86_64-softmmu i386-softmmu - sparc-bsd-user sparc64-bsd-user x86_64-bsd-user i386-bsd-user' - || { cat config.log; exit 1; } + - ../configure --enable-werror || { cat config.log; exit 1; } - gmake -j$(sysctl -n hw.ncpu) - gmake -j$(sysctl -n hw.ncpu) check
Signature · 1 line
2.28.0.windows.1
Re: [PATCH 14/16] cirrus: Building freebsd in a single short
Quoted 1 line · Yonggang Luo
freebsd 1 hour limit not hit anymore
Why is this faster again? How long did the build take for you? If it's still close to 1h, I think we should keep the two jobs, to avoid that it is occasionally failing when the builder machines are a little bit slower...
Thomas
Re: [PATCH 14/16] cirrus: Building freebsd in a single short
In reply to Yonggang LuoQuoted 1 line · Yonggang Luo
freebsd 1 hour limit not hit anymore
How long does the combined job take with this change ? If it is within 10 minutes of the limit, then we still want the split, as transient changes in the CI system can push it over the limit making the test unreliable.
Quoted 61 lines
Signed-off-by Yonggang Luo <[email protected]>--- .cirrus.yml | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-).cirrus.yml +8
-27@@ -1,38 +1,19 @@ env: CIRRUS_CLONE_DEPTH: 1 -freebsd_1st_task: +freebsd_12_task: freebsd_instance: image_family: freebsd-12-1 - cpu: 4 - memory: 4G - install_script: ASSUME_ALWAYS_YES=yes pkg bootstrap -f ; pkg install -y - bash curl cyrus-sasl git glib gmake gnutls gsed - nettle perl5 pixman pkgconf png usbredir + cpu: 8 + memory: 8G + install_script: + - ASSUME_ALWAYS_YES=yes pkg bootstrap -f ; + - pkg install -y bash curl cyrus-sasl git glib gmake gnutls gsed + nettle perl5 pixman pkgconf png usbredir script: - mkdir build - cd build - - ../configure --disable-user --target-list-exclude='alpha-softmmu - ppc64-softmmu ppc-softmmu riscv32-softmmu riscv64-softmmu s390x-softmmu - sparc64-softmmu sparc-softmmu x86_64-softmmu i386-softmmu' - --enable-werror || { cat config.log; exit 1; } - - gmake -j$(sysctl -n hw.ncpu) - - gmake -j$(sysctl -n hw.ncpu) check - -freebsd_2nd_task: - freebsd_instance: - image_family: freebsd-12-1 - cpu: 4 - memory: 4G - install_script: ASSUME_ALWAYS_YES=yes pkg bootstrap -f ; pkg install -y - bash curl cyrus-sasl git glib gmake gnutls gtk3 gsed libepoxy mesa-libs - nettle perl5 pixman pkgconf png SDL2 usbredir - script: - - ./configure --enable-werror --target-list='alpha-softmmu ppc64-softmmu - ppc-softmmu riscv32-softmmu riscv64-softmmu s390x-softmmu - sparc64-softmmu sparc-softmmu x86_64-softmmu i386-softmmu - sparc-bsd-user sparc64-bsd-user x86_64-bsd-user i386-bsd-user' - || { cat config.log; exit 1; } + - ../configure --enable-werror || { cat config.log; exit 1; } - gmake -j$(sysctl -n hw.ncpu) - gmake -j$(sysctl -n hw.ncpu) checkSignature · 1 line
2.28.0.windows.1
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Re: [PATCH 14/16] cirrus: Building freebsd in a single short
Quoted 8 lines · Daniel P. Berrangé
Quoted 1 line · Yonggang Luo
freebsd 1 hour limit not hit anymore
How long does the combined job take with this change ? If it is within 10 minutes of the limit, then we still want the split, as transient changes in the CI system can push it over the limit making the test unreliable.
I think we going to a wrong direction, I think there is some tests a stall the test runner,
please look at
https://cirrus-ci.com/task/5110577531977728
When its running properly, the consumed time are little, but when tests running too long, look at the cpu
usage, the cpu usage are nearly zero. does't consuming time.
And look at
https://cirrus-ci.com/task/6119341601062912
If the tests running properly, the time consuming are little
We should not hide the error by split them
Quoted 79 lines
Quoted 12 lines
Signed-off-by Yonggang Luo <[email protected]>--- .cirrus.yml | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-).cirrus.yml +0
-0.cirrus.yml line 9
Quoted 10 lines
.cirrus.yml +1
-4@@ -1,38 +1,19 @@ env: CIRRUS_CLONE_DEPTH: 1 -freebsd_1st_task: +freebsd_12_task: freebsd_instance: image_family: freebsd-12-1 - cpu: 4 - memory: 4G - install_script: ASSUME_ALWAYS_YES=yes pkg bootstrap -f ; pkg install-y
.cirrus.yml
Quoted 13 lines
.cirrus.yml +6
-4- bash curl cyrus-sasl git glib gmake gnutls gsed - nettle perl5 pixman pkgconf png usbredir + cpu: 8 + memory: 8G + install_script: + - ASSUME_ALWAYS_YES=yes pkg bootstrap -f ; + - pkg install -y bash curl cyrus-sasl git glib gmake gnutls gsed + nettle perl5 pixman pkgconf png usbredir script: - mkdir build - cd build - - ../configure --disable-user --target-list-exclude='alpha-softmmu - ppc64-softmmu ppc-softmmu riscv32-softmmu riscv64-softmmus390x-softmmu
.cirrus.yml
Quoted 11 lines
.cirrus.yml +0
-11- sparc64-softmmu sparc-softmmu x86_64-softmmu i386-softmmu' - --enable-werror || { cat config.log; exit 1; } - - gmake -j$(sysctl -n hw.ncpu) - - gmake -j$(sysctl -n hw.ncpu) check - -freebsd_2nd_task: - freebsd_instance: - image_family: freebsd-12-1 - cpu: 4 - memory: 4G - install_script: ASSUME_ALWAYS_YES=yes pkg bootstrap -f ; pkg install-y
.cirrus.yml line 28
Quoted 1 line
.cirrus.yml +0
-1- bash curl cyrus-sasl git glib gmake gnutls gtk3 gsed libepoxymesa-libs
.cirrus.yml
Quoted 3 lines
.cirrus.yml +0
-3- nettle perl5 pixman pkgconf png SDL2 usbredir - script: - - ./configure --enable-werror --target-list='alpha-softmmuppc64-softmmu
Quoted 9 lines
.cirrus.yml +1
-5- ppc-softmmu riscv32-softmmu riscv64-softmmu s390x-softmmu - sparc64-softmmu sparc-softmmu x86_64-softmmu i386-softmmu - sparc-bsd-user sparc64-bsd-user x86_64-bsd-user i386-bsd-user' - || { cat config.log; exit 1; } + - ../configure --enable-werror || { cat config.log; exit 1; } - gmake -j$(sysctl -n hw.ncpu) - gmake -j$(sysctl -n hw.ncpu) check --Quoted 3 lines
2.28.0.windows.1
Regards,
Daniel
--
|: https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-
https://fstop138.berrange.com :|
|: https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|
Signature · 6 lines
此致
礼
罗勇刚
Yours
sincerely,
Yonggang LuoRe: [PATCH 14/16] cirrus: Building freebsd in a single short
Quoted 19 lines · 罗勇刚(Yonggang Luo)
Quoted 8 lines · Daniel P. Berrangé
Quoted 1 line · Yonggang Luo
freebsd 1 hour limit not hit anymore
How long does the combined job take with this change ? If it is within 10 minutes of the limit, then we still want the split, as transient changes in the CI system can push it over the limit making the test unreliable.
I think we going to a wrong direction, I think there is some tests a stall the test runner,
please look at
https://cirrus-ci.com/task/5110577531977728
When its running properly, the consumed time are little, but when tests running too long, look at the cpu
usage, the cpu usage are nearly zero. does't consuming time.
Quoted 6 lines
And look at
https://cirrus-ci.com/task/6119341601062912If the tests running properly, the time consuming are little
We should not hide the error by split them
Ok, please explain this in the commit message so reviewers know why the change is intentionally reverting the previous split.
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
PATCH 15/16 logging: Fixes memory leak in test-logging.c
In reply to Yonggang Luog_dir_make_tmp Returns the actual name used. This string should be freed with g_free() when not needed any longer and is is in the GLib file name encoding. In case of errors, NULL is returned and error will be set. Use g_autofree to free it properly
--- tests/test-logging.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/test-logging.c +1 -1
@@ -196,7 +196,7 @@ static void rmdir_full(gchar const *root)int main (int argc,char **argv) { -gchar *tmp_path =g_dir_make_tmp ("qemu-test-logging.XXXXXX" ,NULL ); + g_autofree gchar *tmp_path = g_dir_make_tmp("qemu-test-logging.XXXXXX", NULL);int rc;g_test_init (&argc, &argv,NULL );
Signature · 1 line
2.28.0.windows.1
PATCH 16/16 rcu: add uninit destructor for rcu
In reply to Yonggang LuoThis is necessary if the pending rcu calls are closing and removing temp files. This also provide a function
void rcu_wait_finished(void);
to fixes test-logging.c test failure on msys2/mingw.
On windows if the file doesn't closed, you can not remove it.
--- include/qemu/rcu.h | 5 +++++ tests/test-logging.c | 2 ++ util/rcu.c | 37 ++++++++++++++++++++++++++++++++++++- 3 files changed, 43 insertions(+), 1 deletion(-)
include/qemu/rcu.h +5 -0
@@ -124,6 +124,11 @@ extern void rcu_unregister_thread(void);extern void rcu_enable_atfork (void );extern void rcu_disable_atfork (void ); +/* +* Wait all rcu call executed and exit the rcu thread. +*/ +extern void rcu_wait_finished (void ); +struct rcu_head ;typedef void RCUCBFunc (struct rcu_head *head);
tests/test-logging.c +2 -0
@@ -210,6 +210,8 @@ int main(int argc, char **argv) tmp_path, test_logfile_lock); rc =g_test_run (); +qemu_log_close (); +rcu_wait_finished ();rmdir_full (tmp_path);g_free (tmp_path);
util/rcu.c +36 -1
@@ -308,10 +308,20 @@ void rcu_unregister_thread(void)qemu_mutex_unlock (&rcu_registry_lock); } +typedef struct QemuRcuMessage { +struct rcu_head rcu; +void *message; +}QemuRcuMessage ; + +static int rcu_thread_exit_called =0 ; +static int rcu_thread_exited =0 ; +static QemuRcuMessage rcu_thread_message; +static void rcu_init_complete (void ) {QemuThread thread; - +atomic_mb_set (&rcu_thread_exit_called,0 ); +atomic_mb_set (&rcu_thread_exited,0 );qemu_mutex_init (&rcu_registry_lock);qemu_mutex_init (&rcu_sync_lock);qemu_event_init (&rcu_gp_event, true);
@@ -327,6 +337,26 @@ static void rcu_init_complete(void)rcu_register_thread (); } +static void rcu_thread_exit (QemuRcuMessage *param) +{ +atomic_mb_set ((int *)param->message,1 ); +qemu_thread_exit (NULL ); +} + +void rcu_wait_finished (void ) +{ +if (atomic_xchg (&rcu_thread_exit_called,1 ) ==0 ) + { + rcu_thread_message.message = &rcu_thread_exited; +call_rcu (&rcu_thread_message, rcu_thread_exit, rcu); + } + +while (atomic_mb_read (&rcu_thread_exited) ==0 ) + { +g_usleep (10000 ); + } +} +static int atfork_depth =1 ;void rcu_enable_atfork (void )
@@ -379,3 +409,8 @@ static void __attribute__((__constructor__)) rcu_init(void)#endif rcu_init_complete (); } + +static void __attribute__((__destructor__))rcu_uninit (void ) +{ +rcu_wait_finished (); +}
Signature · 1 line
2.28.0.windows.1
Quoted 3 lines · Yonggang Luo
It first introduce msys2 CI on cirrus by fixes nfs, capstone, curses and disable partial test-char tests.
And then fixes a number of unit tests failure on msys2/mingw
Please remember to include a version number (v2, v3, ...) if this is an improved posting of an earlier revision of the patch series. 'git send-email -v2' does that automatically, for example.
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
Quoted 10 lines · Eric Blake
Quoted 3 lines · Yonggang Luo
It first introduce msys2 CI on cirrus by fixes nfs, capstone, curses and disable partial test-char tests.
And then fixes a number of unit tests failure on msys2/mingwPlease remember to include a version number (v2, v3, ...) if this is an improved posting of an earlier revision of the patch series. 'git send-email -v2' does that automatically, for example.
See that, I am using
git-publish.pyscript, next time it will comes with a
v2.
Quoted 6 lines
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
Signature · 6 lines
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo