[PATCH v9 00/26] W32, W64 msys2/mingw patches

Yonggang Luo posted 26 patches 3 years, 7 months ago
Test docker-quick@centos7 failed
Test docker-mingw@fedora failed
Test checkpatch failed
Test FreeBSD failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200915121318.247-1-luoyonggang@gmail.com
Maintainers: Kevin Wolf <kwolf@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, Ed Maste <emaste@freebsd.org>, Stefan Hajnoczi <stefanha@redhat.com>, Peter Lieven <pl@kamp.de>, Li-Wen Hsu <lwhsu@freebsd.org>, Max Reitz <mreitz@redhat.com>, Fam Zheng <fam@euphon.net>, Stefan Weil <sw@weilnetz.de>, "Daniel P. Berrangé" <berrange@redhat.com>
There is a newer version of this series
.cirrus.yml                      |  97 ++++++++++++++++++++--------
block/nfs.c                      |  37 +++++++++--
capstone                         |   2 +-
configure                        |  61 +++++-------------
include/qemu/osdep.h             |   2 +-
include/qemu/rcu.h               |   1 +
include/sysemu/os-win32.h        |   4 +-
meson                            |   2 +-
meson.build                      |   6 --
tests/crypto-tls-psk-helpers.c   |   6 +-
tests/crypto-tls-x509-helpers.c  | 106 ++++++++++++++++++++++++++++++-
tests/crypto-tls-x509-helpers.h  |   9 ++-
tests/qapi-schema/meson.build    |   2 +-
tests/test-char.c                |  26 +++++---
tests/test-crypto-tlscredsx509.c |  47 +++++++-------
tests/test-crypto-tlssession.c   |  68 +++++++++++---------
tests/test-io-channel-file.c     |  10 ++-
tests/test-io-channel-socket.c   |   2 +
tests/test-io-channel-tls.c      |  51 ++++++++-------
tests/test-logging.c             |   5 +-
tests/test-qdev-global-props.c   |   6 +-
tests/test-replication.c         |  22 +++++--
tests/test-util-sockets.c        |   6 +-
tests/test-vmstate.c             |   3 +-
ui/curses.c                      |  14 ++--
util/aio-win32.c                 |  11 +++-
util/oslib-win32.c               |   2 +-
util/rcu.c                       |  55 ++++++++++++++++
28 files changed, 460 insertions(+), 203 deletions(-)
[PATCH v9 00/26] W32, W64 msys2/mingw patches
Posted by Yonggang Luo 3 years, 7 months ago
V8-V9

* ci: Enable msys2 ci in cirrus
  do not install libnfs, libcapstone and jemalloc
  ident lines properly
  Do not install libnfs when the add the msys2 ci,

* Revert "configure: add --ninja option"
  Skip this revision

* block: Fixes nfs compiling error on msys2/mingw
  Use typedef long long blkcnt_t; for libnfs on msys2/mingw
  for futher implemenation, still disable nfs_get_allocated_file_size
  on win32 as it not working yet, but preserve the possibility implemenation
  it in futher

* gcrypt: test_tls_psk_init should write binary file instead text file.
  only fixes the file open mode parameter

* osdep: file locking functions are not available on Win32:
  Reword with "Do not declare the following locking functions on Win32:"

* meson: Use -b to ignore CR vs. CR-LF issues on Windows
  Reword of commit message

* tests: Enable crypto tests under msys2/mingw
  Reimplement qemu_socketpair in a simpler way. without thirdparty code

* block: enable libnfs on msys2/mingw in cirrus.yml
  New commit

