Re: [PATCH 08/12] tests/qemu-iotests: introduce filter for qemu-nbd export list

2022-03-04 Thread Eric Blake
On Thu, Mar 03, 2022 at 04:03:26PM +, Daniel P. Berrangé wrote: > Introduce a filter for the output of qemu-nbd export list so it can be > reused in multiple tests. > > The filter is a bit more permissive that what test 241 currently uses, > as its allows printing of the export count, along

[PULL 49/50] block/amend: Always call .bdrv_amend_clean()

2022-03-04 Thread Kevin Wolf
From: Hanna Reitz .bdrv_amend_clean() says block drivers can use it to clean up what was done in .bdrv_amend_pre_run(). Therefore, it should always be called after .bdrv_amend_pre_run(), which means we need it to call it in the JobDriver.free() callback, not in JobDriver.clean().

[PULL 36/50] block/copy-before-write.h: global state API + assertions

2022-03-04 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito copy-before-write functions always run under BQL. Signed-off-by: Emanuele Giuseppe Esposito Message-Id: <20220303151616.325444-24-eespo...@redhat.com> Signed-off-by: Kevin Wolf --- block/copy-before-write.h | 7 +++ block/copy-before-write.c | 2 ++ 2

[PATCH v2 08/12] tests/qemu-iotests: introduce filter for qemu-nbd export list

2022-03-04 Thread Daniel P . Berrangé
Introduce a filter for the output of qemu-nbd export list so it can be reused in multiple tests. The filter is a bit more permissive that what test 241 currently uses, as its allows printing of the export count, along with any possible error messages that might be emitted. Reviewed-by: Eric

[PATCH v2 06/12] tests/qemu-iotests: add QEMU_IOTESTS_REGEN=1 to update reference file

2022-03-04 Thread Daniel P . Berrangé
When developing an I/O test it is typical to add some logic to the test script, run it to view the output diff, and then apply the output diff to the reference file. This can be drastically simplified by letting the test runner update the reference file in place. By setting

[PATCH v2 04/12] qemu-nbd: add --tls-hostname option for TLS certificate validation

2022-03-04 Thread Daniel P . Berrangé
When using the --list option, qemu-nbd acts as an NBD client rather than a server. As such when using TLS, it has a need to validate the server certificate. This adds a --tls-hostname option which can be used to override the default hostname used for certificate validation. Reviewed-by: Eric

[PATCH v2 1/5] python/utils: add add_visual_margin() text decoration utility

2022-03-04 Thread John Snow
>>> print(add_visual_margin(msg, width=72, name="Commit Message")) ┏━ Commit Message ━━ ┃ add_visual_margin() takes a chunk of text and wraps it in a visual ┃ container that force-wraps to a specified width. An optional title ┃ label may be

[PATCH v2 0/5] iotests: add enhanced debugging info to qemu-img failures

2022-03-04 Thread John Snow
V2: - Rebase on top of kwolf's latest PR. - Adjust tests/graph-changes-while-io in patch 3/5 - Drop eblake's r-b on 3/5. This is secretly V4ish of a series I started in response to Thomas Huth's encountering a failure in qemu-img because of missing zstd support. This series changes the

Re: [PATCH v2 4/9] util: Return valid allocation for qemu_try_memalign() with zero size

2022-03-04 Thread Richard Henderson
On 3/4/22 01:21, Peter Maydell wrote: Currently qemu_try_memalign()'s behaviour if asked to allocate 0 bytes is rather variable: * on Windows, we will assert * on POSIX platforms, we get the underlying behaviour of the posix_memalign() or equivalent function, which may be either

Re: [PATCH v2 3/5] iotests: Remove explicit checks for qemu_img() == 0

2022-03-04 Thread Eric Blake
On Fri, Mar 04, 2022 at 02:47:44PM -0500, John Snow wrote: > qemu_img() returning zero ought to be the rule, not the > exception. Remove all explicit checks against the condition in > preparation for making non-zero returns an Exception. > > Signed-off-by: John Snow > --- > +++

