PING: [PATCH 0/4] Add a new backend for cryptodev

2022-09-25 Thread Lei He
On 2022/9/19 11:53, Lei He wrote: This patch adds a new backend called LKCF to cryptodev, LKCF stands for Linux Kernel Cryptography Framework. If a cryptographic accelerator that supports LKCF is installed on the the host (you can see which algorithms are supported in host's LKCF by executing

Re: [PATCH v2] scsi-disk: support setting CD-ROM block size via device options

2022-09-25 Thread John Millikin
Gentle ping again. I'd really like to get this ~6 line patch into mainline so I can pop it off my TODO list. On Mon, Sep 12, 2022 at 04:54:52PM +0900, John Millikin wrote: > Gentle ping -- is there anything blocking this patch from going in? > > It's been about a month now since I sent it, and

Re: [PATCH 2/2] target/riscv: rvv-1.0: vf[w]redsum distinguish between ordered/unordered

2022-09-25 Thread Alistair Francis
On Thu, Aug 18, 2022 at 1:43 AM Yang Liu wrote: > > Starting with RVV1.0, the original vf[w]redsum_vs instruction was renamed > to vf[w]redusum_vs. The distinction between ordered and unordered is also > more consistent with other instructions, although there is no difference > in implementation

[PATCH] ui/vnc-clipboard: fix integer underflow in vnc_client_cut_text_ext

2022-09-25 Thread Mauro Matteo Cascella
Extended ClientCutText messages start with a 4-byte header. If len < 4, an integer underflow occurs in vnc_client_cut_text_ext. The result is used to decompress data in a while loop in inflate_buffer, leading to CPU consumption and denial of service. Prevent this by checking dlen in

Re: [PATCH v3 06/54] tests/qtest: aspeed_smc-test: Avoid using hardcoded /tmp

2022-09-25 Thread Cédric Le Goater
On 9/25/22 13:29, Bin Meng wrote: 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: Cédric Le Goater Thanks, C. --- Changes in v3: - Split to a

[PATCH 1/2] linux-user: handle /proc/self/exe with execve() syscall

2022-09-25 Thread Laurent Vivier
If path is /proc/self/exe, use the executable file descriptor provided by binfmt_misc (or opened by main()) with execveat(). Signed-off-by: Laurent Vivier --- linux-user/main.c | 9 +++-- linux-user/syscall.c| 9 - linux-user/user-internals.h | 1 + 3 files

[PATCH 0/2] linux-user: handle /proc/self/exe with execve() syscall

2022-09-25 Thread Laurent Vivier
Use execfd to re-exectute the binary from /proc/self/exe Fix do_openat() that should not use execfd. Laurent Vivier (2): linux-user: handle /proc/self/exe with execve() syscall linux-user: don't use AT_EXECFD in do_openat() linux-user/main.c | 9 +++-- linux-user/syscall.c

[PATCH 2/2] linux-user: don't use AT_EXECFD in do_openat()

2022-09-25 Thread Laurent Vivier
AT_EXECFD gives access to the binary file even if it is not readable (only executable). Moreover it can be opened with flags and mode that are not the ones provided by do_openat() caller. And finally the caller can close the file descriptor whereas we can need it with execveat(). To avoid that,

Re: [PATCH v3 02/12] linux-user: Add missing clock_gettime64() syscall strace

2022-09-25 Thread Helge Deller
On 9/25/22 17:58, Laurent Vivier wrote: Le 25/09/2022 à 17:53, Helge Deller a écrit : On 9/25/22 17:47, Laurent Vivier wrote: Le 25/09/2022 à 17:27, Helge Deller a écrit : On 9/25/22 17:09, Laurent Vivier wrote: Le 18/09/2022 à 21:45, Helge Deller a écrit : Allow linux-user to strace the

Re: [PATCH v3 02/12] linux-user: Add missing clock_gettime64() syscall strace

2022-09-25 Thread Laurent Vivier
Le 25/09/2022 à 17:53, Helge Deller a écrit : On 9/25/22 17:47, Laurent Vivier wrote: Le 25/09/2022 à 17:27, Helge Deller a écrit : On 9/25/22 17:09, Laurent Vivier wrote: Le 18/09/2022 à 21:45, Helge Deller a écrit : Allow linux-user to strace the clock_gettime64() syscall. This syscall is

Re: [PATCH 2/7] linux-user: Add proper strace format strings for getdents()/getdents64()

2022-09-25 Thread Laurent Vivier
Le 24/09/2022 à 13:44, Helge Deller a écrit : Signed-off-by: Helge Deller --- linux-user/strace.list | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/strace.list b/linux-user/strace.list index da8c1bf34e..bfef568d18 100644 --- a/linux-user/strace.list +++

Re: [PATCH v3 02/12] linux-user: Add missing clock_gettime64() syscall strace

2022-09-25 Thread Helge Deller
On 9/25/22 17:47, Laurent Vivier wrote: Le 25/09/2022 à 17:27, Helge Deller a écrit : On 9/25/22 17:09, Laurent Vivier wrote: Le 18/09/2022 à 21:45, Helge Deller a écrit : Allow linux-user to strace the clock_gettime64() syscall. This syscall is used a lot on 32-bit guest architectures which

Re: [PATCH 1/7] linux-user: Fix TARGET_PROT_SEM for XTENSA

2022-09-25 Thread Laurent Vivier
Le 24/09/2022 à 13:44, Helge Deller a écrit : The xtensa platform has a value of 0x10 for PROT_SEM. Signed-off-by: Helge Deller --- linux-user/syscall_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index

Re: [PATCH v3 02/12] linux-user: Add missing clock_gettime64() syscall strace

2022-09-25 Thread Laurent Vivier
Le 25/09/2022 à 17:27, Helge Deller a écrit : On 9/25/22 17:09, Laurent Vivier wrote: Le 18/09/2022 à 21:45, Helge Deller a écrit : Allow linux-user to strace the clock_gettime64() syscall. This syscall is used a lot on 32-bit guest architectures which use newer glibc versions. Signed-off-by:

Re: [PATCH v3 11/12] linux-user: Add close_range() syscall

2022-09-25 Thread Laurent Vivier
Le 18/09/2022 à 21:45, Helge Deller a écrit : Signed-off-by: Helge Deller --- linux-user/strace.list | 3 +++ linux-user/syscall.c | 16 2 files changed, 19 insertions(+) diff --git a/linux-user/strace.list b/linux-user/strace.list index 215d971b2a..ad9ef94689 100644

Re: [PATCH v3 10/12] linux-user: Show timespec on strace for futex()

2022-09-25 Thread Laurent Vivier
Le 18/09/2022 à 21:45, Helge Deller a écrit : Signed-off-by: Helge Deller --- linux-user/strace.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 6f818212d5..b6b9abaea4 100644 --- a/linux-user/strace.c +++

Re: [PATCH v3 09/12] linux-user: Add strace for clock_nanosleep()

2022-09-25 Thread Laurent Vivier
Le 18/09/2022 à 21:45, Helge Deller a écrit : Signed-off-by: Helge Deller --- linux-user/strace.c| 15 +++ linux-user/strace.list | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) Reviewed-by: Laurent Vivier