* tests: disable /char/stdio/* tests in test-char.c on win32
  Needs review

* tests: fixes aio-win32 about aio_remove_fd_handler, get it consistence with=
 aio-posix.c
  Needs review

* rcu: fixes test-logging.c by call drain_call_rcu before rmdir_full
  Needs review

It first introduce msys2 CI on cirrus by fixes nfs, capstone, curses and
disable partial test-char tests.
And then fixes all unit tests failure on msys2/mingw
This fixes the reviews suggested in the mailling list
All cirrus CI are passed

Maxim Levitsky (1):
  rcu: Implement drain_call_rcu

Yonggang Luo (25):
  ci: fixes msys2 build by upgrading capstone to 4.0.2
  configure: Fixes ncursesw detection under msys2/mingw and enable
    curses
  win32: Simplify gmtime_r detection direct base on
    _POSIX_THREAD_SAFE_FUNCTIONS.
  curses: Fixes curses compiling errors.
  tests: disable /char/stdio/* tests in test-char.c on win32
  tests: Fixes test-replication.c on msys2/mingw.
  tests: test-replication disable /replication/secondary/* on
    msys2/mingw.
  osdep: file locking functions are not available on Win32
  meson: Use -b to ignore CR vs. CR-LF issues on Windows
  gcrypt: test_tls_psk_init should write binary file instead text file.
  tests: Enable crypto tests under msys2/mingw
  meson: remove empty else and duplicated gio deps
  vmstate: Fixes test-vmstate.c on msys2/mingw
  cirrus: Building freebsd in a single short
  tests: Convert g_free to g_autofree macro in test-logging.c
  tests: Fixes test-io-channel-socket.c tests under msys2/mingw
  tests: fixes aio-win32 about aio_remove_fd_handler, get it consistence
    with aio-posix.c
  tests: Fixes test-io-channel-file by mask only owner file state mask
    bits
  tests: fix test-util-sockets.c
  tests: Fixes test-qdev-global-props.c
  rcu: fixes test-logging.c by call drain_call_rcu before rmdir_full
  meson: upgrade meson for execute custom ninjatool under msys2 properly
  ci: Enable msys2 ci in cirrus
  block: Fixes nfs compiling error on msys2/mingw
  block: enable libnfs on msys2/mingw in cirrus.yml

 .cirrus.yml                      |  97 ++++++++++++++++++++--------
 block/nfs.c                      |  37 +++++++++--
 capstone                         |   2 +-
 configure                        |  61 +++++-------------
 include/qemu/osdep.h             |   2 +-
 include/qemu/rcu.h               |   1 +
 include/sysemu/os-win32.h        |   4 +-
 meson                            |   2 +-
 meson.build                      |   6 --
 tests/crypto-tls-psk-helpers.c   |   6 +-
 tests/crypto-tls-x509-helpers.c  | 106 ++++++++++++++++++++++++++++++-
 tests/crypto-tls-x509-helpers.h  |   9 ++-
 tests/qapi-schema/meson.build    |   2 +-
 tests/test-char.c                |  26 +++++---
 tests/test-crypto-tlscredsx509.c |  47 +++++++-------
 tests/test-crypto-tlssession.c   |  68 +++++++++++---------
 tests/test-io-channel-file.c     |  10 ++-
 tests/test-io-channel-socket.c   |   2 +
 tests/test-io-channel-tls.c      |  51 ++++++++-------
 tests/test-logging.c             |   5 +-
 tests/test-qdev-global-props.c   |   6 +-
 tests/test-replication.c         |  22 +++++--
 tests/test-util-sockets.c        |   6 +-
 tests/test-vmstate.c             |   3 +-
 ui/curses.c                      |  14 ++--
 util/aio-win32.c                 |  11 +++-
 util/oslib-win32.c               |   2 +-
 util/rcu.c                       |  55 ++++++++++++++++
 28 files changed, 460 insertions(+), 203 deletions(-)

--=20
2.28.0.windows.1


Re: [PATCH v9 00/26] W32, W64 msys2/mingw patches
Posted by no-reply@patchew.org 3 years, 7 months ago
Patchew URL: https://patchew.org/QEMU/20200915121318.247-1-luoyonggang@gmail.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20200915121318.247-1-luoyonggang@gmail.com
Subject: [PATCH v9 00/26] W32, W64 msys2/mingw patches

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20200915121318.247-1-luoyonggang@gmail.com -> patchew/20200915121318.247-1-luoyonggang@gmail.com
Switched to a new branch 'test'
0b113c6 block: enable libnfs on msys2/mingw in cirrus.yml
948c78c block: Fixes nfs compiling error on msys2/mingw
083ce32 ci: Enable msys2 ci in cirrus
bc69278 meson: upgrade meson for execute custom ninjatool under msys2 properly
fef8a0c rcu: fixes test-logging.c by call drain_call_rcu before rmdir_full
58f2e78 tests: Fixes test-qdev-global-props.c
4a17a57 tests: fix test-util-sockets.c
6d2b926 tests: Fixes test-io-channel-file by mask only owner file state mask bits
e170301 tests: fixes aio-win32 about aio_remove_fd_handler, get it consistence with aio-posix.c
95d2579 tests: Fixes test-io-channel-socket.c tests under msys2/mingw
7e27f27 tests: Convert g_free to g_autofree macro in test-logging.c
07bddec cirrus: Building freebsd in a single short
ae61ebd vmstate: Fixes test-vmstate.c on msys2/mingw
787eeb4 meson: remove empty else and duplicated gio deps
ad29b42 tests: Enable crypto tests under msys2/mingw
eb97064 gcrypt: test_tls_psk_init should write binary file instead text file.
7ebfac6 meson: Use -b to ignore CR vs. CR-LF issues on Windows
6c6166c osdep: file locking functions are not available on Win32
5ae548a tests: test-replication disable /replication/secondary/* on msys2/mingw.
74a6589 tests: Fixes test-replication.c on msys2/mingw.
4a06ce7 tests: disable /char/stdio/* tests in test-char.c on win32
1c1fb53 curses: Fixes curses compiling errors.
bbfe966 win32: Simplify gmtime_r detection direct base on _POSIX_THREAD_SAFE_FUNCTIONS.
588c2f6 configure: Fixes ncursesw detection under msys2/mingw and enable curses
44ed485 ci: fixes msys2 build by upgrading capstone to 4.0.2
2f25baf rcu: Implement drain_call_rcu

=== OUTPUT BEGIN ===
1/26 Checking commit 2f25baf35413 (rcu: Implement drain_call_rcu)
2/26 Checking commit 44ed4856e1ef (ci: fixes msys2 build by upgrading capstone to 4.0.2)
3/26 Checking commit 588c2f6c1827 (configure: Fixes ncursesw detection under msys2/mingw and enable curses)
4/26 Checking commit bbfe966b472f (win32: Simplify gmtime_r detection direct base on _POSIX_THREAD_SAFE_FUNCTIONS.)
5/26 Checking commit 1c1fb5366733 (curses: Fixes curses compiling errors.)
6/26 Checking commit 4a06ce772c82 (tests: disable /char/stdio/* tests in test-char.c on win32)
WARNING: line over 80 characters
#60: FILE: tests/test-char.c:1474:
+        g_test_add_func("/char/console/subprocess", char_console_test_subprocess);

total: 0 errors, 1 warnings, 56 lines checked

Patch 6/26 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
7/26 Checking commit 74a6589a34e0 (tests: Fixes test-replication.c on msys2/mingw.)
8/26 Checking commit 5ae548ac2ff9 (tests: test-replication disable /replication/secondary/* on msys2/mingw.)
9/26 Checking commit 6c6166c50138 (osdep: file locking functions are not available on Win32)
10/26 Checking commit 7ebfac6615e0 (meson: Use -b to ignore CR vs. CR-LF issues on Windows)
11/26 Checking commit eb97064abc00 (gcrypt: test_tls_psk_init should write binary file instead text file.)
12/26 Checking commit ad29b4253ac2 (tests: Enable crypto tests under msys2/mingw)
WARNING: line over 80 characters
#77: FILE: tests/crypto-tls-x509-helpers.c:514:
+    g_autofree gchar *full_path = g_build_filename(current_dir, exist_path1, NULL);

WARNING: line over 80 characters
#79: FILE: tests/crypto-tls-x509-helpers.c:516:
+        new_path2, full_path, 0 | SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE) ? 0 : -1;

WARNING: line over 80 characters
#108: FILE: tests/crypto-tls-x509-helpers.c:545:
+    sock_listener = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol);

ERROR: line over 90 characters
#113: FILE: tests/crypto-tls-x509-helpers.c:550:
+    if (-1 == setsockopt(sock_listener, SOL_SOCKET, SO_REUSEADDR, (const char *)&one, sizeof(one))) {

WARNING: line over 80 characters
#119: FILE: tests/crypto-tls-x509-helpers.c:556:
+    if (-1 == getsockname(sock_listener, addr->ai_addr, (int *)&(addr->ai_addrlen))) {

ERROR: space prohibited between function name and open parenthesis '('
#223: FILE: tests/test-crypto-tlscredsx509.c:85:
+    g_remove (CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT);

ERROR: space prohibited between function name and open parenthesis '('
#227: FILE: tests/test-crypto-tlscredsx509.c:87:
+        g_remove (CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT);

ERROR: space prohibited between function name and open parenthesis '('
#228: FILE: tests/test-crypto-tlscredsx509.c:88:
+        g_remove (CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY);

ERROR: space prohibited between function name and open parenthesis '('
#232: FILE: tests/test-crypto-tlscredsx509.c:90:
+        g_remove (CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT);

ERROR: space prohibited between function name and open parenthesis '('
#233: FILE: tests/test-crypto-tlscredsx509.c:91:
+        g_remove (CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY);

total: 6 errors, 4 warnings, 484 lines checked

Patch 12/26 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

13/26 Checking commit 787eeb4e379b (meson: remove empty else and duplicated gio deps)
14/26 Checking commit ae61ebd5b394 (vmstate: Fixes test-vmstate.c on msys2/mingw)
15/26 Checking commit 07bddec81421 (cirrus: Building freebsd in a single short)
ERROR: trailing whitespace
#50: FILE: .cirrus.yml:11:
+    - pkg install -y bash curl cyrus-sasl git glib gmake gnutls gsed $

total: 1 errors, 0 warnings, 46 lines checked

Patch 15/26 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

16/26 Checking commit 7e27f274ff7d (tests: Convert g_free to g_autofree macro in test-logging.c)
WARNING: line over 80 characters
#23: FILE: tests/test-logging.c:199:
+    g_autofree gchar *tmp_path = g_dir_make_tmp("qemu-test-logging.XXXXXX", NULL);

total: 0 errors, 1 warnings, 14 lines checked

Patch 16/26 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
17/26 Checking commit 95d25796fe97 (tests: Fixes test-io-channel-socket.c tests under msys2/mingw)
18/26 Checking commit e170301e71d0 (tests: fixes aio-win32 about aio_remove_fd_handler, get it consistence with aio-posix.c)
WARNING: Block comments use a leading /* on a separate line
#27: FILE: util/aio-win32.c:40:
+    /* If the GSource is in the process of being destroyed then

total: 0 errors, 1 warnings, 23 lines checked

Patch 18/26 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
19/26 Checking commit 6d2b926af4c1 (tests: Fixes test-io-channel-file by mask only owner file state mask bits)
WARNING: Block comments use a leading /* on a separate line
#38: FILE: tests/test-io-channel-file.c:65:
+    /* On Windows the stat() function in the C library checks only

WARNING: Block comments use * on subsequent lines
#39: FILE: tests/test-io-channel-file.c:66:
+    /* On Windows the stat() function in the C library checks only
+     the FAT-style READONLY attribute and does not look at the ACL at all. */

