[PATCH 2/2] util/aio-win32: Correct the event array size in aio_poll()

2022-08-05 Thread Bin Meng
From: Bin Meng WaitForMultipleObjects() can only wait for MAXIMUM_WAIT_OBJECTS object handles. Correct the event array size in aio_poll() and add a assert() to ensure it does not cause out of bound access. Signed-off-by: Bin Meng --- util/aio-win32.c | 3 ++- 1 file changed, 2 insertions

Re: [PATCH 2/2] util/aio-win32: Correct the event array size in aio_poll()

2022-08-09 Thread Bin Meng
On Fri, Aug 5, 2022 at 11:09 PM Stefan Weil wrote: > > Am 05.08.22 um 16:56 schrieb Bin Meng: > > > From: Bin Meng > > > > WaitForMultipleObjects() can only wait for MAXIMUM_WAIT_OBJECTS > > object handles. Correct the event array size in aio_poll() and > &g

[PATCH v2 2/2] util/aio-win32: Correct the event array size in aio_poll()

2022-08-09 Thread Bin Meng
From: Bin Meng WaitForMultipleObjects() can only wait for MAXIMUM_WAIT_OBJECTS object handles. Correct the event array size in aio_poll() and add a assert() to ensure it does not cause out of bound access. Signed-off-by: Bin Meng Reviewed-by: Stefan Weil --- Changes in v2: - change '

[PATCH v3 3/3] util/aio-win32: Correct the event array size in aio_poll()

2022-08-24 Thread Bin Meng
From: Bin Meng WaitForMultipleObjects() can only wait for MAXIMUM_WAIT_OBJECTS object handles. Correct the event array size in aio_poll() and add a assert() to ensure it does not cause out of bound access. Signed-off-by: Bin Meng Reviewed-by: Stefan Weil Reviewed-by: Marc-André Lureau

[PATCH 02/51] tests/qtest: Use g_mkdtemp()

2022-08-24 Thread Bin Meng
From: Bin Meng Windows does not provide a mkdtemp() API, but glib does. Replace mkdtemp() call with the glib version. Signed-off-by: Bin Meng --- tests/qtest/fuzz/generic_fuzz_configs.h | 2 +- tests/qtest/cdrom-test.c| 2 +- tests/qtest/cxl-test.c | 6

[PATCH 07/51] tests: Avoid using hardcoded /tmp in test cases

2022-08-24 Thread Bin Meng
From: Bin Meng Use g_get_tmp_dir() to get the directory to use for temporary files. Signed-off-by: Bin Meng --- tests/qtest/fuzz/generic_fuzz_configs.h | 6 -- tests/qtest/ahci-test.c | 15 +++ tests/qtest/aspeed_smc-test.c | 4 +++- tests/qtest

[PATCH 00/51] tests/qtest: Enable running qtest on Windows

2022-08-24 Thread Bin Meng
Windows. Patch 51 documents best practices of writing portable test cases as we learned during the enablement of running qtest on Windows. Based-on: <20220802075200.907360-1-bmeng...@gmail.com> Bin Meng (41): tests/qtest: Use g_setenv() tests/qtest: Use g_mkdtemp() block: Uni

[PATCH 03/51] block: Unify the get_tmp_filename() implementation

2022-08-24 Thread Bin Meng
From: Bin Meng At present get_tmp_filename() has platform specific implementations to get the directory to use for temporary files. Switch over to use g_get_tmp_dir() which works on all supported platforms. Signed-off-by: Bin Meng --- block.c | 16 ++-- 1 file changed, 2

[PATCH 08/51] block/vvfat: Unify the mkdir() call

2022-08-24 Thread Bin Meng
From: Bin Meng There is a difference in the mkdir() call for win32 and non-win32 platforms, and currently is handled in the codes with #ifdefs. glib provides a portable g_mkdir_with_parents() API and we can use it to unify the codes without #ifdefs. Signed-off-by: Bin Meng --- block/vvfat.c

[PATCH 38/51] tests/qtest: {ahci,ide}-test: Open file in binary mode

2022-08-24 Thread Bin Meng
7;b' shall have no effect, but is allowed for ISO C standard conformance. Let's add the letter 'b' which works on both POSIX and Windows. Similar situation applies to the open() 'flags' where O_BINARY is used for binary mode. Signed-off-by: Xuzhou Cheng Signed-off-by

[PATCH 30/51] tests: Skip iotests and qtest when '--without-default-devices'

2022-08-24 Thread Bin Meng
From: Bin Meng When QEMU is configured with '--without-default-devices', we should not build and run iotests and qtest because devices used by these test cases are not built in. Signed-off-by: Bin Meng --- tests/qemu-iotests/meson.build | 5 + tests/qtest/meson.build|

[PATCH 32/51] tests/qtest: Fix ERROR_SHARING_VIOLATION for win32

2022-08-24 Thread Bin Meng
From: Bin Meng On Windows, the MinGW provided mkstemp() API opens the file with exclusive access, denying other processes to read/write the file. Such behavior prevents the QEMU executable from opening the file, (e.g.: CreateFile returns ERROR_SHARING_VIOLATION). This can be fixed by closing