Re: [PATCH v3 07/12] linux-user: Fix strace of chmod() if mode == 0

2022-09-25 Thread Laurent Vivier
Le 18/09/2022 à 21:45, Helge Deller a écrit : If the mode parameter of chmod() is zero, this value isn't shown when stracing a program: chmod("filename",) This patch fixes it up to show the zero-value as well: chmod("filename",000) Signed-off-by: Helge Deller ---

Re: [PATCH v3 06/12] linux-user/hppa: Dump IIR on register dump

2022-09-25 Thread Laurent Vivier
Le 18/09/2022 à 21:45, Helge Deller a écrit : Include the IIR register (which holds the opcode of the failing instruction) when dumping the hppa registers. Signed-off-by: Helge Deller --- target/hppa/helper.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) Reviewed-by:

Re: [PATCH v3 02/12] linux-user: Add missing clock_gettime64() syscall strace

2022-09-25 Thread Helge Deller
On 9/25/22 17:09, Laurent Vivier wrote: Le 18/09/2022 à 21:45, Helge Deller a écrit : Allow linux-user to strace the clock_gettime64() syscall. This syscall is used a lot on 32-bit guest architectures which use newer glibc versions. Signed-off-by: Helge Deller ---   linux-user/strace.c    |

Re: [PATCH v3 05/12] linux-user/hppa: Use EXCP_DUMP() to show enhanced debug info