WARNING: Block comments use a trailing */ on a separate line
#39: FILE: tests/test-io-channel-file.c:66:
+     the FAT-style READONLY attribute and does not look at the ACL at all. */

total: 0 errors, 3 warnings, 22 lines checked

Patch 19/26 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
20/26 Checking commit 4a17a57935f0 (tests: fix test-util-sockets.c)
21/26 Checking commit 58f2e782a28e (tests: Fixes test-qdev-global-props.c)
ERROR: line over 90 characters
#22: FILE: tests/test-qdev-global-props.c:254:
+    g_test_trap_assert_stderr("*warning: global dynamic-prop-type-bad.prop3 has invalid class name*");

WARNING: line over 80 characters
#26: FILE: tests/test-qdev-global-props.c:256:
+    g_test_trap_assert_stderr("*warning: global nohotplug-type.prop5=105 not used*");

ERROR: line over 90 characters
#27: FILE: tests/test-qdev-global-props.c:257:
+    g_test_trap_assert_stderr("*warning: global nondevice-type.prop6 has invalid class name*");

total: 2 errors, 1 warnings, 13 lines checked

Patch 21/26 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

22/26 Checking commit fef8a0ca31eb (rcu: fixes test-logging.c by call drain_call_rcu before rmdir_full)
23/26 Checking commit bc6927878363 (meson: upgrade meson for execute custom ninjatool under msys2 properly)
24/26 Checking commit 083ce32943f5 (ci: Enable msys2 ci in cirrus)
25/26 Checking commit 948c78c3f338 (block: Fixes nfs compiling error on msys2/mingw)
ERROR: space prohibited between function name and open parenthesis '('
#57: FILE: block/nfs.c:56:
+#if defined (_WIN32)

ERROR: line over 90 characters
#83: FILE: block/nfs.c:430:
+    /* TODO: Not be possible implement on win32 yet, place here for futher implementation */

ERROR: space prohibited between function name and open parenthesis '('
#112: FILE: block/nfs.c:728:
+#if !defined (_WIN32)

ERROR: space prohibited between function name and open parenthesis '('
#158: FILE: block/nfs.c:893:
+#if !defined (_WIN32)

total: 4 errors, 0 warnings, 110 lines checked

Patch 25/26 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

26/26 Checking commit 0b113c632dab (block: enable libnfs on msys2/mingw in cirrus.yml)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20200915121318.247-1-luoyonggang@gmail.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com