Re: [PATCH v2 11/12] tests/qemu-iotests: validate NBD TLS with UNIX sockets

2022-03-04 Thread Eric Blake
On Fri, Mar 04, 2022 at 07:36:09PM +, Daniel P. Berrangé wrote: > This validates that connections to an NBD server running on a UNIX > socket can use TLS, and require a TLS hostname override to pass > certificate validation. > > Reviewed-by: Eric Blake > Signed-off-by: Daniel P. Berrangé >

[PATCH] hw/block: m25p80: Add support for w25q01jvq

2022-03-04 Thread Patrick Williams
The w25q01jvq is a 128MB part. Support is being added to the kernel[1] and the two have been tested together. 1. https://lore.kernel.org/lkml/2022022209.23108-1-potin@quantatw.com/ Signed-off-by: Patrick Williams Cc: Potin Lai --- hw/block/m25p80.c | 1 + 1 file changed, 1

Re: [PATCH] hw/block: m25p80: Add support for w25q01jvq

2022-03-04 Thread Michael Walle
Am 2022-03-04 20:30, schrieb Philippe Mathieu-Daudé: On 4/3/22 19:09, Patrick Williams wrote: The w25q01jvq is a 128MB part. Support is being added to the kernel[1] and the two have been tested together. 1. https://lore.kernel.org/lkml/2022022209.23108-1-potin@quantatw.com/

[PATCH v2 0/5] Remove qemu_gettimeofday()

2022-03-04 Thread marcandre . lureau
From: Marc-André Lureau Hi, Here is a few patches to replace qemu_gettimeofday() helper with functions provided by GLib. v2: - fix return of get-time in nanoseconds - qga: replace with a common get-time function for qga posix/win32 - split qga patch - add r-b tags, drop RFC Marc-André Lureau

[PATCH v2 2/5] qtest: replace gettimeofday with GTimer

2022-03-04 Thread marcandre . lureau
From: Marc-André Lureau glib provides a convenience helper to measure elapsed time. It isn't subject to wall-clock time changes. Note that this changes the initial OPENED time, which used to print the current time. Signed-off-by: Marc-André Lureau Reviewed-by: Laurent Vivier ---

Re: [PATCH v2 5/9] meson.build: Don't misdetect posix_memalign() on Windows

2022-03-04 Thread Philippe Mathieu-Daudé
On 4/3/22 12:21, Peter Maydell wrote: Currently we incorrectly think that posix_memalign() exists on Windows. This is because of a combination of: * the msys2/mingw toolchain/libc claim to have a __builtin_posix_memalign when there isn't a builtin of that name * meson will assume that

Re: [PATCH v2 6/9] util: Share qemu_try_memalign() implementation between POSIX and Windows