2022-09-25 Thread Laurent Vivier
Le 18/09/2022 à 21:45, Helge Deller a écrit : Enhance the hppa linux-user cpu_loop() to show more debugging info on hard errors. Signed-off-by: Helge Deller --- linux-user/hppa/cpu_loop.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) Reviewed-by: Laurent Vivier

Re: [PATCH v3 04/12] linux-user: Log failing executable in EXCP_DUMP()

2022-09-25 Thread Laurent Vivier
Le 18/09/2022 à 21:45, Helge Deller a écrit : Enhance the EXCP_DUMP() macro to print out the failing program too. During debugging it's sometimes hard to track down the actual failing program if you are e.g. building a whole debian package. Signed-off-by: Helge Deller ---

Re: [PATCH v3 03/12] linux-user: Add pidfd_open(), pidfd_send_signal() and pidfd_getfd() syscalls

2022-09-25 Thread Laurent Vivier
Le 18/09/2022 à 21:45, Helge Deller a écrit : I noticed those were missing when running the glib2.0 testsuite. Add the syscalls including the strace output. Signed-off-by: Helge Deller --- linux-user/strace.c| 28 linux-user/strace.list | 9 +

Re: [PATCH v3 02/12] linux-user: Add missing clock_gettime64() syscall strace

2022-09-25 Thread Laurent Vivier
Le 18/09/2022 à 21:45, Helge Deller a écrit : Allow linux-user to strace the clock_gettime64() syscall. This syscall is used a lot on 32-bit guest architectures which use newer glibc versions. Signed-off-by: Helge Deller --- linux-user/strace.c| 53

Re: [PATCH v3 01/12] linux-user: Add missing signals in strace output

2022-09-25 Thread Laurent Vivier
Le 18/09/2022 à 21:45, Helge Deller a écrit : Some of the guest signal numbers are currently not converted to their representative names in the strace output, e.g. SIGVTALRM. This patch introduces a smart way to generate and keep in sync the host-to-guest and guest-to-host signal conversion

Re: [PATCH 1/2] target/m68k: increase size of m68k CPU features from uint32_t to uint64_t

2022-09-25 Thread Philippe Mathieu-Daudé via
On Sun, Sep 25, 2022 at 3:53 PM Mark Cave-Ayland wrote: > > There are already 32 feature bits in use, so change the size of the m68k > CPU features to uint64_t (along with the associated m68k_feature() > functions) to allow up to 64 feature bits to be used. > > At the same time make use of the

[PATCH] qemu-nbd: set timeout to qemu-nbd socket

2022-09-25 Thread luzhipeng
From: lu zhipeng Prevent the NBD socket stuck all the time, So set timeout. Signed-off-by: lu zhipeng --- nbd/client.c | 8 1 file changed, 8 insertions(+) diff --git a/nbd/client.c b/nbd/client.c index 30d5383cb1..89dde53a0f 100644 --- a/nbd/client.c +++ b/nbd/client.c @@ -24,6

[PATCH 2/2] target/m68k: use M68K_FEATURE_MOVEFROMSR_PRIV feature for move_from_sr privilege check

2022-09-25 Thread Mark Cave-Ayland
Now that M68K_FEATURE_M68000 has been renamed to M68K_FEATURE_M68K it is easier to see that the privilege exception check is wrong: it is currently only generated for ColdFire CPUs when in fact it should also be generated for Motorola CPUs from the 68010 onwards. Introduce a new

[PATCH 1/2] target/m68k: increase size of m68k CPU features from uint32_t to uint64_t

2022-09-25 Thread Mark Cave-Ayland
There are already 32 feature bits in use, so change the size of the m68k CPU features to uint64_t (along with the associated m68k_feature() functions) to allow up to 64 feature bits to be used. At the same time make use of the BIT_ULL() macro when reading/writing the CPU feature bits to improve

Re: [PATCH 2/4] hw/intc: sifive_plic.c: Fix interrupt priority index.

2022-09-25 Thread Jim Shu
Hi Tyler, This fix is incorrect. In PLIC spec, Interrupt Source Priority Memory Map is 0x00: Reserved (interrupt source 0 does not exist) 0x04: Interrupt source 1 priority 0x08: Interrupt source 2 priority Current RISC-V machines (virt, sifive_u) use 0x4 as priority_base, so current

