Re: [PATCH v3 01/15] hw/block/nvme: Define 64 bit cqe.result

2020-09-15 Thread Klaus Jensen
On Sep 15 20:44, Dmitry Fomichev wrote: > > -Original Message- > > From: Klaus Jensen > > Sent: Tuesday, September 15, 2020 3:56 PM > > To: Dmitry Fomichev > > Cc: Fam Zheng ; Kevin Wolf ; > > Damien Le Moal ; qemu-block@nongnu.org; > > Niklas Cassel ; Klaus Jensen > > ;

Re: [PATCH v3 14/15] hw/block/nvme: Use zone metadata file for persistence

2020-09-15 Thread Klaus Jensen
On Sep 15 20:44, Dmitry Fomichev wrote: > > -Original Message- > > From: Klaus Jensen > > Sent: Tuesday, September 15, 2020 3:10 PM > > To: Dmitry Fomichev > > Cc: Keith Busch ; Klaus Jensen > > ; Kevin Wolf ; Philippe > > Mathieu-Daudé ; Maxim Levitsky > > ; Fam Zheng ; Niklas Cassel >

RE: [PATCH v3 01/15] hw/block/nvme: Define 64 bit cqe.result

2020-09-15 Thread Dmitry Fomichev
> -Original Message- > From: Klaus Jensen > Sent: Tuesday, September 15, 2020 3:56 PM > To: Dmitry Fomichev > Cc: Fam Zheng ; Kevin Wolf ; > Damien Le Moal ; qemu-block@nongnu.org; > Niklas Cassel ; Klaus Jensen > ; qemu-de...@nongnu.org; Alistair Francis > ; Keith Busch ; Philippe >

RE: [PATCH v3 14/15] hw/block/nvme: Use zone metadata file for persistence

2020-09-15 Thread Dmitry Fomichev
> -Original Message- > From: Klaus Jensen > Sent: Tuesday, September 15, 2020 3:10 PM > To: Dmitry Fomichev > Cc: Keith Busch ; Klaus Jensen > ; Kevin Wolf ; Philippe > Mathieu-Daudé ; Maxim Levitsky > ; Fam Zheng ; Niklas Cassel > ; Damien Le Moal ; > qemu-block@nongnu.org;

Re: [PATCH v8 4/7] scripts: add block-coroutine-wrapper.py

2020-09-15 Thread Vladimir Sementsov-Ogievskiy
15.09.2020 19:44, Vladimir Sementsov-Ogievskiy wrote: We have a very frequent pattern of creating coroutine from function with several arguments: - create structure to pack parameters - create _entry function to call original function taking parameters from struct - do different

Re: [PATCH v3 01/15] hw/block/nvme: Define 64 bit cqe.result

2020-09-15 Thread Klaus Jensen
On Sep 15 18:56, Dmitry Fomichev wrote: > > -Original Message- > > From: Klaus Jensen > > Sent: Tuesday, September 15, 2020 3:37 AM > > To: Dmitry Fomichev > > Cc: Keith Busch ; Klaus Jensen > > ; Kevin Wolf ; Philippe > > Mathieu-Daudé ; Maxim Levitsky > > ; Fam Zheng ; Niklas Cassel >

Re: [PATCH v3 14/15] hw/block/nvme: Use zone metadata file for persistence

2020-09-15 Thread Klaus Jensen
On Sep 14 07:14, Dmitry Fomichev wrote: > A ZNS drive that is emulated by this module is currently initialized > with all zones Empty upon startup. However, actual ZNS SSDs save the > state and condition of all zones in their internal NVRAM in the event > of power loss. When such a drive is

RE: [PATCH v3 02/15] hw/block/nvme: Report actual LBA data shift in LBAF

2020-09-15 Thread Dmitry Fomichev
> -Original Message- > From: Klaus Jensen > Sent: Tuesday, September 15, 2020 3:34 AM > To: Dmitry Fomichev > Cc: Keith Busch ; Klaus Jensen > ; Kevin Wolf ; Philippe > Mathieu-Daudé ; Maxim Levitsky > ; Fam Zheng ; Niklas Cassel > ; Damien Le Moal ; > qemu-block@nongnu.org;

RE: [PATCH v3 01/15] hw/block/nvme: Define 64 bit cqe.result

2020-09-15 Thread Dmitry Fomichev
> -Original Message- > From: Klaus Jensen > Sent: Tuesday, September 15, 2020 3:37 AM > To: Dmitry Fomichev > Cc: Keith Busch ; Klaus Jensen > ; Kevin Wolf ; Philippe > Mathieu-Daudé ; Maxim Levitsky > ; Fam Zheng ; Niklas Cassel > ; Damien Le Moal ; > qemu-block@nongnu.org;

RE: [PATCH v2 00/15] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-09-15 Thread Dmitry Fomichev
> -Original Message- > From: Klaus Jensen > Sent: Tuesday, September 15, 2020 3:44 AM > To: Dmitry Fomichev > Cc: Keith Busch ; Klaus Jensen > ; Kevin Wolf ; Philippe > Mathieu-Daudé ; Maxim Levitsky > ; Fam Zheng ; Niklas Cassel > ; Damien Le Moal ; > qemu-block@nongnu.org;

