[PATCH v4 0/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
qemu_get_runtime_dir() returns a dynamically allocated directory path that is appropriate for storing runtime files. It corresponds to "run" directory in Unix. With a tree-wide search, it was found that there are several cases where such a functionality is implemented so let's have one as a common

[PATCH v4 1/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
qemu_get_runtime_dir() returns a dynamically allocated directory path that is appropriate for storing runtime files. It corresponds to "run" directory in Unix. With a tree-wide search, it was found that there are several cases where such a functionality is implemented so let's have one as a common

[PATCH v4 4/7] scsi: Use qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default paths. Signed-off-by: Akihiko Odaki Message-Id: <20230921075425.16738-6-akihiko.od...@daynix.com> --- scsi/qemu-pr-helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helpe

[PATCH v4 6/7] util: Remove qemu_get_local_state_dir()

2024-07-16 Thread Akihiko Odaki
There are no users of the function anymore. Signed-off-by: Akihiko Odaki Message-Id: <20230921075425.16738-8-akihiko.od...@daynix.com> --- include/qemu/osdep.h | 8 util/oslib-posix.c | 6 -- util/oslib-win32.c | 10 -- 3 files changed, 24 deletions(-) diff --git a/in

[PATCH v4 2/7] ivshmem-server: Use qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default PID file path. Signed-off-by: Akihiko Odaki Message-Id: <20230921075425.16738-3-akihiko.od...@daynix.com> --- contrib/ivshmem-server/main.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/contrib/iv

[PATCH v4 3/7] qga: Use qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default state directory. Signed-off-by: Akihiko Odaki Message-Id: <20230921075425.16738-5-akihiko.od...@daynix.com> --- qga/main.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/qga/main.c b/qga/main.c index f4d5f15bb3

[PATCH v4 7/7] spice-app: Use qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
qemu_get_runtime_dir() provides QEMU-specific fallback of runtime directory. Signed-off-by: Akihiko Odaki Message-Id: <20230921075425.16738-9-akihiko.od...@daynix.com> --- ui/spice-app.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/spice-app.c b/ui/spice-app.c index

[PATCH v4 5/7] module: Use qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the path to module upgrades. Signed-off-by: Akihiko Odaki Message-Id: <20230921075425.16738-7-akihiko.od...@daynix.com> --- util/module.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/module.c b/util/module.c index 32e26316

Re: [PATCH v4 0/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Michael Tokarev
16.07.2024 10:27, Akihiko Odaki wrote: qemu_get_runtime_dir() returns a dynamically allocated directory path that is appropriate for storing runtime files. It corresponds to "run" directory in Unix. Since runtime dir is always used with a filename within, how about char *qemu_get_runtime_pat

Re: [PATCH v4 0/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [PATCH v4 0/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
On 2024/07/16 17:06, Michael Tokarev wrote: 16.07.2024 10:27, Akihiko Odaki wrote: qemu_get_runtime_dir() returns a dynamically allocated directory path that is appropriate for storing runtime files. It corresponds to "run" directory in Unix. Since runtime dir is always used with a filename wi

Re: [PATCH v4 0/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Michael Tokarev
16.07.2024 12:32, Akihiko Odaki wrote: On 2024/07/16 17:06, Michael Tokarev wrote: Since runtime dir is always used with a filename within, how about    char *qemu_get_runtime_path(const char *filename) which return RUNTIME_DIR/filename instead of just RUNTIME_DIR ? I'm not sure. Such a fu

Re: [PATCH v4 1/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Daniel P . Berrangé
On Tue, Jul 16, 2024 at 04:27:31PM +0900, Akihiko Odaki wrote: > qemu_get_runtime_dir() returns a dynamically allocated directory path > that is appropriate for storing runtime files. It corresponds to "run" > directory in Unix. > > With a tree-wide search, it was found that there are several case

Re: [PATCH v4 0/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Daniel P . Berrangé
On Tue, Jul 16, 2024 at 11:06:57AM +0300, Michael Tokarev wrote: > 16.07.2024 10:27, Akihiko Odaki wrote: > > qemu_get_runtime_dir() returns a dynamically allocated directory path > > that is appropriate for storing runtime files. It corresponds to "run" > > directory in Unix. > > Since runtime di

Re: [PATCH v4 0/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Paolo Bonzini
On Tue, Jul 16, 2024 at 11:56 AM Daniel P. Berrangé wrote: > > On Tue, Jul 16, 2024 at 11:06:57AM +0300, Michael Tokarev wrote: > > 16.07.2024 10:27, Akihiko Odaki wrote: > > > qemu_get_runtime_dir() returns a dynamically allocated directory path > > > that is appropriate for storing runtime files

Re: [PATCH v4 1/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
On 2024/07/16 18:53, Daniel P. Berrangé wrote: On Tue, Jul 16, 2024 at 04:27:31PM +0900, Akihiko Odaki wrote: qemu_get_runtime_dir() returns a dynamically allocated directory path that is appropriate for storing runtime files. It corresponds to "run" directory in Unix. With a tree-wide search,

Re: [PATCH v4 1/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Daniel P . Berrangé
On Tue, Jul 16, 2024 at 07:52:00PM +0900, Akihiko Odaki wrote: > On 2024/07/16 18:53, Daniel P. Berrangé wrote: > > On Tue, Jul 16, 2024 at 04:27:31PM +0900, Akihiko Odaki wrote: > > > qemu_get_runtime_dir() returns a dynamically allocated directory path > > > that is appropriate for storing runtim

Re: [PATCH v4 1/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
On 2024/07/16 19:54, Daniel P. Berrangé wrote: On Tue, Jul 16, 2024 at 07:52:00PM +0900, Akihiko Odaki wrote: On 2024/07/16 18:53, Daniel P. Berrangé wrote: On Tue, Jul 16, 2024 at 04:27:31PM +0900, Akihiko Odaki wrote: qemu_get_runtime_dir() returns a dynamically allocated directory path that

Re: [PATCH v4 0/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
On 2024/07/16 19:43, Paolo Bonzini wrote: On Tue, Jul 16, 2024 at 11:56 AM Daniel P. Berrangé wrote: On Tue, Jul 16, 2024 at 11:06:57AM +0300, Michael Tokarev wrote: 16.07.2024 10:27, Akihiko Odaki wrote: qemu_get_runtime_dir() returns a dynamically allocated directory path that is appropria

Re: [PATCH v4 0/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Paolo Bonzini
On Tue, Jul 16, 2024 at 2:46 PM Akihiko Odaki wrote: > > On 2024/07/16 19:43, Paolo Bonzini wrote: > > On Tue, Jul 16, 2024 at 11:56 AM Daniel P. Berrangé > > wrote: > >> > >> On Tue, Jul 16, 2024 at 11:06:57AM +0300, Michael Tokarev wrote: > >>> 16.07.2024 10:27, Akihiko Odaki wrote: > qem

Re: [PATCH v2 1/2] block: zero data data corruption using prealloc-filter

2024-07-16 Thread Denis V. Lunev
On 7/12/24 13:55, Vladimir Sementsov-Ogievskiy wrote: On 12.07.24 12:46, Andrey Drobyshev wrote: From: "Denis V. Lunev" We have observed that some clusters in the QCOW2 files are zeroed while preallocation filter is used. We are able to trace down the following sequence when prealloc-filter i

Re: [PATCH v4 0/7] util: Introduce qemu_get_runtime_dir()

2024-07-16 Thread Akihiko Odaki
On 2024/07/16 22:29, Paolo Bonzini wrote: On Tue, Jul 16, 2024 at 2:46 PM Akihiko Odaki wrote: On 2024/07/16 19:43, Paolo Bonzini wrote: On Tue, Jul 16, 2024 at 11:56 AM Daniel P. Berrangé wrote: On Tue, Jul 16, 2024 at 11:06:57AM +0300, Michael Tokarev wrote: 16.07.2024 10:27, Akihiko Od

Re: [PATCH v2 1/2] block: zero data data corruption using prealloc-filter

2024-07-16 Thread Andrey Drobyshev
On 7/16/24 4:32 PM, Denis V. Lunev wrote: > On 7/12/24 13:55, Vladimir Sementsov-Ogievskiy wrote: >> On 12.07.24 12:46, Andrey Drobyshev wrote: >>> From: "Denis V. Lunev" >>> >>> We have observed that some clusters in the QCOW2 files are zeroed >>> while preallocation filter is used. >>> >>> We ar

[PATCH v3 1/3] block: zero data data corruption using prealloc-filter

2024-07-16 Thread Andrey Drobyshev
From: "Denis V. Lunev" We have observed that some clusters in the QCOW2 files are zeroed while preallocation filter is used. We are able to trace down the following sequence when prealloc-filter is used: co=0x55e7cbed7680 qcow2_co_pwritev_task() co=0x55e7cbed7680 preallocate_co_pwritev_p

[PATCH v3 2/3] iotests/298: add testcase for async writes with preallocation filter

2024-07-16 Thread Andrey Drobyshev
The testcase simply creates a 64G image with 1M clusters, generates a list of 1M aligned offsets and feeds aio_write commands with those offsets to qemu-io run with '--aio native --nocache'. Then we check the data written at each of the offsets. Before the previous commit this could result into a

[PATCH v3 3/3] scripts: add filev2p.py script for mapping virtual file offsets mapping

2024-07-16 Thread Andrey Drobyshev
The script is basically a wrapper around "filefrag" utility. This might be used to map virtual offsets within the file to the underlying block device offsets. In addition, a chunk size might be specified, in which case a list of such mappings will be obtained: $ scripts/filev2p.py -s 100M /spars

[PATCH v3 0/3] Fix data corruption within preallocation

2024-07-16 Thread Andrey Drobyshev
v2 -> v3: * Patch 2: modify test case. Increase number of requests from 1024 to 2048; make odd requests write actual data, while even requests cause write_zeroes operation; * Add patch 3: add scripts/filev2p.py for mapping of virtual file offsets to physical block device offsets.

Re: [PATCH v3 00/27] qemu-img: refersh options and --help handling, cleanups

2024-07-16 Thread Michael Tokarev
A friendly ping? 24.04.2024 11:50, Michael Tokarev wrote: Quite big patchset trying to implement normal, readable qemu-img --help (and qemu-img COMMAND --help) output with readable descriptions, and adding many long options in the process. In the end I stopped using qemu-img-opts.hx in qemu-img

[PATCH v2 0/9] qapi: convert example sections to qmp-example rST directives

2024-07-16 Thread John Snow
This patchset focuses on converting example sections to rST directives using a new `.. qmp-example::` directive. V2: - Rebased on origin/master; converted one more example - Fixed (most?) minor nits from last review - Didn't address lack of newline in text mode or enhanced lexer (yet) Changes

[PATCH v2 5/9] docs/sphinx: add CSS styling for qmp-example directive

2024-07-16 Thread John Snow
From: Harmonie Snow Add CSS styling for qmp-example directives to increase readability and consistently style all example blocks. Signed-off-by: Harmonie Snow Signed-off-by: John Snow Acked-by: Markus Armbruster --- docs/sphinx-static/theme_overrides.css | 49 ++ 1 fi

[PATCH v2 2/9] docs/qapidoc: factor out do_parse()

2024-07-16 Thread John Snow
Factor out the compatibility parser helper into a base class, so it can be shared by other directives. Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- docs/sphinx/qapidoc.py | 32 +++- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/docs/s

[PATCH v2 4/9] docs/qapidoc: add QMP highlighting to annotated qmp-example blocks

2024-07-16 Thread John Snow
For any code literal blocks inside of a qmp-example directive, apply and enforce the QMP lexer/highlighter to those blocks. This way, you won't need to write: ``` .. qmp-example:: :annotated: Blah blah .. code-block:: QMP -> { "lorem": "ipsum" } ``` But instead, simply: ``` ..

[PATCH v2 6/9] qapi: convert "Example" sections without titles

2024-07-16 Thread John Snow
Use the no-option form of ".. qmp-example::" to convert any Examples that do not have any form of caption or explanation whatsoever. Note that in a few cases, example sections are split into two or more separate example blocks. This is only done stylistically to create a delineation between two or

[PATCH v2 1/9] [DO-NOT-MERGE]: Add some ad-hoc linting helpers.

2024-07-16 Thread John Snow
These aren't ready for upstream inclusion, because they do not properly manage version dependencies, execution environment and so on. These are just the tools I use in my Own Special Environment :tm: for testing and debugging. They've been tested only on Fedora 38 for right now, which means: Pyth

[PATCH v2 3/9] docs/qapidoc: create qmp-example directive

2024-07-16 Thread John Snow
This is a directive that creates a syntactic sugar for creating "Example" boxes very similar to the ones already used in the bitmaps.rst document, please see e.g. https://www.qemu.org/docs/master/interop/bitmaps.html#creation-block-dirty-bitmap-add In its simplest form, when a custom title is not

[PATCH v2 9/9] qapi: remove "Example" doc section

2024-07-16 Thread John Snow
Fully eliminate the "Example" sections in QAPI doc blocks now that they have all been converted to arbitrary rST syntax using the ".. qmp-example::" directive. Update tests to match. Migrating to the new syntax --- The old "Example:" or "Examples:" section syntax is now ca

[PATCH v2 8/9] qapi: convert "Example" sections with longer prose

2024-07-16 Thread John Snow
These examples require longer explanations or have explanations that require markup to look reasonable when rendered and so use the longer form of the ".. qmp-example::" directive. By using the :annotated: option, the content in the example block is assumed *not* to be a code block literal and is

[PATCH v2 7/9] qapi: convert "Example" sections with titles

2024-07-16 Thread John Snow
When an Example section has a brief explanation, convert it to a qmp-example:: section using the :title: option. Rule of thumb: If the title can fit on a single line and requires no rST markup, it's a good candidate for using the :title: option of qmp-example. In this patch, trailing punctuation