[PATCH 0/2] target/m68k: MacOS supervisor/user mode switch fixes - part 2

2022-09-25 Thread Mark Cave-Ayland
Here are the two outstanding patches from https://lists.gnu.org/archive/html/qemu-devel/2022-09/msg02340.html updated and rebased onto git master. Patch 1 is equivalent to patch 2 in the original series but using BIT_ULL() to set and clear the feature bits, and updating m68k_feature() to return a

[PATCH] hw/intc: sifive_plic: fix hard-coded max priority level

2022-09-25 Thread Jim Shu
The maximum priority level is hard-coded when writing to interrupt priority register. However, when writing to priority threshold register, the maximum priority level is from num_priorities Property which is configured by platform. Also change interrupt priority register to use num_priorities

Re: [PATCH v1 1/9] hw: encode accessing CPU index in MemTxAttrs

2022-09-25 Thread Alex Bennée
Richard Henderson writes: > On 9/22/22 14:58, Alex Bennée wrote: >> We currently have hacks across the hw/ to reference current_cpu to >> work out what the current accessing CPU is. This breaks in some cases >> including using gdbstub to access HW state. As we have MemTxAttrs to >> describe

[PATCH v3 0/2] Re: hw/ide/piix: Ignore writes of hardwired PCI command register bits

2022-09-25 Thread Lev Kujawski
> On Tue, Sep 06, 2022 at 10:23:57AM -0400, Michael S. Tsirkin wrote: > > On Thu, Jun 02, 2022 at 08:47:31PM +, Lev Kujawski wrote: > > > --- > > > This revised patch uses QEMU's built-in PCI bit-masking support rather > > > than attempting to manually filter writes. Thanks to Philippe

[PATCH v3 1/2] qpci_device_enable: Allow for command bits hardwired to 0

2022-09-25 Thread Lev Kujawski
Devices like the PIIX3/4 IDE controller do not support certain modes of operation, such as memory space accesses, and indicate this lack of support by hardwiring the applicable bits to zero. Extend the QEMU PCI device testing framework to accommodate such devices. * tests/qtest/libqos/pci.h: Add

[PATCH v3 2/2] hw/ide/piix: Ignore writes of hardwired PCI command register bits

2022-09-25 Thread Lev Kujawski
One method to enable PCI bus mastering for IDE controllers, often used by x86 firmware, is to write 0x7 to the PCI command register. Neither the PIIX3 specification nor actual hardware (a Tyan S1686D system) permit modification of the Memory Space Enable (MSE) bit, 1, and thus the command

[PATCH v2 12/13] hw/ppc/mac.h: Rename to include/hw/nvram/mac_nvram.h

2022-09-25 Thread BALATON Zoltan
All that is left in mac.h now belongs to the nvram emulation so rename it accordingly and only include it where it is really used. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland --- MAINTAINERS | 1 + hw/ide/macio.c |

[PATCH v2 09/13] hw/ppc/mac.h: Move macio specific parts out from shared header

2022-09-25 Thread BALATON Zoltan
Move the parts specific to and only used by macio out from the shared mac.h into macio.c where they better belong. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé --- hw/misc/macio/macio.c | 5 +++-- hw/ppc/mac.h | 23 ---

[PATCH v2 06/13] mac_newworld: Simplify creation of Uninorth devices

2022-09-25 Thread BALATON Zoltan
Avoid open coding sysbus_mmio_map() and map regions in ascending otder. Reorganise code a bit to avoid some casts. Signed-off-by: BALATON Zoltan --- hw/ppc/mac_newworld.c | 42 +- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git

[PATCH v2 08/13] hw/ppc/mac.h: Move newworld specific parts out from shared header

2022-09-25 Thread BALATON Zoltan
Move the parts specific to and only used by mac99 out from the shared mac.h into mac_newworld.c where they better belong. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland --- hw/ppc/mac.h | 24 hw/ppc/mac_newworld.c | 19 +++

Re: [PATCH v3 38/54] tests/qtest: bios-tables-test: Adapt the case for win32