2022-03-04 Thread Richard Henderson
On 3/4/22 01:21, Peter Maydell wrote: + * platform APIs (for instance _alligned_malloc() will Typo there with the 'll'. r~

[PATCH v2 5/5] oslib: drop qemu_gettimeofday()

2022-03-04 Thread marcandre . lureau
From: Marc-André Lureau No longer used after the previous patches. Signed-off-by: Marc-André Lureau Reviewed-by: Laurent Vivier Reviewed-by: Stefan Weil Reviewed-by: Richard Henderson --- include/sysemu/os-posix.h | 3 --- include/sysemu/os-win32.h | 6 -- util/oslib-win32.c|

Re: [PATCH v2 3/5] iotests: Remove explicit checks for qemu_img() == 0

2022-03-04 Thread John Snow
On Fri, Mar 4, 2022 at 3:23 PM Eric Blake wrote: > > On Fri, Mar 04, 2022 at 02:47:44PM -0500, John Snow wrote: > > qemu_img() returning zero ought to be the rule, not the > > exception. Remove all explicit checks against the condition in > > preparation for making non-zero returns an Exception.

Re: [PATCH v2 08/12] tests/qemu-iotests: introduce filter for qemu-nbd export list

2022-03-04 Thread Eric Blake
On Fri, Mar 04, 2022 at 07:36:06PM +, Daniel P. Berrangé wrote: > Introduce a filter for the output of qemu-nbd export list so it can be > reused in multiple tests. > > The filter is a bit more permissive that what test 241 currently uses, > as its allows printing of the export count, along

[PATCH v2 1/5] m68k/nios2-semi: fix gettimeofday() result check

2022-03-04 Thread marcandre . lureau
From: Marc-André Lureau gettimeofday() returns 0 for success. Signed-off-by: Marc-André Lureau Reviewed-by: Laurent Vivier Reviewed-by: Richard Henderson --- target/m68k/m68k-semi.c | 2 +- target/nios2/nios2-semi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [PATCH 3/4] Replace qemu_gettimeofday() with g_get_real_time()

2022-03-04 Thread BALATON Zoltan
On Fri, 4 Mar 2022, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau GLib g_get_real_time() is an alternative to gettimeofday(). For semihosting, a few bits are lost on POSIX host, but this shouldn't be a big concern. Signed-off-by: Marc-André Lureau --- blockdev.c

Re: [PATCH 3/4] Replace qemu_gettimeofday() with g_get_real_time()

2022-03-04 Thread Marc-André Lureau
Hi On Sat, Mar 5, 2022 at 12:40 AM BALATON Zoltan wrote: > On Fri, 4 Mar 2022, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > GLib g_get_real_time() is an alternative to gettimeofday(). > > > > For semihosting, a few bits are lost on POSIX host, but this shouldn't > >

[PATCH v2 4/5] Replace qemu_gettimeofday() with g_get_real_time()

2022-03-04 Thread marcandre . lureau
From: Marc-André Lureau GLib g_get_real_time() is an alternative to gettimeofday() which allows to simplify our code. For semihosting, a few bits are lost on POSIX host, but this shouldn't be a big concern. Signed-off-by: Marc-André Lureau Reviewed-by: Laurent Vivier --- blockdev.c

[PATCH v2 3/5] qga: replace qemu_gettimeofday() with g_get_real_time()

2022-03-04 Thread marcandre . lureau
From: Marc-André Lureau GLib g_get_real_time() is an alternative to gettimeofday() which allows to simplify our code. Signed-off-by: Marc-André Lureau Reviewed-by: Laurent Vivier --- qga/commands-posix.c | 14 -- qga/commands-win32.c | 19 --- qga/commands.c

Re: [PATCH v2 12/12] tests/qemu-iotests: validate NBD TLS with UNIX sockets and PSK

2022-03-04 Thread Eric Blake
On Fri, Mar 04, 2022 at 07:36:10PM +, Daniel P. Berrangé wrote: > This validates that connections to an NBD server running on a UNIX > socket can use TLS with pre-shared keys (PSK). > > Reviewed-by: Eric Blake > Signed-off-by: Daniel P. Berrangé > --- > tests/qemu-iotests/233| 28

Re: [PATCH v2 0/3] block: Make bdrv_refresh_limits() non-recursive

2022-03-04 Thread Kevin Wolf
Am 16.02.2022 um 11:53 hat Hanna Reitz geschrieben: > Hi, > > v1 with detailed reasoning: > https://lists.nongnu.org/archive/html/qemu-block/2022-02/msg00508.html > > This series makes bdrv_refresh_limits() non-recursive so that it is > sufficient for callers to ensure that the node on which

Re: [PATCH v2 1/4] os-posix: Add os_set_daemonize()

2022-03-04 Thread Kevin Wolf
Am 04.03.2022 um 10:19 hat Daniel P. Berrangé geschrieben: > On Thu, Mar 03, 2022 at 05:48:11PM +0100, Hanna Reitz wrote: > > The daemonizing functions in os-posix (os_daemonize() and > > os_setup_post()) only daemonize the process if the static `daemonize` > > variable is set. Right now, it can

Re: [PATCH v6 00/16] Make image fleecing more usable

2022-03-04 Thread Hanna Reitz
On 03.03.22 20:43, Vladimir Sementsov-Ogievskiy wrote: v6: 11: add comment 15: limit to qcow2 with unsupported compat fix style 16: fix style change log('Backup finished ...') to assertion and comment Thanks a lot! Applied to my block branch:

Re: [PATCH v3 0/4] Enable vhost-user to be used on BSD systems

2022-03-04 Thread Michael S. Tsirkin
On Thu, Mar 03, 2022 at 12:59:07PM +0100, Sergio Lopez wrote: > Since QEMU is already able to emulate ioeventfd using pipefd, we're already > pretty close to supporting vhost-user on non-Linux systems. > > This two patches bridge the gap by: > > 1. Adding a new event_notifier_get_wfd() to return

Re: [PATCH v3 4/4] docs: vhost-user: add subsection for non-Linux platforms

2022-03-04 Thread Sergio Lopez
On Fri, Mar 04, 2022 at 05:35:01AM -0500, Michael S. Tsirkin wrote: > On Thu, Mar 03, 2022 at 12:59:11PM +0100, Sergio Lopez wrote: > > Add a section explaining how vhost-user is supported on platforms > > other than Linux. > > > > Signed-off-by: Sergio Lopez > > --- > >

Re: [PATCH v2 0/4] qsd: Add --daemonize; and add job quit tests

2022-03-04 Thread Kevin Wolf
Am 03.03.2022 um 17:48 hat Hanna Reitz geschrieben: > Hi, > > v1 cover letter: > > https://lists.nongnu.org/archive/html/qemu-block/2021-12/msg00499.html > > > In v2, I followed Vladimir’s suggestion to look into whether we could > reuse os_daemonize(). Indeed we can, and it makes patch 3

Re: [PATCH v2 1/4] os-posix: Add os_set_daemonize()

2022-03-04 Thread Daniel P . Berrangé
On Thu, Mar 03, 2022 at 05:48:11PM +0100, Hanna Reitz wrote: > The daemonizing functions in os-posix (os_daemonize() and > os_setup_post()) only daemonize the process if the static `daemonize` > variable is set. Right now, it can only be set by os_parse_cmd_args(). > > In order to use

[PATCH v4 0/4] Enable vhost-user to be used on BSD systems

2022-03-04 Thread Sergio Lopez
Since QEMU is already able to emulate ioeventfd using pipefd, we're already pretty close to supporting vhost-user on non-Linux systems. This two patches bridge the gap by: 1. Adding a new event_notifier_get_wfd() to return wfd on the places where the peer is expected to write to the notifier.

[PATCH v4 1/4] event_notifier: add event_notifier_get_wfd()

2022-03-04 Thread Sergio Lopez
event_notifier_get_fd(const EventNotifier *e) always returns EventNotifier's read file descriptor (rfd). This is not a problem when the EventNotifier is backed by a an eventfd, as a single file descriptor is used both for reading and triggering events (rfd == wfd). But, when EventNotifier is

[PATCH v4 3/4] configure, meson: allow enabling vhost-user on all POSIX systems

2022-03-04 Thread Sergio Lopez
With the possibility of using a pipe pair via qemu_pipe() as a replacement on operating systems that doesn't support eventfd, vhost-user can also work on all POSIX systems. This change allows enabling vhost-user on all non-Windows platforms and makes libvhost_user (which still depends on eventfd)

[PATCH v4 2/4] vhost: use wfd on functions setting vring call fd

2022-03-04 Thread Sergio Lopez
When ioeventfd is emulated using qemu_pipe(), only EventNotifier's wfd can be used for writing. Use the recently introduced event_notifier_get_wfd() function to obtain the fd that our peer must use to signal the vring. Signed-off-by: Sergio Lopez Reviewed-by: Stefan Hajnoczi ---

Re: [PATCH v8 00/31] block layer: split block APIs in global state and I/O

2022-03-04 Thread Kevin Wolf
Am 03.03.2022 um 16:15 hat Emanuele Giuseppe Esposito geschrieben: > Currently, block layer APIs like block.h contain a mix of > functions that are either running in the main loop and under the > BQL, or are thread-safe functions and run in iothreads performing I/O. > The functions running under

Re: [PATCH v2 3/4] qsd: Add --daemonize

2022-03-04 Thread Kevin Wolf
Am 03.03.2022 um 17:48 hat Hanna Reitz geschrieben: > To implement this, we reuse the existing daemonizing functions from the > system emulator, which mainly do the following: > - Fork off a child process, and set up a pipe between parent and child > - The parent process waits until the child

[PATCH v4 4/4] docs: vhost-user: add subsection for non-Linux platforms

2022-03-04 Thread Sergio Lopez
Add a section explaining how vhost-user is supported on platforms other than Linux. Signed-off-by: Sergio Lopez Reviewed-by: Stefan Hajnoczi --- docs/interop/vhost-user.rst | 20 1 file changed, 20 insertions(+) diff --git a/docs/interop/vhost-user.rst

Re: [PATCH 4/9] util/oslib-win32: Return NULL on qemu_try_memalign() with zero size

2022-03-04 Thread Peter Maydell
On Thu, 3 Mar 2022 at 23:02, Richard Henderson wrote: > > On 3/3/22 06:55, Peter Maydell wrote: > >> Alternately, force size == 1, so that we always get a non-NULL value that > >> can be freed. > >> That's a change on the POSIX side as well, of course. > > > > Yes, I had a look at what actual

Re: [PATCH v3 4/4] docs: vhost-user: add subsection for non-Linux platforms

2022-03-04 Thread Michael S. Tsirkin
On Thu, Mar 03, 2022 at 12:59:11PM +0100, Sergio Lopez wrote: > Add a section explaining how vhost-user is supported on platforms > other than Linux. > > Signed-off-by: Sergio Lopez > --- > docs/interop/vhost-user.rst | 18 ++ > 1 file changed, 18 insertions(+) > > diff --git

[PATCH v2 7/9] util: Use meson checks for valloc() and memalign() presence

2022-03-04 Thread Peter Maydell
Instead of assuming that all CONFIG_BSD have valloc() and anything else is memalign(), explicitly check for those functions in meson.build and use the "is the function present" define. Tests for specific functionality are better than which-OS checks; this also lets us give a helpful error message

[PATCH v2 9/9] osdep: Move memalign-related functions to their own header

2022-03-04 Thread Peter Maydell
Move the various memalign-related functions out of osdep.h and into their own header, which we include only where they are used. While we're doing this, add some brief documentation comments. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé

[PATCH v2 6/9] util: Share qemu_try_memalign() implementation between POSIX and Windows

2022-03-04 Thread Peter Maydell
The qemu_try_memalign() functions for POSIX and Windows used to be significantly different, but these days they are identical except for the actual allocation function called, and the POSIX version already has to have ifdeffery for different allocation functions. Move to a single implementation

[PATCH v2 5/9] meson.build: Don't misdetect posix_memalign() on Windows

2022-03-04 Thread Peter Maydell
Currently we incorrectly think that posix_memalign() exists on Windows. This is because of a combination of: * the msys2/mingw toolchain/libc claim to have a __builtin_posix_memalign when there isn't a builtin of that name * meson will assume that if you have a __builtin_foo that counts

Re: [PATCH v2 1/4] os-posix: Add os_set_daemonize()

2022-03-04 Thread Daniel P . Berrangé
On Fri, Mar 04, 2022 at 11:20:39AM +0100, Kevin Wolf wrote: > Am 04.03.2022 um 10:19 hat Daniel P. Berrangé geschrieben: > > On Thu, Mar 03, 2022 at 05:48:11PM +0100, Hanna Reitz wrote: > > > The daemonizing functions in os-posix (os_daemonize() and > > > os_setup_post()) only daemonize the

[PATCH v2 1/9] hw/usb/redirect.c: Stop using qemu_oom_check()

2022-03-04 Thread Peter Maydell
qemu_oom_check() is a function which essentially says "if you pass me a NULL pointer then print a message then abort()". On POSIX systems the message includes strerror(errno); on Windows it includes the GetLastError() error value printed as an integer. Other than in the implementation of

[PATCH v2 2/9] util: Make qemu_oom_check() a static function

2022-03-04 Thread Peter Maydell
The qemu_oom_check() function, which we define in both oslib-posix.c and oslib-win32.c, is now used only locally in that file; make it static. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-id:

[PATCH v2 0/9] Cleanup of qemu_oom_check() and qemu_memalign()

2022-03-04 Thread Peter Maydell
This series does some cleanup of the qemu_oom_check() and qemu_memalign() functions; I started looking at the first of these and found myself wanting to tidy some stuff relating to the second in the process. The TLDR is that this series removes qemu_oom_check() (which was mostly being misused),

[PATCH v2 3/9] util: Unify implementations of qemu_memalign()

2022-03-04 Thread Peter Maydell
We implement qemu_memalign() in both oslib-posix.c and oslib-win32.c, but the two versions are essentially the same: they call qemu_try_memalign(), and abort() after printing an error message if it fails. The only difference is that the win32 version prints the GetLastError() value whereas the

[PATCH v2 4/9] util: Return valid allocation for qemu_try_memalign() with zero size

2022-03-04 Thread Peter Maydell
Currently qemu_try_memalign()'s behaviour if asked to allocate 0 bytes is rather variable: * on Windows, we will assert * on POSIX platforms, we get the underlying behaviour of the posix_memalign() or equivalent function, which may be either "return a valid non-NULL pointer" or "return

[PATCH v2 8/9] util: Put qemu_vfree() in memalign.c

2022-03-04 Thread Peter Maydell
qemu_vfree() is the companion free function to qemu_memalign(); put it in memalign.c so the allocation and free functions are together. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20220226180723.1706285-9-peter.mayd...@linaro.org --- util/memalign.c| 11

Re: [PATCH v2 1/3] block: Make bdrv_refresh_limits() non-recursive

2022-03-04 Thread Hanna Reitz
On 03.03.22 17:56, Kevin Wolf wrote: Am 16.02.2022 um 11:53 hat Hanna Reitz geschrieben: bdrv_refresh_limits() recurses down to the node's children. That does not seem necessary: When we refresh limits on some node, and then recurse down and were to change one of its children's BlockLimits,

[PULL 14/45] tests/qtest/libqos: Skip hotplug tests if pci root bus is not hotpluggable

2022-03-04 Thread Michael S. Tsirkin
From: Eric Auger ARM does not not support hotplug on pcie.0. Add a flag on the bus which tells if devices can be hotplugged and skip hotplug tests if the bus cannot be hotplugged. This is a temporary solution to enable the other pci tests on aarch64. Signed-off-by: Eric Auger Acked-by: Thomas

Re: [PATCH v2] tests/qemu-iotests: Rework the checks and spots using GNU sed

2022-03-04 Thread Kevin Wolf
Am 16.02.2022 um 13:54 hat Thomas Huth geschrieben: > Instead of failing the iotests if GNU sed is not available (or skipping > them completely in the check-block.sh script), it would be better to > simply skip the bash-based tests that rely on GNU sed, so that the other > tests could still be

Re: [PATCH v2 1/3] block: Make bdrv_refresh_limits() non-recursive

2022-03-04 Thread Kevin Wolf
Am 04.03.2022 um 13:44 hat Hanna Reitz geschrieben: > On 03.03.22 17:56, Kevin Wolf wrote: > > Am 16.02.2022 um 11:53 hat Hanna Reitz geschrieben: > > > bdrv_refresh_limits() recurses down to the node's children. That does > > > not seem necessary: When we refresh limits on some node, and then >

<    1   2