Re: [PATCH 00/13] dma: Let the DMA API take MemTxAttrs argument and propagate MemTxResult

2020-09-15 Thread Philippe Mathieu-Daudé
This series is fully review. Paolo, does it belong to your tree? On 9/4/20 5:44 PM, Philippe Mathieu-Daudé wrote: > Salvaging cleanups patches from the RFC series "Forbid DMA write > accesses to MMIO regions" [*], propagating MemTxResult and > adding documentation. > > [*]

Re: [PATCH v10 15/26] cirrus: Building freebsd in a single short

2020-09-15 Thread Philippe Mathieu-Daudé
Typo "single shot" in subject? On 9/15/20 7:12 PM, Yonggang Luo wrote: > This reverts commit 45f7b7b9f38f5c4d1529a37c93dedfc26a231bba > ("cirrus.yml: Split FreeBSD job into two parts"). > > freebsd 1 hour limit not hit anymore > > I think we going to a wrong direction, I think there is some

Re: [PATCH v10 15/26] cirrus: Building freebsd in a single short

2020-09-15 Thread Yonggang Luo
On Wed, Sep 16, 2020 at 1:48 AM Philippe Mathieu-Daudé wrote: > > Typo "single shot" in subject? Yeap, single shot, hope the maintainer fix it > > > On 9/15/20 7:12 PM, Yonggang Luo wrote: > > This reverts commit 45f7b7b9f38f5c4d1529a37c93dedfc26a231bba > > ("cirrus.yml: Split FreeBSD job into

[PATCH v10 24/26] ci: Enable msys2 ci in cirrus

2020-09-15 Thread 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

[PATCH v10 20/26] tests: fix test-util-sockets.c

2020-09-15 Thread Yonggang Luo
Fixes following errors: Running test test-util-sockets ERROR test-util-sockets - missing test plan # Start of name tests ** ERROR:../tests/test-util-sockets.c:93:test_socket_fd_pass_name_good: assertion failed (fd != -1): (-1 != -1) Bail out!

[PATCH v10 26/26] block: enable libnfs on msys2/mingw in cirrus.yml

2020-09-15 Thread Yonggang Luo
At the begging libnfs are not enabled because of compiling error, now it's fixed so enable it Signed-off-by: Yonggang Luo --- .cirrus.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.cirrus.yml b/.cirrus.yml index 90ed891865..ca4d7db64f 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@

[PATCH v10 25/26] block: Fixes nfs compiling error on msys2/mingw

2020-09-15 Thread Yonggang Luo
These compiling errors are fixed: ../block/nfs.c:27:10: fatal error: poll.h: No such file or directory 27 | #include | ^~~~ compilation terminated. ../block/nfs.c:63:5: error: unknown type name 'blkcnt_t' 63 | blkcnt_t st_blocks; | ^~~~ ../block/nfs.c:

[PATCH v10 22/26] rcu: fixes test-logging.c by call drain_call_rcu before rmdir_full

2020-09-15 Thread Yonggang Luo
drain_call_rcu is necessary on win32, because under win32, if you don't close the file before remove it, the remove would be fail. Signed-off-by: Yonggang Luo --- tests/test-logging.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test-logging.c b/tests/test-logging.c index

[PATCH v10 23/26] meson: upgrade meson for execute custom ninjatool under msys2 properly

2020-09-15 Thread Yonggang Luo
* Bump versions to 0.55.2 for release * Tag Info: object 008d13038f95e7c7d8ad553f14e408da5b94c360 type commit tag 0.55.2 tagger Jussi Pakkanen 2020/9/11 1:24:47 Signed-off-by: Yonggang Luo --- meson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson b/meson index

Re: [PATCH v2 2/8] iotests: Drop readlink -f

2020-09-15 Thread Richard Henderson
On 9/15/20 6:43 AM, Alex Bennée wrote: > From: Max Reitz > > On macOS, (out of the box) readlink does not have -f. We do not really > need readlink here, though, it was just a replacement for realpath > (which is not available on our BSD test systems), which we needed to > make the $(dirname)

[PATCH v2] hw/block/nand: Decommission the NAND museum

2020-09-15 Thread Philippe Mathieu-Daudé
This is the QEMU equivalent of this Linux commit (but 7 years later): https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f7025a43a9da2 The MTD subsystem has its own small museum of ancient NANDs in a form of the CONFIG_MTD_NAND_MUSEUM_IDS configuration option.

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

2020-09-15 Thread Yonggang Luo
V9-V10 * gcrypt: test_tls_psk_init should write binary file instead text file. Split #include out, that line not belong this patch * tests: Enable crypto tests under msys2/mingw move qemu_socketpair into oslib-win32.c and rename to socketpair move qemu_link into osdep.c Fixes code style

[PATCH v10 21/26] tests: Fixes test-qdev-global-props.c

2020-09-15 Thread Yonggang Luo
On win32 the line ending are \r\n, so we skip the \n in function test_dynamic_globalprop Signed-off-by: Yonggang Luo Reviewed-by: Daniel P. Berrangé --- tests/test-qdev-global-props.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test-qdev-global-props.c

[PATCH v10 18/26] tests: fixes aio-win32 about aio_remove_fd_handler, get it consistence with aio-posix.c

2020-09-15 Thread Yonggang Luo
This is a fixes for (C:\work\xemu\qemu\build\tests\test-aio-multithread.exe:19100): GLib-CRITICAL **: 23:03:24.965: g_source_remove_poll: assertion '!SOURCE_DESTROYED (source)' failed ERROR test-aio-multithread - Bail out! GLib-FATAL-CRITICAL: g_source_remove_poll: assertion '!SOURCE_DESTROYED

[PATCH v10 19/26] tests: Fixes test-io-channel-file by mask only owner file state mask bits

2020-09-15 Thread Yonggang Luo
This is the error on msys2/mingw Running test test-io-channel-file ** ERROR:../tests/test-io-channel-file.c:59:test_io_channel_file_helper: assertion failed (TEST_MASK & ~mask == st.st_mode & 0777): (384 == 438) ERROR test-io-channel-file - Bail out!

[PATCH v10 16/26] tests: Convert g_free to g_autofree macro in test-logging.c

2020-09-15 Thread Yonggang Luo
g_autofree are prefer than g_free when possible. Signed-off-by: Yonggang Luo Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé --- tests/test-logging.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test-logging.c b/tests/test-logging.c index

[PATCH v10 02/26] ci: fixes msys2 build by upgrading capstone to 4.0.2

2020-09-15 Thread 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 1d230532840a37ac032c6ab80128238fc930c6c1 are the tagged

[PATCH v10 01/26] rcu: Implement drain_call_rcu

2020-09-15 Thread Yonggang Luo
From: Maxim Levitsky This will allow is to preserve the semantics of hmp_device_del, that the device is deleted immediatly which was changed by previos patch that delayed this to RCU callback Signed-off-by: Maxim Levitsky Suggested-by: Stefan Hajnoczi Reviewed-by: Stefan Hajnoczi ---

[PATCH v10 17/26] tests: Fixes test-io-channel-socket.c tests under msys2/mingw

2020-09-15 Thread Yonggang Luo
Currently test-io-channel-socket doesn't init with qemu_init_main_loop and that's cause the qemu_aio_context not inited, and the following is the stack when null pointer accessed: qemu_fd_register (c:\work\xemu\qemu\util\main-loop.c:336) qemu_try_set_nonblock

[PATCH v10 06/26] tests: disable /char/stdio/* tests in test-char.c on win32

2020-09-15 Thread Yonggang Luo
These tests are blocking test-char to be finished. Disable them by using variable is_win32, so we doesn't need macro to open it. and easy recover those function latter. Signed-off-by: Yonggang Luo --- tests/test-char.c | 27 +-- 1 file changed, 17 insertions(+), 10

[PATCH v10 09/26] osdep: file locking functions are not available on Win32

2020-09-15 Thread Yonggang Luo
Do not declare the following locking functions on Win32: 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);

[PATCH v10 03/26] configure: Fixes ncursesw detection under msys2/mingw and enable curses

2020-09-15 Thread Yonggang Luo
The mingw pkg-config are showing following absolute path and contains : as the separator, so we must not use : as path separator. and we know the command line parameter are not likely contains newline, we could use newline as path command line parameter separator -D_XOPEN_SOURCE=600

[PATCH v10 04/26] win32: Simplify gmtime_r detection direct base on _POSIX_THREAD_SAFE_FUNCTIONS.

2020-09-15 Thread Yonggang Luo
First, this reduce the size of configure, configure are tending to removal in future, and this didn't introduce any new feature or remove any exist feature. Second, the current localtime_r detection are conflict with ncursesw detection in mingw, when ncursesw detected, it will provide the

[PATCH v10 05/26] curses: Fixes curses compiling errors.

2020-09-15 Thread 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) |

[PATCH v10 12/26] tests: Enable crypto tests under msys2/mingw

2020-09-15 Thread Yonggang Luo
Fixes following tests on msys2/mingw 'test-crypto-tlscredsx509' test-crypto-tlssession' 'test-io-channel-tls' These tests are failure with: ERROR test-crypto-tlscredsx509 - missing test plan ERROR test-crypto-tlssession - missing test plan ERROR test-io-channel-tls - missing test plan Because on

[PATCH v10 08/26] tests: test-replication disable /replication/secondary/* on msys2/mingw.

2020-09-15 Thread Yonggang Luo
They caused failure on msys2/mingw, that's because file-win32.c not implement .bdrv_reopen_prepare/commit/abort yet. This is the error message: > $ ./tests/test-replication.exe > # random seed: R02S3f4d1c01af2b0a046990e0235c481faf > 1..13 > # Start of replication tests > # Start of primary tests

[PATCH v10 10/26] meson: Use -b to ignore CR vs. CR-LF issues on Windows

2020-09-15 Thread Yonggang Luo
Ideally we would use the '--strip-trailing-cr' option, but not being POSIX is a portability problem (i.e. BSDs and Solaris based OSes). Instead use the '-b' option which, although doing slightly more, produce the expected result on Windows." Signed-off-by: Yonggang Luo Reviewed-by: Eric Blake

[PATCH v10 07/26] tests: Fixes test-replication.c on msys2/mingw.

2020-09-15 Thread Yonggang Luo
On Windows there is no path like /tmp/s_local_disk.XX Use g_get_tmp_dir instead of /tmp. Signed-off-by: Yonggang Luo Reviewed-by: Daniel P. Berrangé --- tests/test-replication.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/test-replication.c

[PATCH v10 11/26] gcrypt: test_tls_psk_init should write binary file instead text file.

2020-09-15 Thread Yonggang Luo
On windows, if open file with "w", it's will automatically convert "\n" to "\r\n" when writing to file. Signed-off-by: Yonggang Luo --- tests/crypto-tls-psk-helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/crypto-tls-psk-helpers.c

[PATCH v10 14/26] vmstate: Fixes test-vmstate.c on msys2/mingw

2020-09-15 Thread Yonggang Luo
The vmstate are valid on win32, just need generate tmp path properly Signed-off-by: Yonggang Luo Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Daniel P. Berrangé --- tests/test-vmstate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH v10 15/26] cirrus: Building freebsd in a single short

2020-09-15 Thread Yonggang Luo
This reverts commit 45f7b7b9f38f5c4d1529a37c93dedfc26a231bba ("cirrus.yml: Split FreeBSD job into two parts"). freebsd 1 hour limit not hit anymore I think we going to a wrong direction, I think there is some tests a stall the test runner, please look at

[PATCH v10 13/26] meson: remove empty else and duplicated gio deps

2020-09-15 Thread Yonggang Luo
Signed-off-by: Yonggang Luo Reviewed-by: Daniel P. Berrangé --- meson.build | 6 -- 1 file changed, 6 deletions(-) diff --git a/meson.build b/meson.build index 690723b470..23cb1b8742 100644 --- a/meson.build +++ b/meson.build @@ -317,7 +317,6 @@ opengl = not_found if 'CONFIG_OPENGL' in

[PATCH v8 1/7] block: return error-code from bdrv_invalidate_cache

2020-09-15 Thread Vladimir Sementsov-Ogievskiy
This is the only coroutine wrapper from block.c and block/io.c which doesn't return a value, so let's convert it to the common behavior, to simplify moving to generated coroutine wrappers in a further commit. Also, bdrv_invalidate_cache is a void function, returning error only through **errp

[PATCH v8 7/7] block/io: refactor save/load vmstate

2020-09-15 Thread Vladimir Sementsov-Ogievskiy
Like for read/write in a previous commit, drop extra indirection layer, generate directly bdrv_readv_vmstate() and bdrv_writev_vmstate(). Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- block/coroutines.h| 10 +++ include/block/block.h | 6 ++-- block/io.c

[PATCH v8 5/7] block: generate coroutine-wrapper code

2020-09-15 Thread Vladimir Sementsov-Ogievskiy
Use code generation implemented in previous commit to generated coroutine wrappers in block.c and block/io.c Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- block/coroutines.h| 6 +- include/block/block.h | 16 ++-- block.c | 73 ---

[PATCH v8 4/7] scripts: add block-coroutine-wrapper.py

2020-09-15 Thread Vladimir Sementsov-Ogievskiy
We have a very frequent pattern of creating coroutine from function with several arguments: - create structure to pack parameters - create _entry function to call original function taking parameters from struct - do different magic to handle completion: set ret to NOT_DONE or

[PATCH v8 6/7] block: drop bdrv_prwv

2020-09-15 Thread Vladimir Sementsov-Ogievskiy
Now that we are not maintaining boilerplate code for coroutine wrappers, there is no more sense in keeping the extra indirection layer of bdrv_prwv(). Let's drop it and instead generate pure bdrv_preadv() and bdrv_pwritev(). Currently, bdrv_pwritev() and bdrv_preadv() are returning bytes on

[PATCH v8 3/7] block: declare some coroutine functions in block/coroutines.h

2020-09-15 Thread Vladimir Sementsov-Ogievskiy
We are going to keep coroutine-wrappers code (structure-packing parameters, BDRV_POLL wrapper functions) in separate auto-generated files. So, we'll need a header with declaration of original _co_ functions, for those which are static now. As well, we'll need declarations for wrapper functions. Do

[PATCH v8 2/7] block/io: refactor coroutine wrappers

2020-09-15 Thread Vladimir Sementsov-Ogievskiy
Most of our coroutine wrappers already follow this convention: We have 'coroutine_fn bdrv_co_()' as the core function, and a wrapper 'bdrv_()' which does parameters packing and call bdrv_run_co(). The only outsiders are the bdrv_prwv_co and bdrv_common_block_status_above wrappers. Let's refactor

[PATCH v8 0/7] coroutines: generate wrapper code

2020-09-15 Thread Vladimir Sementsov-Ogievskiy
Hi all! The aim of the series is to reduce code-duplication and writing parameters structure-packing by hand around coroutine function wrappers. Benefits: - no code duplication - less indirection v8: 04: - rebase on meson build - script interface is changed to satisfy meson

Re: [PATCH v7 11/13] util/async: Add aio_co_reschedule_self()

2020-09-15 Thread Stefan Hajnoczi
On Wed, Sep 09, 2020 at 05:11:47PM +0200, Kevin Wolf wrote: > Add a function that can be used to move the currently running coroutine > to a different AioContext (and therefore potentially a different > thread). > > Signed-off-by: Kevin Wolf > --- > include/block/aio.h | 10 ++ >

Re: [PATCH v7 13/13] block: Convert 'block_resize' to coroutine

2020-09-15 Thread Stefan Hajnoczi
On Wed, Sep 09, 2020 at 05:11:49PM +0200, Kevin Wolf wrote: > @@ -2456,8 +2456,7 @@ void qmp_block_resize(bool has_device, const char > *device, > return; > } > > -aio_context = bdrv_get_aio_context(bs); > -aio_context_acquire(aio_context); > +old_ctx =

Re: [PATCH v7 12/13] block: Add bdrv_co_move_to_aio_context()

2020-09-15 Thread Stefan Hajnoczi
On Wed, Sep 09, 2020 at 05:11:48PM +0200, Kevin Wolf wrote: > Add a function to move the current coroutine to the AioContext of a > given BlockDriverState. > > Signed-off-by: Kevin Wolf > --- > include/block/block.h | 6 ++ > block.c | 10 ++ > 2 files changed, 16

Re: [PATCH v7 00/13] monitor: Optionally run handlers in coroutines

2020-09-15 Thread Stefan Hajnoczi
On Mon, Sep 14, 2020 at 05:09:49PM +0200, Markus Armbruster wrote: > Stefan Hajnoczi writes: > > > On Wed, Sep 09, 2020 at 05:11:36PM +0200, Kevin Wolf wrote: > >> Some QMP command handlers can block the main loop for a relatively long > >> time, for example because they perform some I/O. This

[PATCH v2 2/8] iotests: Drop readlink -f

2020-09-15 Thread Alex Bennée
From: Max Reitz On macOS, (out of the box) readlink does not have -f. We do not really need readlink here, though, it was just a replacement for realpath (which is not available on our BSD test systems), which we needed to make the $(dirname) into an absolute path. Instead of using either,

Re: [PATCH] hw: ide: check the pointer before do dma memory unmap

2020-09-15 Thread Li Qiang
ping!! Li Qiang 于2020年9月7日周一 上午9:39写道: > > Ping! > > Li Qiang 于2020年9月1日周二 下午6:34写道: > > > > Ping. > > > > Li Qiang 于2020年8月15日周六 下午3:21写道: > > > > > > In 'map_page' we need to check the return value of > > > 'dma_memory_map' to ensure the we actully maped something. > > > Otherwise, we will

Re: [PATCH v9 19/26] tests: Fixes test-io-channel-file by mask only owner file state mask bits

2020-09-15 Thread Daniel P . Berrangé
On Tue, Sep 15, 2020 at 08:13:11PM +0800, Yonggang Luo wrote: > This is the error on msys2/mingw > Running test test-io-channel-file > ** > ERROR:../tests/test-io-channel-file.c:59:test_io_channel_file_helper: > assertion failed (TEST_MASK & ~mask == st.st_mode & 0777): (384 == 438) > ERROR

Re: [PATCH v9 04/26] win32: Simplify gmtime_r detection direct base on _POSIX_THREAD_SAFE_FUNCTIONS.

2020-09-15 Thread Yonggang Luo
On Tue, Sep 15, 2020 at 9:00 PM Daniel P. Berrangé wrote: > > On Tue, Sep 15, 2020 at 08:12:56PM +0800, Yonggang Luo wrote: > > First, this reduce the size of configure, configure are tending to removal in future, > > and this didn't introduce any new feature or remove any exist feature. > >

Re: [PATCH v9 12/26] tests: Enable crypto tests under msys2/mingw

2020-09-15 Thread Daniel P . Berrangé
On Tue, Sep 15, 2020 at 08:13:04PM +0800, Yonggang Luo wrote: > Fixes following tests on msys2/mingw > 'test-crypto-tlscredsx509' > test-crypto-tlssession' > 'test-io-channel-tls' > > These tests are failure with: > ERROR test-crypto-tlscredsx509 - missing test plan > ERROR test-crypto-tlssession

Re: [PATCH v9 04/26] win32: Simplify gmtime_r detection direct base on _POSIX_THREAD_SAFE_FUNCTIONS.

2020-09-15 Thread Daniel P . Berrangé
On Tue, Sep 15, 2020 at 08:12:56PM +0800, Yonggang Luo wrote: > First, this reduce the size of configure, configure are tending to removal in > future, > and this didn't introduce any new feature or remove any exist feature. > Second, the current localtime_r detection are conflict with ncursesw

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

2020-09-15 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200915121318.247-1-luoyongg...@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-luoyongg...@gmail.com Subject: [PATCH v9 00/26] W32, W64

[PATCH v9 25/26] block: Fixes nfs compiling error on msys2/mingw

2020-09-15 Thread Yonggang Luo
These compiling errors are fixed: ../block/nfs.c:27:10: fatal error: poll.h: No such file or directory 27 | #include | ^~~~ compilation terminated. ../block/nfs.c:63:5: error: unknown type name 'blkcnt_t' 63 | blkcnt_t st_blocks; | ^~~~ ../block/nfs.c:

[PATCH v9 21/26] tests: Fixes test-qdev-global-props.c

2020-09-15 Thread Yonggang Luo
On win32 the line ending are \r\n, so we skip the \n in function test_dynamic_globalprop Signed-off-by: Yonggang Luo Reviewed-by: Daniel P. Berrangé --- tests/test-qdev-global-props.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test-qdev-global-props.c

[PATCH v9 20/26] tests: fix test-util-sockets.c

2020-09-15 Thread Yonggang Luo
Fixes following errors: Running test test-util-sockets ERROR test-util-sockets - missing test plan # Start of name tests ** ERROR:../tests/test-util-sockets.c:93:test_socket_fd_pass_name_good: assertion failed (fd != -1): (-1 != -1) Bail out!

[PATCH v9 15/26] cirrus: Building freebsd in a single short

2020-09-15 Thread Yonggang Luo
This reverts commit 45f7b7b9f38f5c4d1529a37c93dedfc26a231bba ("cirrus.yml: Split FreeBSD job into two parts"). freebsd 1 hour limit not hit anymore I think we going to a wrong direction, I think there is some tests a stall the test runner, please look at

[PATCH v9 16/26] tests: Convert g_free to g_autofree macro in test-logging.c

2020-09-15 Thread Yonggang Luo
g_autofree are prefer than g_free when possible. Signed-off-by: Yonggang Luo Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé --- tests/test-logging.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test-logging.c b/tests/test-logging.c index

Re: [PATCH] fdc: check null block pointer before blk_pwrite

2020-09-15 Thread P J P
+-- On Thu, 27 Aug 2020, P J P wrote --+ | While transferring data via fdctrl_write_data(), check that | current drive does not have a null block pointer. Avoid | null pointer dereference. | | -> https://ruhr-uni-bochum.sciebo.de/s/NNWP2GfwzYKeKwE?path=%2Ffdc_nullptr1 | ==1658854==Hint:

[PATCH v9 26/26] block: enable libnfs on msys2/mingw in cirrus.yml

2020-09-15 Thread Yonggang Luo
At the begging libnfs are not enabled because of compiling error, now it's fixed so enable it Signed-off-by: Yonggang Luo --- .cirrus.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.cirrus.yml b/.cirrus.yml index 176ccba76c..9566ec0439 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@

[PATCH v9 23/26] meson: upgrade meson for execute custom ninjatool under msys2 properly

2020-09-15 Thread Yonggang Luo
* Bump versions to 0.55.2 for release * Tag Info: object 008d13038f95e7c7d8ad553f14e408da5b94c360 type commit tag 0.55.2 tagger Jussi Pakkanen 2020/9/11 1:24:47 Signed-off-by: Yonggang Luo --- meson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson b/meson index

[PATCH v9 11/26] gcrypt: test_tls_psk_init should write binary file instead text file.

2020-09-15 Thread Yonggang Luo
On windows, if open file with "w", it's will automatically convert "\n" to "\r\n" when writing to file. Signed-off-by: Yonggang Luo --- tests/crypto-tls-psk-helpers.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/crypto-tls-psk-helpers.c

[PATCH v9 24/26] ci: Enable msys2 ci in cirrus

2020-09-15 Thread 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

[PATCH v9 09/26] osdep: file locking functions are not available on Win32

2020-09-15 Thread Yonggang Luo
Do not declare the following locking functions on Win32: 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);

[PATCH v9 22/26] rcu: fixes test-logging.c by call drain_call_rcu before rmdir_full

2020-09-15 Thread Yonggang Luo
drain_call_rcu is necessary on win32, because under win32, if you don't close the file before remove it, the remove would be fail. Signed-off-by: Yonggang Luo --- tests/test-logging.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test-logging.c b/tests/test-logging.c index

[PATCH v9 08/26] tests: test-replication disable /replication/secondary/* on msys2/mingw.

2020-09-15 Thread Yonggang Luo
They caused failure on msys2/mingw, that's because file-win32.c not implement .bdrv_reopen_prepare/commit/abort yet. This is the error message: > $ ./tests/test-replication.exe > # random seed: R02S3f4d1c01af2b0a046990e0235c481faf > 1..13 > # Start of replication tests > # Start of primary tests

[PATCH v9 19/26] tests: Fixes test-io-channel-file by mask only owner file state mask bits

2020-09-15 Thread Yonggang Luo
This is the error on msys2/mingw Running test test-io-channel-file ** ERROR:../tests/test-io-channel-file.c:59:test_io_channel_file_helper: assertion failed (TEST_MASK & ~mask == st.st_mode & 0777): (384 == 438) ERROR test-io-channel-file - Bail out!

[PATCH v9 18/26] tests: fixes aio-win32 about aio_remove_fd_handler, get it consistence with aio-posix.c

2020-09-15 Thread Yonggang Luo
This is a fixes for (C:\work\xemu\qemu\build\tests\test-aio-multithread.exe:19100): GLib-CRITICAL **: 23:03:24.965: g_source_remove_poll: assertion '!SOURCE_DESTROYED (source)' failed ERROR test-aio-multithread - Bail out! GLib-FATAL-CRITICAL: g_source_remove_poll: assertion '!SOURCE_DESTROYED

[PATCH v9 14/26] vmstate: Fixes test-vmstate.c on msys2/mingw

2020-09-15 Thread Yonggang Luo
The vmstate are valid on win32, just need generate tmp path properly Signed-off-by: Yonggang Luo Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Daniel P. Berrangé --- tests/test-vmstate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH v9 07/26] tests: Fixes test-replication.c on msys2/mingw.

2020-09-15 Thread Yonggang Luo
On Windows there is no path like /tmp/s_local_disk.XX Use g_get_tmp_dir instead of /tmp. Signed-off-by: Yonggang Luo Reviewed-by: Daniel P. Berrangé --- tests/test-replication.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/test-replication.c

[PATCH v9 06/26] tests: disable /char/stdio/* tests in test-char.c on win32

2020-09-15 Thread Yonggang Luo
These tests are blocking test-char to be finished. Disable them by using variable is_win32, so we doesn't need macro to open it. and easy recover those function latter. Signed-off-by: Yonggang Luo --- tests/test-char.c | 26 -- 1 file changed, 16 insertions(+), 10

[PATCH v9 05/26] curses: Fixes curses compiling errors.

2020-09-15 Thread 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) |

[PATCH v9 12/26] tests: Enable crypto tests under msys2/mingw

2020-09-15 Thread Yonggang Luo
Fixes following tests on msys2/mingw 'test-crypto-tlscredsx509' test-crypto-tlssession' 'test-io-channel-tls' These tests are failure with: ERROR test-crypto-tlscredsx509 - missing test plan ERROR test-crypto-tlssession - missing test plan ERROR test-io-channel-tls - missing test plan Because on

[PATCH v9 17/26] tests: Fixes test-io-channel-socket.c tests under msys2/mingw

2020-09-15 Thread Yonggang Luo
Currently test-io-channel-socket doesn't init with qemu_init_main_loop and that's cause the qemu_aio_context not inited, and the following is the stack when null pointer accessed: qemu_fd_register (c:\work\xemu\qemu\util\main-loop.c:336) qemu_try_set_nonblock

[PATCH v9 04/26] win32: Simplify gmtime_r detection direct base on _POSIX_THREAD_SAFE_FUNCTIONS.

2020-09-15 Thread Yonggang Luo
First, this reduce the size of configure, configure are tending to removal in future, and this didn't introduce any new feature or remove any exist feature. Second, the current localtime_r detection are conflict with ncursesw detection in mingw, when ncursesw detected, it will provide the

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

2020-09-15 Thread Yonggang Luo
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

[PATCH v9 01/26] rcu: Implement drain_call_rcu

2020-09-15 Thread Yonggang Luo
From: Maxim Levitsky This will allow is to preserve the semantics of hmp_device_del, that the device is deleted immediatly which was changed by previos patch that delayed this to RCU callback Signed-off-by: Maxim Levitsky Suggested-by: Stefan Hajnoczi Reviewed-by: Stefan Hajnoczi ---

[PATCH v9 03/26] configure: Fixes ncursesw detection under msys2/mingw and enable curses

2020-09-15 Thread Yonggang Luo
The mingw pkg-config are showing following absolute path and contains : as the separator, so we must not use : as path separator. and we know the command line parameter are not likely contains newline, we could use newline as path command line parameter separator -D_XOPEN_SOURCE=600

[PATCH v9 10/26] meson: Use -b to ignore CR vs. CR-LF issues on Windows

2020-09-15 Thread Yonggang Luo
Ideally we would use the '--strip-trailing-cr' option, but not being POSIX is a portability problem (i.e. BSDs and Solaris based OSes). Instead use the '-b' option which, although doing slightly more, produce the expected result on Windows." Signed-off-by: Yonggang Luo Reviewed-by: Eric Blake

[PATCH v9 13/26] meson: remove empty else and duplicated gio deps

2020-09-15 Thread Yonggang Luo
Signed-off-by: Yonggang Luo Reviewed-by: Daniel P. Berrangé --- meson.build | 6 -- 1 file changed, 6 deletions(-) diff --git a/meson.build b/meson.build index 690723b470..23cb1b8742 100644 --- a/meson.build +++ b/meson.build @@ -317,7 +317,6 @@ opengl = not_found if 'CONFIG_OPENGL' in

[PATCH v9 02/26] ci: fixes msys2 build by upgrading capstone to 4.0.2

2020-09-15 Thread 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 1d230532840a37ac032c6ab80128238fc930c6c1 are the tagged

Re: [PULL 00/22] Block patches

2020-09-15 Thread Peter Maydell
On Tue, 15 Sep 2020 at 11:46, Max Reitz wrote: > > The following changes since commit 2d2c73d0e3d504a61f868e46e6abd5643f38091b: > > Merge remote-tracking branch > 'remotes/pmaydell/tags/pull-target-arm-20200914-1' into staging (2020-09-14 > 16:03:08 +0100) > > are available in the Git

[PATCH v2 2/2] tests: add test-fdmon-epoll

2020-09-15 Thread Stefan Hajnoczi
Test aio_disable_external(), which switches from fdmon-epoll back to fdmon-poll. This resulted in an assertion failure that was fixed in the previous patch. Signed-off-by: Stefan Hajnoczi --- MAINTAINERS | 1 + tests/test-fdmon-epoll.c | 73

[PATCH v2 0/2] fdmon-poll: reset npfd when upgrading to fdmon-epoll

2020-09-15 Thread Stefan Hajnoczi
v2: * Rebased onto qemu.git/master for meson Fix an assertion failure when aio_poll() is called in a aio_disable_external() region. The failure happens when fdmon-poll is first upgraded to fdmon-epoll and then downgraded again due to aio_disable_external(). Stefan Hajnoczi (2): fdmon-poll:

[PATCH v2 1/2] fdmon-poll: reset npfd when upgrading to fdmon-epoll

2020-09-15 Thread Stefan Hajnoczi
npfd keeps track of how many pollfds are currently being monitored. It must be reset to 0 when fdmon_poll_wait() returns. When npfd reaches a treshold we switch to fdmon-epoll because it scales better. This patch resets npfd in the case where we switch to fdmon-epoll. Forgetting to do so results

Re: [PATCH v8 27/27] Revert "configure: add --ninja option"

2020-09-15 Thread Yonggang Luo
On Tue, Sep 15, 2020 at 7:44 PM Thomas Huth wrote: > On 13/09/2020 16.08, Paolo Bonzini wrote: > > On 13/09/20 00:44, Yonggang Luo wrote: > >> This reverts commit 48328880fddf0145bdccc499160fb24dfabfbd41. > >> > >> The --ninja option doesn't need anymore because of upgrade meson to > 0.55.2 > >>

Re: Potential regression in 'qemu-img convert' to LVM

2020-09-15 Thread Stefan Reiter
On 9/15/20 11:08 AM, Nir Soffer wrote: On Mon, Sep 14, 2020 at 3:25 PM Stefan Reiter wrote: Hi list, following command fails since 5.1 (tested on kernel 5.4.60): # qemu-img convert -p -f raw -O raw /dev/zvol/pool/disk-1 /dev/vg/disk-1 qemu-img: error while writing at byte 2157968896: Device

Re: [PATCH v8 27/27] Revert "configure: add --ninja option"

2020-09-15 Thread Thomas Huth
On 13/09/2020 16.08, Paolo Bonzini wrote: > On 13/09/20 00:44, Yonggang Luo wrote: >> This reverts commit 48328880fddf0145bdccc499160fb24dfabfbd41. >> >> The --ninja option doesn't need anymore because of upgrade meson to 0.55.2 >> At that version we can use ninjatool > > We might actually get

[PATCH v4 9/9] migration: introduce snapshot-{save, load, delete} QMP commands

2020-09-15 Thread Daniel P . Berrangé
savevm, loadvm and delvm are some of the few HMP commands that have never been converted to use QMP. The reasons for the lack of conversion are that they blocked execution of the event thread, and the semantics around choice of disks were ill-defined. Despite this downside, however, libvirt and

[PATCH v4 3/9] block: add ability to specify list of blockdevs during snapshot

2020-09-15 Thread Daniel P . Berrangé
When running snapshot operations, there are various rules for which blockdevs are included/excluded. While this provides reasonable default behaviour, there are scenarios that are not well handled by the default logic. Some of the conditions do not have a single correct answer. Thus there needs

[PATCH v4 8/9] iotests: add support for capturing and matching QMP events

2020-09-15 Thread Daniel P . Berrangé
When using the _launch_qemu and _send_qemu_cmd functions from common.qemu, any QMP events get mixed in with the output from the commands and responses. This makes it difficult to write a test case as the ordering of events in the output is not stable. This introduces a variable 'capture_events'

[PATCH v4 5/9] migration: control whether snapshots are ovewritten

2020-09-15 Thread Daniel P . Berrangé
The traditional HMP "savevm" command will overwrite an existing snapshot if it already exists with the requested name. This new flag allows this to be controlled allowing for safer behaviour with a future QMP command. Signed-off-by: Daniel P. Berrangé --- include/migration/snapshot.h | 2 +-

  1   2   >