2022-09-25 Thread Michael S. Tsirkin
On Sun, Sep 25, 2022 at 07:30:16PM +0800, Bin Meng wrote: > From: Bin Meng > > Single quotes in the arguments (oem_id='CRASH ') are not removed in > the Windows environment before it is passed to the QEMU executable. > The space in the argument causes the "-acpitable" option parser to > think

[PATCH v2 13/13] mac_nvram: Use NVRAM_SIZE constant

2022-09-25 Thread BALATON Zoltan
The NVRAM_SIZE constant was defined but not used. Rename it to MACIO_NVRAM_SIZE to match the device model and use it where appropriate. Signed-off-by: BALATON Zoltan --- hw/misc/macio/macio.c| 2 +- hw/ppc/mac_newworld.c| 4 ++-- include/hw/nvram/mac_nvram.h | 3 +-- 3 files

[PATCH v2 11/13] hw/ppc/mac.h: Move PROM and KERNEL defines to board code

2022-09-25 Thread BALATON Zoltan
The PROM_FILENAME and KERNEL_* defines are used by mac_oldworld and mac_newworld but they don't have to be identical so these could be moved to the individual boards. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland --- hw/ppc/mac.h | 4

[PATCH v2 03/13] mac_{old|new}world: Set tbfreq at declaration

2022-09-25 Thread BALATON Zoltan
The tbfreq variable is only set once in an if-else which can be done at the variable declaration saving some lines of code and making it simpler. Signed-off-by: BALATON Zoltan --- hw/ppc/mac_newworld.c | 9 + hw/ppc/mac_oldworld.c | 9 + 2 files changed, 2 insertions(+), 16

[PATCH v2 10/13] hw/ppc/mac.h: Move grackle-pcihost declaration out from shared header

2022-09-25 Thread BALATON Zoltan
It is only used by mac_oldworld anyway and it already instantiates a few devices by name so this allows reducing the shared header further. Signed-off-by: BALATON Zoltan --- hw/pci-host/grackle.c | 1 + hw/ppc/mac.h | 3 --- hw/ppc/mac_oldworld.c | 2 +- 3 files changed, 2

[PATCH v2 01/13] mac_newworld: Drop some variables

2022-09-25 Thread BALATON Zoltan
Values not used frequently enough may not worth putting in a local variable, especially with names almost as long as the original value because that does not improve readability, to the contrary it makes it harder to see what value is used. Drop a few such variables. This is the same clean up that

[PATCH v2 02/13] mac_oldworld: Drop some more variables

2022-09-25 Thread BALATON Zoltan
Drop some more local variables additionally to commit b8df32555ce5 to match clean ups done to mac_newwold in previous patch. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland --- hw/ppc/mac_oldworld.c | 43

[PATCH v2 07/13] mac_{old|new}world: Reduce number of QOM casts

2022-09-25 Thread BALATON Zoltan
By storing the device pointers in a variable with the right type the number of QOM casts can be reduced which also makes the code more readable. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland --- hw/ppc/mac_newworld.c | 61

[PATCH v2 00/13] Misc ppc/mac machines clean up

2022-09-25 Thread BALATON Zoltan
This series includes some clean ups to mac_newworld and mac_oldworld to make them a bit simpler and more readable, It also removes the shared mac.h file that turns out was more of a random collection of unrelated things. Getting rid of this mac.h improves the locality of device models and reduces

[PATCH v3 45/54] tests/qtest: libqtest: Replace the call to close a socket with closesocket()

2022-09-25 Thread Bin Meng
From: Bin Meng close() is a *nix function. It works on any file descriptor, and sockets in *nix are an example of a file descriptor. closesocket() is a Windows-specific function, which works only specifically with sockets. Sockets on Windows do not use *nix-style file descriptors, and socket()

[PATCH v2 05/13] mac_oldworld: Do not open code sysbus_mmio_map()

2022-09-25 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- hw/ppc/mac_oldworld.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index cb67e44081..75fbd2a7df 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -218,16 +218,12 @@

[PATCH v3 54/54] docs/devel: testing: Document writing portable test cases

2022-09-25 Thread Bin Meng
From: Bin Meng Update the best practices of how to write portable test cases that can be built and run successfully on both Linux and Windows hosts. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v3) Changes in v2: - Minor wording changes - Drop patches that

[PATCH v3 44/54] tests/qtest: microbit-test: Fix socket access for win32