[PATCH 33/51] tests/qtest: {ahci, ide}-test: Use relative path for temporary files

2022-08-24 Thread Bin Meng
From: Bin Meng These test cases uses "blkdebug:path/to/config:path/to/image" for testing. On Windows, absolute file paths contain the delimiter ':' which causes the blkdebug filename parser fail to parse filenames. Signed-off-by: Bin Meng --- tests/qt

Re: [PATCH 03/51] block: Unify the get_tmp_filename() implementation

2022-08-31 Thread Bin Meng
Hi Marc-André, On Wed, Aug 31, 2022 at 8:54 PM Marc-André Lureau wrote: > > Hi Bin > > On Wed, Aug 24, 2022 at 1:42 PM Bin Meng wrote: >> >> From: Bin Meng >> >> At present get_tmp_filename() has platform specific implementations >> to get the directo

Re: [PATCH 32/51] tests/qtest: Fix ERROR_SHARING_VIOLATION for win32

2022-09-02 Thread Bin Meng
On Thu, Aug 25, 2022 at 8:06 PM Thomas Huth wrote: > > On 24/08/2022 11.40, Bin Meng wrote: > > From: Bin Meng > > > > On Windows, the MinGW provided mkstemp() API opens the file with > > exclusive access, denying other processes to read/write the file. >

Re: [PATCH 32/51] tests/qtest: Fix ERROR_SHARING_VIOLATION for win32

2022-09-02 Thread Bin Meng
On Thu, Sep 1, 2022 at 4:42 PM Marc-André Lureau wrote: > > Hi > > On Wed, Aug 24, 2022 at 2:03 PM Bin Meng wrote: >> >> From: Bin Meng >> >> On Windows, the MinGW provided mkstemp() API opens the file with >> exclusive access, denying other processe

Re: [PATCH 30/51] tests: Skip iotests and qtest when '--without-default-devices'

2022-09-02 Thread Bin Meng
On Thu, Aug 25, 2022 at 8:04 PM Thomas Huth wrote: > > On 24/08/2022 11.40, Bin Meng wrote: > > From: Bin Meng > > > > When QEMU is configured with '--without-default-devices', we should > > not build and run iotests and qtest because devices used

Re: [PATCH 33/51] tests/qtest: {ahci, ide}-test: Use relative path for temporary files

2022-09-03 Thread Bin Meng
On Thu, Sep 1, 2022 at 4:58 PM Marc-André Lureau wrote: > > > > On Wed, Aug 24, 2022 at 2:55 PM Bin Meng wrote: >> >> From: Bin Meng >> >> These test cases uses "blkdebug:path/to/config:path/to/image" for >> testing. On Windows, absolute file

[PATCH 0/7] nsis: gitlab-ci: Improve QEMU Windows installer packaging

2022-09-08 Thread Bin Meng
tive build. Update CI to test the installer generation on Windows too. During testing a 32-bit build issue was exposed in block/nfs.c and the fix is included in this series. Bin Meng (7): scripts/nsis.py: Drop the unnecessary path separator scripts/nsis.py: Fix destination directory name wh

[PATCH 5/7] block/nfs: Fix 32-bit Windows build

2022-09-08 Thread Bin Meng
From: Bin Meng libnfs.h declares nfs_fstat() as the following for win32: int nfs_fstat(struct nfs_context *nfs, struct nfsfh *nfsfh, struct __stat64 *st); The 'st' parameter should be of type 'struct __stat64'. The codes happen to build successfully for 64

Re: [PATCH 0/7] nsis: gitlab-ci: Improve QEMU Windows installer packaging

2022-09-15 Thread Bin Meng
On Thu, Sep 8, 2022 at 9:28 PM Bin Meng wrote: > > At present packaging the required DLLs of QEMU executables is a > manual process, and error prone. > > Improve scripts/nsis.py by adding a logic to automatically package > required DLLs of QEMU executables. > > 'mak

Re: [PATCH 01/11] hw/ppc/meson: Allow e500 boards to be enabled separately

2022-09-15 Thread Bin Meng
| 8 > hw/ppc/meson.build | 6 ++ > 3 files changed, 12 insertions(+), 5 deletions(-) > Reviewed-by: Bin Meng

Re: [PATCH 02/11] hw/gpio/meson: Introduce dedicated config switch for hw/gpio/mpc8xxx

2022-09-15 Thread Bin Meng
files changed, 5 insertions(+), 1 deletion(-) > Reviewed-by: Bin Meng

Re: [PATCH 03/11] docs/system/ppc/ppce500: Add heading for networking chapter

2022-09-15 Thread Bin Meng
-- > docs/system/ppc/ppce500.rst | 3 +++ > 1 file changed, 3 insertions(+) > Reviewed-by: Bin Meng

Re: [PATCH 05/11] hw/ppc/e500: Remove if statement which is now always true

2022-09-15 Thread Bin Meng
.h | 1 - > hw/ppc/e500plat.c | 1 - > hw/ppc/mpc8544ds.c | 1 - > 4 files changed, 14 insertions(+), 19 deletions(-) > Reviewed-by: Bin Meng