2022-09-25 Thread Bin Meng
From: Bin Meng Sockets on Windows do not use *nix-style file descriptors, so write()/read()/close() do not work on Windows. Switch over to use send()/recv()/closesocket() which work with sockets on all platforms. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since

[PATCH v2 04/13] mac_{old|new}world: Avoid else branch by setting default value

2022-09-25 Thread BALATON Zoltan
Several variables are set in if-else branches where the else branch can be removed by setting a default value at the variable declaration which leads to simlpler code that is easier to follow. Signed-off-by: BALATON Zoltan --- hw/ppc/mac_newworld.c | 19 ---

[PATCH v3 52/54] .gitlab-ci.d/windows.yml: Display meson test logs

2022-09-25 Thread Bin Meng
From: Bin Meng When CI fails we don't know what causes the failure. Displaying the meson test logs can be helpful. Signed-off-by: Bin Meng --- (no changes since v2) Changes in v2: - new patch: Display meson test logs in the Windows CI .gitlab-ci.d/windows.yml | 4 ++-- 1 file changed, 2

[PATCH v3 42/54] chardev/char-file: Add FILE_SHARE_WRITE when opening the file for win32

2022-09-25 Thread Bin Meng
From: Xuzhou Cheng The combination of GENERIC_WRITE and FILE_SHARE_READ options does not allow the same file to be opened again by CreateFile() from another QEMU process with the same options when the previous QEMU process still holds the file handle opened. This was triggered by running the

[PATCH v3 53/54] tests/qtest: Enable qtest build on Windows

2022-09-25 Thread Bin Meng
From: Bin Meng Now that we have fixed various test case issues as seen when running on Windows, let's enable the qtest build on Windows. Signed-off-by: Bin Meng --- Changes in v3: - Drop the host test Changes in v2: - new patch: "tests/qtest: Enable qtest build on Windows"

[PATCH v3 51/54] .gitlab-ci.d/windows.yml: Increase the timeout to 90 minutes

2022-09-25 Thread Bin Meng
From: Bin Meng commit 9f8e6cad65a6 ("gitlab-ci: Speed up the msys2-64bit job by using --without-default-devices" changed to compile QEMU with the --without-default-devices switch for the msys2-64bit job, due to the build could not complete within the project timeout (1h), and also mentioned

[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 --- (no changes since

[PATCH v3 48/54] io/channel-watch: Drop the unnecessary cast

2022-09-25 Thread Bin Meng
From: Bin Meng There is no need to do a type cast on ssource->socket as it is already declared as a SOCKET. Suggested-by: Marc-André Lureau Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v2) Changes in v2: - new patch: "io/channel-watch: Drop the unnecessary

[PATCH v3 50/54] tests/qtest: migration-test: Skip running some TLS cases for win32

2022-09-25 Thread Bin Meng
From: Bin Meng Some migration test cases use TLS to communicate, but they fail on Windows with the following error messages: qemu-system-x86_64: TLS handshake failed: Insufficient credentials for that request. qemu-system-x86_64: TLS handshake failed: Error in the pull function.

[PATCH v3 30/54] tests/qtest: qmp-test: Skip running test_qmp_oob for win32

2022-09-25 Thread Bin Meng
From: Bin Meng The test_qmp_oob test case calls mkfifo() which does not exist on win32. Exclude it. Signed-off-by: Bin Meng Reviewed-by: Thomas Huth --- (no changes since v2) Changes in v2: - Add a comment in the code to explain why test_qmp_oob test case is skipped on win32

[PATCH v3 47/54] io/channel-watch: Drop a superfluous '#ifdef WIN32'

2022-09-25 Thread Bin Meng
From: Bin Meng In the win32 version qio_channel_create_socket_watch() body there is no need to do a '#ifdef WIN32'. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v1) io/channel-watch.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/io/channel-watch.c

[PATCH v3 41/54] tests/qtest: virtio-net-failover: Disable migration tests for win32

2022-09-25 Thread Bin Meng
From: Xuzhou Cheng These tests use the exec migration protocol, which is unsupported on Windows as of today. Disable these tests for now. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v1) tests/qtest/virtio-net-failover.c | 9

[PATCH v3 26/54] fsdev/virtfs-proxy-helper: Use g_mkdir()

2022-09-25 Thread Bin Meng
From: Bin Meng Use g_mkdir() to create a directory on all platforms. Signed-off-by: Bin Meng Reviewed-by: Christian Schoenebeck --- (no changes since v2) Changes in v2: - Change to use g_mkdir() fsdev/virtfs-proxy-helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[PATCH v3 46/54] tests/qtest: libqtest: Correct the timeout unit of blocking receive calls for win32

2022-09-25 Thread Bin Meng
From: Bin Meng Some qtest cases don't get response from the QEMU executable under test in time on Windows. It turns out that the socket receive call got timeout before it receive the complete response. The timeout value is supposed to be set to 50 seconds via the setsockopt() call, but there is

[PATCH v3 38/54] tests/qtest: bios-tables-test: Adapt the case for win32

2022-09-25 Thread Bin Meng
From: Bin Meng Single quotes in the arguments (oem_id='CRASH ') are not removed in the Windows environment before it is passed to the QEMU executable. The space in the argument causes the "-acpitable" option parser to think that all of its parameters are done, hence it complains: '-acpitable'

[PATCH v3 49/54] io/channel-watch: Fix socket watch on Windows

2022-09-25 Thread Bin Meng
From: Bin Meng Random failure was observed when running qtests on Windows due to "Broken pipe" detected by qmp_fd_receive(). What happened is that the qtest executable sends testing data over a socket to the QEMU under test but no response is received. The errno of the recv() call from the qtest

[PATCH v3 18/54] tests/qtest: vhost-user-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_dir_make_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch - Ensure g_autofree variable is initialized

[PATCH v3 36/54] tests/qtest: Support libqtest to build and run on Windows

2022-09-25 Thread Bin Meng
From: Bin Meng At present the libqtest codes were written to depend on several POSIX APIs, including fork(), kill() and waitpid(). Unfortunately these APIs are not available on Windows. This commit implements the corresponding functionalities using win32 native APIs. With this change, all qtest

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

2022-09-25 Thread Bin Meng
From: Xuzhou Cheng By default Windows opens file in text mode, while a POSIX compliant implementation treats text files and binary files the same. The fopen() 'mode' string can include the letter 'b' to indicate binary mode shall be used. POSIX spec says the character 'b' shall have no effect,

[PATCH v3 34/54] tests/qtest: libqtest: Exclude the *_fds APIs for win32

2022-09-25 Thread Bin Meng
From: Bin Meng libqmp.c::qmp_fd_vsend_fds() is not available on Windows, hence any APIs in libqtest that call libqmp.c::qmp_fd_vsend_fds() should be excluded for win32 too. This includes the following: * qtest_qmp_vsend_fds() * qtest_vqmp_fds() * qtest_qmp_fds() * qtest_qmp_add_client()

[PATCH v3 39/54] tests/qtest: migration-test: Disable IO redirection for win32

2022-09-25 Thread Bin Meng
From: Bin Meng On Windows the QEMU executable is created via CreateProcess() and IO redirection does not work, so don't bother adding IO redirection to the command line. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v2) Changes in v2: - Change the place that

[PATCH v3 20/54] tests/qtest: virtio-scsi-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

[PATCH v3 43/54] tests/qtest: migration-test: Make sure QEMU process "to" exited after migration is canceled

2022-09-25 Thread Bin Meng
From: Xuzhou Cheng Make sure QEMU process "to" exited before launching another target for migration in the test_multifd_tcp_cancel case. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng --- Changes in v3: - Add a usleep(1) in the busy wait loop Changes in v2: - Change to a busy wait

[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 33/54] tests/qtest: Use send/recv for socket communication

2022-09-25 Thread Bin Meng
From: Xuzhou Cheng Socket communication in the libqtest and libqmp codes uses read() and write() which work on any file descriptor on *nix, and sockets in *nix are an example of a file descriptor. However sockets on Windows do not use *nix-style file descriptors, so read() and write() cannot be

[PATCH v3 31/54] accel/qtest: Implement a portable qtest accelerator

2022-09-25 Thread Bin Meng
From: Xuzhou Cheng Currently signal SIGIPI [=SIGUSR1] is used to kick the dummy CPU when qtest accelerator is used. However SIGUSR1 is unsupported on Windows. To support Windows, we add a QemuSemaphore CPUState::sem to kick the dummy CPU instead. As a result of this, the POSIX implementation