Re: [PATCH 04/11] hw/ppc/mpc8544ds: Add platform bus

2022-09-15 Thread Bin Meng
On Thu, Sep 15, 2022 at 11:29 PM Bernhard Beschow wrote: > > Models the real device more closely. Please describe the source (e.g.: I assume it's MPC8544DS board manual or something like that?) that describe such memory map for the platform bus. Is this the eLBC bus range that includes the NOR f

Re: [PATCH 06/11] hw/block/pflash_cfi01: Error out if device length isn't a power of two

2022-09-15 Thread Bin Meng
nged, 6 insertions(+), 2 deletions(-) > Reviewed-by: Bin Meng

Re: [PATCH 08/11] hw/sd/sdhci-internal: Unexport ESDHC defines

2022-09-16 Thread Bin Meng
+++ > 2 files changed, 19 insertions(+), 20 deletions(-) > Reviewed-by: Bin Meng

Re: [PATCH 09/11] hw/sd/sdhci: Rename ESDHC_* defines to USDHC_*

2022-09-16 Thread Bin Meng
C_CTRL_4BITBUS; > } > > /* > @@ -1768,11 +1768,11 @@ usdhc_write(void *opaque, hwaddr offset, uint64_t > val, unsigned size) > sdhci_write(opaque, offset, value, size); > break; > > -case ESDHC_MIX_CTRL: > + case USDHC_MIX_CTRL: > /* > * So, when SD/MMC stack in Linux tries to write to "Transfer > * Mode Register", ESDHC i.MX quirk code will translate it Here I assume ESDHC i.MX means the Linux eSDHC driver for i.MX, so no need to replace ESDHC with USDHC? > - * into a write to ESDHC_MIX_CTRL, so we do the opposite in > + * into a write to USDHC_MIX_CTRL, so we do the opposite in > * order to get where we started > * > * Note that Auto CMD23 Enable bit is located in a wrong place > -- Overall LGTM: Reviewed-by: Bin Meng

Re: [PATCH 07/11] hw/ppc/e500: Implement pflash handling

2022-09-16 Thread Bin Meng
On Thu, Sep 15, 2022 at 11:36 PM Bernhard Beschow wrote: > > Allows e500 boards to have their root file system reside on flash using > only builtin devices. > > Note that the flash memory area is only created when a -pflash argument is > given, and that the size is determined by the given file. Th

Re: [PATCH 10/11] hw/sd/sdhci: Implement Freescale eSDHC device model

2022-09-16 Thread Bin Meng
On Thu, Sep 15, 2022 at 11:30 PM Bernhard Beschow wrote: > > Will allow e500 boards to access SD cards using just their own devices. > > Signed-off-by: Bernhard Beschow > --- > hw/sd/sdhci.c | 147 +- > include/hw/sd/sdhci.h | 3 + > 2 files chan

Re: [PATCH 11/11] hw/ppc/e500: Add Freescale eSDHC to e500 boards

2022-09-16 Thread Bin Meng
On Thu, Sep 15, 2022 at 11:30 PM Bernhard Beschow wrote: > > Adds missing functionality to emulated e500 SOCs which increases the > chance of given "real" firmware images to access SD cards. By "firmware" do you mean U-Boot? > > Signed-off-by: Bernhard Beschow > --- > docs/system/ppc/ppce500.r

Re: [PATCH 00/11] ppc/e500: Add support for two types of flash, cleanup

2022-09-16 Thread Bin Meng
Hi Bernhard, On Thu, Sep 15, 2022 at 11:25 PM Bernhard Beschow wrote: > > This series adds support for -pflash and direct SD card access to the > PPC e500 boards. The idea is to increase compatibility with "real" firmware > images where only the bare minimum of drivers is compiled in. > > The ser

[PATCH v2 08/39] block/vvfat: Unify the mkdir() call

2022-09-20 Thread Bin Meng
From: Bin Meng There is a difference in the mkdir() call for win32 and non-win32 platforms, and currently is handled in the codes with #ifdefs. glib provides a portable g_mkdir() API and we can use it to unify the codes without #ifdefs. Signed-off-by: Bin Meng --- Changes in v2: - Change to

[PATCH v2 00/39] tests/qtest: Enable running qtest on Windows

2022-09-20 Thread Bin Meng
were already applied in the mainline - Drop patch: "qga/commands-posix-ssh: Use g_mkdir_with_parents()" - Drop patch: "tests: Skip iotests and qtest when '--without-default-devices'" - Drop patch: "tests/qtest: Fix ERROR_SHARING_VIOLATION for win32&

[PATCH v2 03/39] block: Unify the get_tmp_filename() implementation

2022-09-20 Thread Bin Meng
From: Bin Meng At present get_tmp_filename() has platform specific implementations to get the directory to use for temporary files. Switch over to use g_get_tmp_dir() which works on all supported platforms. Signed-off-by: Bin Meng --- (no changes since v1) block.c | 16 ++-- 1

[PATCH v2 07/39] tests: Avoid using hardcoded /tmp in test cases

2022-09-20 Thread Bin Meng
From: Bin Meng Lots of test cases were written to use hardcoded /tmp directory for temporary files. To avoid this, we update them to use g_dir_make_tmp() or g_file_open_tmp() when appropriate. Signed-off-by: Bin Meng --- Changes in v2: - Use g_dir_make_tmp(), g_file_open_tmp() when

[PATCH v2 20/39] tests/qtest: {ahci, ide}-test: Use relative path for temporary files for win32

2022-09-20 Thread Bin Meng
From: Bin Meng These test cases uses "blkdebug:path/to/config:path/to/image" for testing. On Windows, absolute file paths contain the delimiter ':' which causes the blkdebug filename parser fail to parse filenames. Signed-off-by: Bin Meng --- (no changes since v1) tes

[PATCH v2 23/39] tests/qtest: ide-test: Open file in binary mode

2022-09-20 Thread Bin Meng
7;b' shall have no effect, but is allowed for ISO C standard conformance. Let's add the letter 'b' which works on both POSIX and Windows. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- Changes in v2: - Drop ahci-test.c changes that are

Re: [PATCH 0/7] nsis: gitlab-ci: Improve QEMU Windows installer packaging

2022-09-21 Thread Bin Meng
Hi, On Thu, Sep 8, 2022 at 9:28 PM Bin Meng wrote: > > At present packaging the required DLLs of QEMU executables is a > manual process, and error prone. > > Improve scripts/nsis.py by adding a logic to automatically package > required DLLs of QEMU executables. > > '

Re: [PATCH 0/7] nsis: gitlab-ci: Improve QEMU Windows installer packaging

2022-09-22 Thread Bin Meng
Hi Stefan, On Wed, Sep 21, 2022 at 8:24 PM Thomas Huth wrote: > > On 21/09/2022 14.18, Bin Meng wrote: > > Hi, > > > > On Thu, Sep 8, 2022 at 9:28 PM Bin Meng wrote: > >> > >> At present packaging the required DLLs of QEMU executables is a > >>

Re: [PATCH 5/7] block/nfs: Fix 32-bit Windows build

2022-09-23 Thread Bin Meng
Hi, On Wed, Sep 21, 2022 at 8:10 PM Meng, Bin wrote: > > -Original Message- > From: Philippe Mathieu-Daudé On Behalf Of > Philippe Mathieu-Daudé > Sent: Sunday, September 18, 2022 5:32 AM > To: Bin Meng ; qemu-de...@nongnu.org > Cc: Meng, Bin ; Hanna Reitz ;

[PATCH] block: Refactor get_tmp_filename()

2022-09-24 Thread Bin Meng
From: Bin Meng At present there are two callers of get_tmp_filename() and they are inconsistent. One does: /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */ char *tmp_filename = g_malloc0(PATH_MAX + 1); ... ret = get_tmp_filename(tmp_filename, PATH_MAX + 1

Re: [PATCH v2 03/39] block: Unify the get_tmp_filename() implementation

2022-09-24 Thread Bin Meng
On Fri, Sep 23, 2022 at 3:39 AM Marc-André Lureau wrote: > > Hi > > On Tue, Sep 20, 2022 at 2:17 PM Bin Meng wrote: >> >> From: Bin Meng >> >> At present get_tmp_filename() has platform specific implementations >> to get the directory to u

[PATCH v2] block: Refactor get_tmp_filename()

2022-09-24 Thread Bin Meng
From: Bin Meng At present there are two callers of get_tmp_filename() and they are inconsistent. One does: /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */ char *tmp_filename = g_malloc0(PATH_MAX + 1); ... ret = get_tmp_filename(tmp_filename, PATH_MAX + 1

[PATCH v3] block: Refactor get_tmp_filename()

2022-09-24 Thread Bin Meng
From: Bin Meng At present there are two callers of get_tmp_filename() and they are inconsistent. One does: /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */ char *tmp_filename = g_malloc0(PATH_MAX + 1); ... ret = get_tmp_filename(tmp_filename, PATH_MAX + 1

[PATCH v3 09/54] tests/qtest: fdc-test: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch tests/qtest/fdc-test.c | 5 +++-- 1 file changed, 3 insertions

[PATCH v3 00/54] tests/qtest: Enable running qtest on Windows

2022-09-25 Thread Bin Meng
tests and qtest when '--without-default-devices'" - Drop patch: "tests/qtest: Fix ERROR_SHARING_VIOLATION for win32" Bin Meng (47): tests/qtest: i440fx-test: Rewrite create_blob_file() to be portable semihosting/arm-compat-semi: Avoid using hardcoded /tmp tcg: Avoid u

[PATCH v3 05/54] tests/qtest: ahci-test: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch - Ensure g_autofree variable is initialized tests/qtest/ahci-test.c

[PATCH v3 13/54] tests/qtest: ide-test: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch tests/qtest/ide-test.c | 10 ++ 1 file changed, 6

[PATCH v3 19/54] tests/qtest: virtio-blk-test: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch tests/qtest/virtio-blk-test.c | 4 ++-- 1 file changed, 2

[PATCH v3 25/54] block/vvfat: Unify the mkdir() call

2022-09-25 Thread Bin Meng
From: Bin Meng There is a difference in the mkdir() call for win32 and non-win32 platforms, and currently is handled in the codes with #ifdefs. glib provides a portable g_mkdir() API and we can use it to unify the codes without #ifdefs. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau

[PATCH v3 37/54] tests/qtest: {ahci, ide}-test: Use relative path for temporary files for win32

2022-09-25 Thread Bin Meng
From: Bin Meng These test cases uses "blkdebug:path/to/config:path/to/image" for testing. On Windows, absolute file paths contain the delimiter ':' which causes the blkdebug filename parser fail to parse filenames. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --

[PATCH v3 40/54] tests/qtest: ide-test: Open file in binary mode

2022-09-25 Thread Bin Meng
7;b' shall have no effect, but is allowed for ISO C standard conformance. Let's add the letter 'b' which works on both POSIX and Windows. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v2) Changes in v2: - Drop

Re: [PATCH v2] block: Refactor get_tmp_filename()

2022-09-26 Thread Bin Meng
On Mon, Sep 26, 2022 at 6:13 PM Markus Armbruster wrote: > > Bin Meng writes: > > > From: Bin Meng > > > > At present there are two callers of get_tmp_filename() and they are > > inconsistent. > > > > One does: > > > > /* TODO:

Re: [PATCH v3 37/54] tests/qtest: {ahci, ide}-test: Use relative path for temporary files for win32

2022-09-26 Thread Bin Meng
Hi Thomas, On Tue, Sep 27, 2022 at 12:20 AM Thomas Huth wrote: > > On 25/09/2022 13.30, Bin Meng wrote: > > From: Bin Meng > > > > These test cases uses "blkdebug:path/to/config:path/to/image" for > > testing. On Windows, absolute file paths contai

Re: [PATCH v2] block: Refactor get_tmp_filename()

2022-09-26 Thread Bin Meng
Hi Markus, On Tue, Sep 27, 2022 at 2:22 PM Markus Armbruster wrote: > > Bin Meng writes: > > > On Mon, Sep 26, 2022 at 6:13 PM Markus Armbruster wrote: > >> > >> Bin Meng writes: > >> > >> > From: Bin Meng > >> > > >

[PATCH v4 05/54] tests/qtest: ahci-test: Avoid using hardcoded /tmp

2022-09-27 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Thomas Huth --- (no changes since v3) Changes in v3: - Split to a separate patch - Ensure g_autofree

[PATCH v4 09/54] tests/qtest: fdc-test: Avoid using hardcoded /tmp

2022-09-27 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v3) Changes in v3: - Split to a separate patch tests/qtest

[PATCH v4 00/54] tests/qtest: Enable running qtest on Windows

2022-09-27 Thread Bin Meng
patch: "qga/commands-posix-ssh: Use g_mkdir_with_parents()" - Drop patch: "tests: Skip iotests and qtest when '--without-default-devices'" - Drop patch: "tests/qtest: Fix ERROR_SHARING_VIOLATION for win32" Bin Meng (48): tests/qtest: i440fx-test: Rewrite crea

[PATCH v4 25/54] block/vvfat: Unify the mkdir() call

2022-09-27 Thread Bin Meng
From: Bin Meng There is a difference in the mkdir() call for win32 and non-win32 platforms, and currently is handled in the codes with #ifdefs. glib provides a portable g_mkdir() API and we can use it to unify the codes without #ifdefs. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau

[PATCH v4 19/54] tests/qtest: virtio-blk-test: Avoid using hardcoded /tmp

2022-09-27 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v3) Changes in v3: - Split to a separate patch tests/qtest

[PATCH v4 13/54] tests/qtest: ide-test: Avoid using hardcoded /tmp

2022-09-27 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v3) Changes in v3: - Split to a separate patch tests/qtest

[PATCH v4 37/54] tests/qtest: {ahci, ide}-test: Use relative path for temporary files for win32

2022-09-27 Thread Bin Meng
From: Bin Meng These test cases uses "blkdebug:path/to/config:path/to/image" for testing. On Windows, absolute file paths contain the delimiter ':' which causes the blkdebug filename parser fail to parse filenames. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau

[PATCH v4 40/54] tests/qtest: ide-test: Open file in binary mode

2022-09-27 Thread Bin Meng
7;b' shall have no effect, but is allowed for ISO C standard conformance. Let's add the letter 'b' which works on both POSIX and Windows. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v2) Changes in v2: - Drop

[PATCH v4] block: Refactor get_tmp_filename()

2022-09-27 Thread Bin Meng
From: Bin Meng At present there are two callers of get_tmp_filename() and they are inconsistent. One does: /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */ char *tmp_filename = g_malloc0(PATH_MAX + 1); ... ret = get_tmp_filename(tmp_filename, PATH_MAX + 1

[PATCH v5 1/2] block: Ignore close() failure in get_tmp_filename()

2022-09-28 Thread Bin Meng
From: Bin Meng The temporary file has been created and is ready for use. Checking return value of close() does not seem useful. The file descriptor is almost certainly closed; see close(2) under "Dealing with error returns from close()". Let's simply ignore close() failure here

[PATCH v5 2/2] block: Refactor get_tmp_filename()

2022-09-28 Thread Bin Meng
From: Bin Meng At present there are two callers of get_tmp_filename() and they are inconsistent. One does: /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */ char *tmp_filename = g_malloc0(PATH_MAX + 1); ... ret = get_tmp_filename(tmp_filename, PATH_MAX + 1

Re: [PATCH v4 25/54] block/vvfat: Unify the mkdir() call

2022-09-30 Thread Bin Meng
Hi Kevin, On Tue, Sep 27, 2022 at 7:07 PM Bin Meng wrote: > > From: Bin Meng > > There is a difference in the mkdir() call for win32 and non-win32 > platforms, and currently is handled in the codes with #ifdefs. > > glib provides a portable g_mkdir() API and we can use it

Re: [PATCH v5 2/2] block: Refactor get_tmp_filename()

2022-10-02 Thread Bin Meng
Hi Kevin, On Fri, Sep 30, 2022 at 6:13 PM Kevin Wolf wrote: > > Am 28.09.2022 um 16:41 hat Bin Meng geschrieben: > > From: Bin Meng > > > > At present there are two callers of get_tmp_filename() and they are > > inconsistent. > > > > One does: > >

Re: [PATCH v4 00/54] tests/qtest: Enable running qtest on Windows

2022-10-03 Thread Bin Meng
Hi Marc-André, On Mon, Oct 3, 2022 at 5:26 PM Marc-André Lureau wrote: > > Hi Bin > > On Tue, Sep 27, 2022 at 3:18 PM Bin Meng wrote: >> >> In preparation to adding virtio-9p support on Windows, this series >> enables running qtest on Windows, so that we can

[PATCH 00/18] tests/qtest: Enable running qtest on Windows

2022-10-06 Thread Bin Meng
timeout limit to 90 minutes - new patch: "tests/qtest: Enable qtest build on Windows" Bin Meng (15): semihosting/arm-compat-semi: Avoid using hardcoded /tmp tcg: Avoid using hardcoded /tmp util/qemu-sockets: Use g_get_tmp_dir() to get the directory for temporary files tests/qtes

[PATCH 05/18] block/vvfat: Unify the mkdir() call

2022-10-06 Thread Bin Meng
From: Bin Meng There is a difference in the mkdir() call for win32 and non-win32 platforms, and currently is handled in the codes with #ifdefs. glib provides a portable g_mkdir() API and we can use it to unify the codes without #ifdefs. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau

Re: [PATCH 00/18] tests/qtest: Enable running qtest on Windows

2022-10-06 Thread Bin Meng
On Thu, Oct 6, 2022 at 11:11 PM Bin Meng wrote: > > In preparation to adding virtio-9p support on Windows, this series > enables running qtest on Windows, so that we can run the virtio-9p > tests on Windows to make sure it does not break accidently. > > Changes in v5: > -

[PATCH v5 00/18] tests/qtest: Enable running qtest on Windows

2022-10-06 Thread Bin Meng
timeout limit to 90 minutes - new patch: "tests/qtest: Enable qtest build on Windows" Bin Meng (15): semihosting/arm-compat-semi: Avoid using hardcoded /tmp tcg: Avoid using hardcoded /tmp util/qemu-sockets: Use g_get_tmp_dir() to get the directory for temporary files tests/qtes

[PATCH v5 05/18] block/vvfat: Unify the mkdir() call

2022-10-06 Thread Bin Meng
From: Bin Meng There is a difference in the mkdir() call for win32 and non-win32 platforms, and currently is handled in the codes with #ifdefs. glib provides a portable g_mkdir() API and we can use it to unify the codes without #ifdefs. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau

Re: [PATCH v5 00/18] tests/qtest: Enable running qtest on Windows

2022-10-06 Thread Bin Meng
On Fri, Oct 7, 2022 at 4:35 AM Alex Bennée wrote: > > > Bin Meng writes: > > > In preparation to adding virtio-9p support on Windows, this series > > enables running qtest on Windows, so that we can run the virtio-9p > > tests on Windows to make sure it does not b

Re: [PATCH v2 04/13] hw/ppc/e500: Reduce usage of sysbus API

2022-10-08 Thread Bin Meng
w/ppc/e500.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Reviewed-by: Bin Meng

Re: [PATCH v2 05/13] hw/ppc/mpc8544ds: Rename wrongly named method

2022-10-08 Thread Bin Meng
On Tue, Oct 4, 2022 at 5:15 AM Bernhard Beschow wrote: > > Signed-off-by: Bernhard Beschow > --- > hw/ppc/mpc8544ds.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > Reviewed-by: Bin Meng

Re: [PATCH 04/11] hw/ppc/mpc8544ds: Add platform bus

2022-10-08 Thread Bin Meng
Hi Bernhard, On Sat, Sep 17, 2022 at 1:19 AM Bernhard Beschow wrote: > > Am 16. September 2022 06:15:53 UTC schrieb Bin Meng : > >On Thu, Sep 15, 2022 at 11:29 PM Bernhard Beschow wrote: > >> > >> Models the real device more closely. > > > >Pleas

Re: [PATCH v2 06/13] hw/ppc/mpc8544ds: Add platform bus

2022-10-08 Thread Bin Meng
gt; hw/ppc/mpc8544ds.c | 6 ++ > 1 file changed, 6 insertions(+) > Reviewed-by: Bin Meng

Re: [PATCH v2 00/13] ppc/e500: Add support for two types of flash, cleanup

2022-10-08 Thread Bin Meng
On Sun, Oct 9, 2022 at 12:11 AM Bernhard Beschow wrote: > > Am 4. Oktober 2022 12:43:35 UTC schrieb Daniel Henrique Barboza > : > >Hey, > > > >On 10/3/22 18:27, Philippe Mathieu-Daudé wrote: > >> Hi Daniel, > >> > >> On 3/10/22 22:31, Bernhard Beschow wrote: > >>> Cover letter: > >>>

Re: [PATCH v2 09/13] hw/ppc/e500: Implement pflash handling

2022-10-08 Thread Bin Meng
", blk); > +qdev_prop_set_uint32(dev, "num-blocks", size / sector_len); > +qdev_prop_set_uint64(dev, "sector-length", sector_len); > +qdev_prop_set_uint8(dev, "width", 2); > +qdev_prop_set_bit(dev, "big-endian", true); > +qdev_prop_set_uint16(dev, "id0", 0x89); > +qdev_prop_set_uint16(dev, "id1", 0x18); > +qdev_prop_set_uint16(dev, "id2", 0x); > +qdev_prop_set_uint16(dev, "id3", 0x0); > +qdev_prop_set_string(dev, "name", "e500.flash"); > +s = SYS_BUS_DEVICE(dev); > +sysbus_realize_and_unref(s, &error_fatal); > + > +memory_region_add_subregion(&pms->pbus_dev->mmio, 0, > +sysbus_mmio_get_region(s, 0)); > +} > + > /* > * Smart firmware defaults ahead! > * Otherwise LGTM: Reviewed-by: Bin Meng

[PATCH v6 2/2] block: Refactor get_tmp_filename()

2022-10-09 Thread Bin Meng
ention that /var/tmp is preferred over /tmp on non-win32 hosts. Signed-off-by: Bin Meng --- Changes in v6: - use g_mkstemp() and stick to use /var/tmp for non-win32 hosts Changes in v5: - minor change in the commit message - add some notes in the function comment block - add g_autofree for tmp_f

[PATCH v6 1/2] block: Ignore close() failure in get_tmp_filename()

2022-10-09 Thread Bin Meng
rkus Armbruster Signed-off-by: Bin Meng Reviewed-by: Markus Armbruster --- (no changes since v5) Changes in v5: - new patch: "block: Ignore close() failure in get_tmp_filename()" block.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/block.c b/block.c ind

Re: [PATCH] tests/unit/test-image-locking: Fix handling of temporary files

2022-10-12 Thread Bin Meng
nstead, so that it clear where the temporary > files come from. > > Signed-off-by: Thomas Huth > --- > tests/unit/test-image-locking.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > Fixes: aef96d7d4f0b ("tests: Add unit tests for image locking") Reviewed-by: Bin Meng

Re: [PATCH v6 2/2] block: Refactor get_tmp_filename()

2022-10-16 Thread Bin Meng
On Mon, Oct 10, 2022 at 12:05 PM Bin Meng wrote: > > At present there are two callers of get_tmp_filename() and they are > inconsistent. > > One does: > > /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */ > char *tmp_filename

Re: [PATCH v5 00/18] tests/qtest: Enable running qtest on Windows

2022-10-17 Thread Bin Meng
Hi Alex, On Fri, Oct 7, 2022 at 1:31 PM Bin Meng wrote: > > On Fri, Oct 7, 2022 at 4:35 AM Alex Bennée wrote: > > > > > > Bin Meng writes: > > > > > In preparation to adding virtio-9p support on Windows, this series > > > enables running qt

Re: [PATCH v3 7/9] hw/ppc/e500: Implement pflash handling

2022-10-18 Thread Bin Meng
On Tue, Oct 18, 2022 at 3:46 PM Bernhard Beschow wrote: > > Am 16. Oktober 2022 14:15:09 UTC schrieb BALATON Zoltan : > >On Sun, 16 Oct 2022, Bernhard Beschow wrote: > >> Allows e500 boards to have their root file system reside on flash using > >> only builtin devices located in the eLBC memory re

Re: [PATCH v5 00/18] tests/qtest: Enable running qtest on Windows

2022-10-19 Thread Bin Meng
On Wed, Oct 19, 2022 at 12:00 AM Alex Bennée wrote: > > > Bin Meng writes: > > > Hi Alex, > > > > On Fri, Oct 7, 2022 at 1:31 PM Bin Meng wrote: > >> > >> On Fri, Oct 7, 2022 at 4:35 AM Alex Bennée wrote: > >> > > >> > >

[PATCH v4 3/3] util/aio-win32: Correct the event array size in aio_poll()

2022-10-19 Thread Bin Meng
From: Bin Meng WaitForMultipleObjects() can only wait for MAXIMUM_WAIT_OBJECTS object handles. Correct the event array size in aio_poll() and add a assert() to ensure it does not cause out of bound access. Signed-off-by: Bin Meng Reviewed-by: Stefan Weil Reviewed-by: Marc-André Lureau

Re: [PATCH 5/7] block/nfs: Fix 32-bit Windows build

2022-10-26 Thread Bin Meng
Hi Kevin, On Sat, Sep 24, 2022 at 9:19 AM Bin Meng wrote: > > Hi, > > On Wed, Sep 21, 2022 at 8:10 PM Meng, Bin wrote: > > > > -Original Message- > > From: Philippe Mathieu-Daudé On Behalf > > Of Philippe Mathieu-Daudé > > Sent: Sunday, S

Re: [PATCH 5/7] block/nfs: Fix 32-bit Windows build

2022-10-27 Thread Bin Meng
On Thu, Oct 27, 2022 at 3:55 PM Kevin Wolf wrote: > > Am 27.10.2022 um 04:45 hat Bin Meng geschrieben: > > Hi Kevin, > > [...] > > Will you queue this patch via the block tree? > > Just to be sure, you mean only patch 5? Yes, I can do that. > Yes, only this one. Thank you. Regards, Bin

Re: [PATCH 0/7] nsis: gitlab-ci: Improve QEMU Windows installer packaging

2022-10-29 Thread Bin Meng
Hi Thomas, On Wed, Sep 21, 2022 at 8:24 PM Thomas Huth wrote: > > On 21/09/2022 14.18, Bin Meng wrote: > > Hi, > > > > On Thu, Sep 8, 2022 at 9:28 PM Bin Meng wrote: > >> > >> At present packaging the required DLLs of QEMU executables is a > >>

Re: [PULL 22/23] hw/sd: Fix incorrect populated function switch status data structure

2020-10-21 Thread Bin Meng
Hi Philippe, On Tue, Oct 20, 2020 at 11:18 PM Philippe Mathieu-Daudé wrote: > > Hi Bin, > > On 8/21/20 7:29 PM, Philippe Mathieu-Daudé wrote: > > From: Bin Meng > > > > At present the function switch status data structure bit [399:376] > > are wrongly pupu

Re: [PULL 22/23] hw/sd: Fix incorrect populated function switch status data structure

2020-10-22 Thread Bin Meng
Hi Philippe, On Wed, Oct 21, 2020 at 6:07 PM Philippe Mathieu-Daudé wrote: > > On 10/21/20 11:57 AM, Bin Meng wrote: > > Hi Philippe, > > > > On Tue, Oct 20, 2020 at 11:18 PM Philippe Mathieu-Daudé > > wrote: > >> > >> Hi Bin, > >&

Re: [PULL 22/23] hw/sd: Fix incorrect populated function switch status data structure

2020-10-22 Thread Bin Meng
Hi Niek, On Thu, Oct 22, 2020 at 11:20 PM Niek Linnenbank wrote: > > Hi Bin, Philippe, > > If im correct the acceptance tests for orange pi need to be run with a flag > ARMBIAN_ARTIFACTS_CACHED set that explicitly allows them to be run using the > armbian mirror. So if you pass that flag on the

Re: [RFC PATCH 0/4] tests/acceptance: Test U-Boot/Linux from Armbian 20.08 on Orange Pi PC

2020-10-23 Thread Bin Meng
Hi Philippe, On Fri, Oct 23, 2020 at 9:18 PM Philippe Mathieu-Daudé wrote: > > Series meant to help Bin Meng to debug the SD card issue > reported by Michael Roth. Thank you for the patches. > > Philippe Mathieu-Daudé (4): > Revert "hw/sd: Fix incorrect populated func

Re: [RFC PATCH 0/4] tests/acceptance: Test U-Boot/Linux from Armbian 20.08 on Orange Pi PC

2020-10-23 Thread Bin Meng
Hi Philippe, On Sat, Oct 24, 2020 at 1:56 AM Philippe Mathieu-Daudé wrote: > > On 10/23/20 7:42 PM, Bin Meng wrote: > > Hi Philippe, > > > > On Fri, Oct 23, 2020 at 9:18 PM Philippe Mathieu-Daudé > > wrote: > >> > >> Series meant to help Bin

[PATCH] hw/sd: Zero out function selection fields before being populated

2020-10-23 Thread Bin Meng
From: Bin Meng The function selection fields (399:376) should be zeroed out to prevent leftover from being or'ed into the switch function status data structure. This fixes the boot failure as seen in the acceptance testing on the orangepi target. Fixes: b638627c723a ("hw/sd: Fix

  1   2   3   4   >