[PATCH v3 15/54] tests/qtest: pflash-cfi02-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/pflash-cfi02-test.c | 8 +--- 1 file changed, 5

[PATCH v3 35/54] tests/qtest: libqtest: Install signal handler via signal()

2022-09-25 Thread Bin Meng
From: Bin Meng At present the codes uses sigaction() to install signal handler with a flag SA_RESETHAND. Such usage can be covered by the signal() API that is a simplified interface to the general sigaction() facility. Update to use signal() to install the signal handler, as it is available on

[PATCH v3 27/54] hw/usb: dev-mtp: Use g_mkdir()

2022-09-25 Thread Bin Meng
From: Bin Meng Use g_mkdir() to create a directory on all platforms. Signed-off-by: Bin Meng Acked-by: Gerd Hoffmann --- (no changes since v2) Changes in v2: - Change to use g_mkdir() hw/usb/dev-mtp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/usb/dev-mtp.c

[PATCH v3 29/54] tests/qtest: Build test-filter-{mirror, redirector} cases for posix only

2022-09-25 Thread Bin Meng
From: Bin Meng The test-filter-{mirror,redirector} cases use socketpair() API that is only available on POSIX and should only be built for POSIX. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v2) Changes in v2: - Introduce a new variable qtests_filter and add

[PATCH v3 32/54] tests/qtest: libqtest: Adapt global_qtest declaration for win32

2022-09-25 Thread Bin Meng
From: Xuzhou Cheng Commit dd2107497275 ("tests/libqtest: Use libqtest-single.h in tests that require global_qtest") moved global_qtest to libqtest-single.h, by declaring global_qtest attribute to be common and weak. This trick unfortunately does not work on Windows, and building qtest test

[PATCH v3 17/54] tests/qtest: vhost-user-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_get_tmp_dir() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch tests/qtest/vhost-user-blk-test.c | 3 ++- 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 24/54] tests: vhost-user-bridge: 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/vhost-user-bridge.c | 3 +-- 1 file changed, 1 insertion(+),

[PATCH v3 12/54] tests/qtest: hd-geo-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 - Use g_steal_pointer()

[PATCH v3 23/54] tests/unit: test-qga: 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_get_tmp_dir() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch tests/unit/test-qga.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v3 28/54] tests/qtest: Skip running virtio-net-test cases that require socketpair() for win32

2022-09-25 Thread Bin Meng
From: Bin Meng Some of the virtio-net-test test cases require socketpair() to do the test setup. Skip them for win32. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v2) Changes in v2: - Change to skip only part of the virtio-net-test cases that require

[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 08/54] tests/qtest: cxl-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_dir_make_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/cxl-test.c |

[PATCH v3 21/54] tests/qtest: libqtest: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng The qtest library was written to use hardcoded /tmp directory for temporary files. Update to use g_get_tmp_dir() and g_dir_make_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch - Ensure g_autofree variable is

[PATCH v3 14/54] tests/qtest: migration-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_dir_make_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch tests/qtest/migration-test.c | 7 --- 1 file changed, 4

[PATCH v3 16/54] tests/qtest: qmp-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_dir_make_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch tests/qtest/qmp-test.c | 6 -- 1 file changed, 4 insertions(+),

[PATCH v3 06/54] tests/qtest: aspeed_smc-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

[PATCH v3 22/54] tests/unit: test-image-locking: 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

[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 04/54] util/qemu-sockets: Use g_get_tmp_dir() to get the directory for temporary files

2022-09-25 Thread Bin Meng
From: Bin Meng Replace the existing logic to get the directory for temporary files with g_get_tmp_dir(), which works for win32 too. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v1) util/qemu-sockets.c | 5 ++--- 1 file changed, 2 insertions(+), 3

[PATCH v3 03/54] tcg: Avoid using hardcoded /tmp

2022-09-25 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 Reviewed-by: Marc-André Lureau Reviewed-by: Alex Bennée --- (no changes since v2) Changes in v2: - Use g_autofree to declare the variable tcg/tcg.c | 3 ++- 1 file changed, 2

[PATCH v3 07/54] tests/qtest: boot-serial-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

  1   2   >