[PATCH trivial v2] tests/qemu-iotests/tests/mirror-sparse: skip if O_DIRECT is not supported

2025-08-05 Thread Michael Tokarev
tests: Add iotest mirror-sparse for recent patches" Signed-off-by: Michael Tokarev --- v2: use `_supported_cache_modes none directsync` instead of _require_o_direct as suggested by Philippe. tests/qemu-iotests/tests/mirror-sparse | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qe

Re: [PATCH-for-10.1] tests/qemu-iotests/tests/mirror-sparse: skip if O_DIRECT is not supported

2025-08-05 Thread Michael Tokarev
On 05.08.2025 20:23, Philippe Mathieu-Daudé wrote: diff --git a/tests/qemu-iotests/tests/mirror-sparse b/tests/qemu- iotests/tests/mirror-sparse index cfcaa600ab..19843a622c 100755 --- a/tests/qemu-iotests/tests/mirror-sparse +++ b/tests/qemu-iotests/tests/mirror-sparse @@ -41,6 +41,7 @@ _suppo

[PATCH trivial] tests/qemu-iotests/tests/mirror-sparse: skip if O_DIRECT is not supported

2025-08-01 Thread Michael Tokarev
urs at the very beginning when we're checking for sanity. Fixes: c0ddcb2cbc146e "tests: Add iotest mirror-sparse for recent patches" Signed-off-by: Michael Tokarev --- tests/qemu-iotests/tests/mirror-sparse | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/tes

Re: [PATCH v3 10/11] tests: Add iotest mirror-sparse for recent patches

2025-08-01 Thread Michael Tokarev
On 25.04.2025 03:52, Eric Blake wrote: Prove that blockdev-mirror can now result in sparse raw destination files, regardless of whether the source is raw or qcow2. By making this a separate test, it was possible to test effects of individual patches for the various pieces that all have to work t

Re: [PATCH v4 00/27] refresh qemu-img options handling

2025-07-17 Thread Michael Tokarev
On 15.07.2025 21:42, Kevin Wolf wrote: Am 31.05.2025 um 19:15 hat Michael Tokarev geschrieben: This is another iteration of this patch series, which tries to add missing command-line options, --help output, make it all more or less consistent, etc. I addressed (hopefully) all comments so far

[PATCH 14/27] qemu-img: map: refresh options/--help

2025-07-15 Thread Michael Tokarev
Add missing long options and --help output, reorder options for consistency. While at it, remove unused option_index variable. Signed-off-by: Michael Tokarev --- qemu-img.c | 59 +++--- 1 file changed, 38 insertions(+), 21 deletions(-) diff

[PATCH 12/27] qemu-img: convert: refresh options/--help (short option change)

2025-07-15 Thread Michael Tokarev
Add missing long options and --help output. Reorder options for consistency. Use -b for --backing, and recognize -B for backwards compatibility. Unfortunately we can't use -B to specify backing format. Signed-off-by: Michael Tokarev --- docs/tools/qemu-img.rst | 2 +- qemu-

Re: [PATCH 14/27] qemu-img: map: refresh options/--help

2025-07-15 Thread Michael Tokarev
On 15.07.2025 16:07, Kevin Wolf wrote: +" --start-offset OFFSET\n" -s, --start-offset +" --max-length LENGTH\n" -l, --max-length These are also undocumented. Lemme add some info for them.. /mjt

Re: [PATCH 1/1] qemu-img: add sub-command --remove-all to 'qemu-img bitmap'

2025-07-14 Thread Michael Tokarev
On 14.07.2025 11:01, Michael Tokarev wrote: I'd very much love to add more commands/options to qemu-img *after* my big patchset to it is either accepted or rejected.  It's been in the queue for over the years, and I have to rebase it painfully after each change (thankfully there we

Re: [PATCH 1/1] qemu-img: add sub-command --remove-all to 'qemu-img bitmap'

2025-07-14 Thread Michael Tokarev
On 07.07.2025 23:58, Denis V. Lunev via wrote: From time to time it is needed to remove all bitmaps from the image. Before this patch the process is not very convinient. One should perform qemu-img info and parse the output to obtain all names. After that one should sequentially call q

Re: [PATCH v4 00/27] refresh qemu-img options handling

2025-06-23 Thread Michael Tokarev
Ping once again? Please let's move with this one. Either it should be accepted, maybe with some tweaks, or dropped entirely. There's enough silence already - it's been there for over 2 years. Thanks, /mjt On 31.05.2025 20:15, Michael Tokarev wrote: This is another iteratio

Re: [PATCH 0/2] hw/nvme: stable fixes

2025-06-04 Thread Michael Tokarev
On 03.06.2025 15:59, Klaus Jensen wrote: Two fixes for stable. See commits. What do you mean "for stable"? Are these not for master but for stable *only*? Usually changes for qemu-stable are picked up *from* master branch, unless there are major changes in stable already. Thanks, /mjt

[PATCH 06/27] qemu-img: factor out parse_output_format() and use it in the code

2025-05-31 Thread Michael Tokarev
Use common code and simplify error message Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé Reviewed-by: Kevin Wolf --- qemu-img.c | 63 -- 1 file changed, 18 insertions(+), 45 deletions(-) diff --git a/qemu-img.c b/qemu-img.c

[PATCH 05/27] qemu-img: create: refresh options/--help (short option change)

2025-05-31 Thread Michael Tokarev
onsistency. Remove usage of missing_argument()/unrecognized_option() in img_create(). Signed-off-by: Michael Tokarev --- docs/tools/qemu-img.rst | 10 ++--- qemu-img.c | 84 + 2 files changed, 73 insertions(+), 21 deletions(-) diff --git a/docs/

[PATCH 16/27] qemu-img: snapshot: make -l (list) the default, simplify option handling

2025-05-31 Thread Michael Tokarev
-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé --- docs/tools/qemu-img.rst | 2 +- qemu-img.c | 52 ++--- 2 files changed, 19 insertions(+), 35 deletions(-) diff --git a/docs/tools/qemu-img.rst b/docs/tools/qemu-img.rst index 935f28bbc5

Re: [PATCH v3 0/4] qapi: add auto-generated return docs

2025-05-31 Thread Michael Tokarev
On 23.05.2025 21:24, John Snow wrote: v3: rebased on top of python-qapi-linting (v4) pull request; removed commits that are no longer needed. Markus: I forget where we left off... shall we refresh? v2: fix multi-return-sections bug :( John Snow (4): docs/qapi-domain: add return-nod

[PATCH 12/27] qemu-img: convert: refresh options/--help (short option change)

2025-05-31 Thread Michael Tokarev
Add missing long options and --help output. Reorder options for consistency. Use -b for --backing, and recognize -B for backwards compatibility. Unfortunately we can't use -B to specify backing format. Signed-off-by: Michael Tokarev --- docs/tools/qemu-img.rst | 2 +- qemu-

[PATCH 17/27] qemu-img: snapshot: refresh options/--help

2025-05-31 Thread Michael Tokarev
Add missing long options and --help output, reorder options for consistency. Signed-off-by: Michael Tokarev --- qemu-img.c | 60 +++--- 1 file changed, 44 insertions(+), 16 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 8fbf0c67a7

[PATCH 18/27] qemu-img: rebase: refresh options/--help (short option change)

2025-05-31 Thread Michael Tokarev
file (was eg CACHE vs SRC_CACHE, which is unclear). Probably should rename local variables. Signed-off-by: Michael Tokarev --- docs/tools/qemu-img.rst | 2 +- qemu-img.c | 88 + 2 files changed, 64 insertions(+), 26 deletions(-) diff --git a

[PATCH 19/27] qemu-img: resize: do not always eat last argument

2025-05-31 Thread Michael Tokarev
is not handled right is when there's an option between filename and size, and size is given as decrement, - in this case -size will be treated as option, not as size. Signed-off-by: Michael Tokarev --- qemu-img.c | 41 +++-- 1 file changed, 27 insertions(

[PATCH 21/27] qemu-img: amend: refresh options/--help

2025-05-31 Thread Michael Tokarev
Add missing long options and --help output, reorder options for consistency. Signed-off-by: Michael Tokarev --- qemu-img.c | 54 +++--- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 3dbfce527b

[PATCH 23/27] qemu-img: bitmap: refresh options/--help

2025-05-31 Thread Michael Tokarev
Add missing long options and --help output, reorder options for consistency. Signed-off-by: Michael Tokarev --- qemu-img.c | 80 ++ 1 file changed, 56 insertions(+), 24 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 5011ec5fce

[PATCH 15/27] qemu-img: snapshot: allow specifying -f fmt

2025-05-31 Thread Michael Tokarev
For consistency with other commands, and since it already accepts --image-opts, allow specifying -f fmt too. Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé --- docs/tools/qemu-img.rst | 2 +- qemu-img-cmds.hx| 4 ++-- qemu-img.c | 9 ++--- 3 files

[PATCH 24/27] qemu-img: dd: refresh options/--help

2025-05-31 Thread Michael Tokarev
Add missing long options and --help output, reorder options for consistency. Signed-off-by: Michael Tokarev --- qemu-img.c | 50 -- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 97ce51a1c3

[PATCH 07/27] qemu-img: check: refresh options/--help

2025-05-31 Thread Michael Tokarev
Add missing long options and --help output, reorder options for consistency. Signed-off-by: Michael Tokarev --- qemu-img.c | 60 +- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index a26498a4e8

[PATCH 09/27] qemu-img: commit: refresh options/--help

2025-05-31 Thread Michael Tokarev
Add missing long options and --help output, reorder options for consistency. Signed-off-by: Michael Tokarev --- qemu-img.c | 68 ++ 1 file changed, 48 insertions(+), 20 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index c8ce206b73

[PATCH 13/27] qemu-img: info: refresh options/--help

2025-05-31 Thread Michael Tokarev
Add missing long options and --help output. Also add -b short option for --backing-chain, and remove now-unused OPTION_BACKING_CHAIN. Reorder options for consistency. While at it, remove unused option_index variable. Signed-off-by: Michael Tokarev --- qemu-img.c | 54

[PATCH 11/27] qemu-img: compare: refresh options/--help

2025-05-31 Thread Michael Tokarev
Add long options, add help, reorder options for consistency. Signed-off-by: Michael Tokarev --- qemu-img.c | 64 +++--- 1 file changed, 46 insertions(+), 18 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index c24e1fb455..70573b79b5 100644

[PATCH 22/27] qemu-img: bench: refresh options/--help

2025-05-31 Thread Michael Tokarev
Add missing long options and --help output, reorder options for consistency. Add missing --object option. Signed-off-by: Michael Tokarev --- qemu-img.c | 112 +++-- 1 file changed, 84 insertions(+), 28 deletions(-) diff --git a/qemu-img.c b/qemu

[PATCH 25/27] qemu-img: measure: refresh options/--help

2025-05-31 Thread Michael Tokarev
Add missing long options and --help output, reorder options for consistency. Also add -s short option for --size (and remove OPTION_SIZE). Signed-off-by: Michael Tokarev --- qemu-img.c | 89 +- 1 file changed, 62 insertions(+), 27 deletions

[PATCH 27/27] qemu-img: extend cvtnum() and use it in more places

2025-05-31 Thread Michael Tokarev
ve allowed size suffixes from the error message as it makes no sense most of the time (should be in help instead). Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé --- qemu-img.c | 111 + tests/qemu-iotests/049.out | 9 +-

[PATCH 26/27] qemu-img: implement short --help, remove global help() function

2025-05-31 Thread Michael Tokarev
unrecognized_option() are now unused, remove them. Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé --- qemu-img.c | 210 ++--- 1 file changed, 72 insertions(+), 138 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 44212de3f6..18f7ba07c9

[PATCH 14/27] qemu-img: map: refresh options/--help

2025-05-31 Thread Michael Tokarev
Add missing long options and --help output, reorder options for consistency. While at it, remove unused option_index variable. Signed-off-by: Michael Tokarev --- qemu-img.c | 57 ++ 1 file changed, 36 insertions(+), 21 deletions(-) diff

[PATCH 10/27] qemu-img: compare: use helper function for --object

2025-05-31 Thread Michael Tokarev
Use the same function to parse --object as used by all other qemu-img subcommands. Signed-off-by: Michael Tokarev --- qemu-img.c | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 5e651e8089..c24e1fb455 100644 --- a/qemu-img.c

[PATCH 20/27] qemu-img: resize: refresh options/--help

2025-05-31 Thread Michael Tokarev
Add missing long options and --help output, reorder options for consistency. Signed-off-by: Michael Tokarev --- qemu-img.c | 52 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index f655c301af

[PATCH 04/27] qemu-img: pass current cmd info into command handlers

2025-05-31 Thread Michael Tokarev
This info will be used to generate --help output. Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé Reviewed-by: Kevin Wolf --- qemu-img.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index

[PATCH 03/27] qemu-img: global option processing and error printing

2025-05-31 Thread Michael Tokarev
sequent changes command by command, with main() done last. unrecognized_option() and missing_argument() functions prototypes aren't changed by this patch, since they're called from many places and will be removed a few patches later. Only

[PATCH 02/27] qemu-img: create: convert img_size to signed, simplify handling

2025-05-31 Thread Michael Tokarev
Initializing an unsigned as -1, or using temporary sval for conversion is awkward. Since we don't allow other "negative" values anyway, use signed value and pass it to bdrv_img_create() (where it is properly converted to unsigned), simplifying code. Signed-off-by: Michael Tokar

[PATCH v4 00/27] refresh qemu-img options handling

2025-05-31 Thread Michael Tokarev
t to the common (before-subcomman) place, document it there, and remove the --object mentions from individual commands --help output. Thanks, /mjt Michael Tokarev (27): qemu-img: measure: convert img_size to signed, simplify handling qemu-img: create: convert img_size to signed, simplify handl

[PATCH 08/27] qemu-img: simplify --repair error message

2025-05-31 Thread Michael Tokarev
Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé --- qemu-img.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 2129158c13..c8ce206b73 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -864,8 +864,9 @@ static int img_check(const

[PATCH 01/27] qemu-img: measure: convert img_size to signed, simplify handling

2025-05-31 Thread Michael Tokarev
qemu_opt_set_number() expects signed int64_t. Use int64_t instead of uint64_t for img_size, use -1 as "unset" value instead of UINT64_MAX, and do not require temporary sval for conversion from string. Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé Reviewed-by:

Re: [PATCH 07/27] qemu-img: check: refresh options/--help

2025-05-31 Thread Michael Tokarev
On 13.05.2025 18:54, Kevin Wolf wrote: Am 27.09.2024 um 08:11 hat Michael Tokarev geschrieben: Add missing long options and --help output. ... +" --image-opts\n" +" indicates that FILENAME is a complete image specification\n" +" instead of a file name (inco

Re: [PATCH 07/27] qemu-img: check: refresh options/--help

2025-05-14 Thread Michael Tokarev
On 13.05.2025 18:54, Kevin Wolf wrote: Am 27.09.2024 um 08:11 hat Michael Tokarev geschrieben: +cmd_help(ccmd, +"[-f FMT | --image-opts] [-T CACHE_MODE] [-r] [-u]\n" +"[--output human|json] [--object OBJDEF] FILENAME\n" +, +" -q, --quiet\n&q

Re: [PULL 4/4] qemu-img: improve queue depth validation in img_bench

2025-05-14 Thread Michael Tokarev
On 14.05.2025 12:28, Michael Tokarev wrote: On 13.05.2025 18:06, Kevin Wolf wrote: Am 28.04.2025 um 15:58 hat Michael Tokarev geschrieben: 28.04.2025 16:54, Michael Tokarev пишет: 25.04.2025 20:52, Kevin Wolf wrote: From: Denis Rastyogin This error was discovered by fuzzing qemu-img

Re: [PULL 4/4] qemu-img: improve queue depth validation in img_bench

2025-05-14 Thread Michael Tokarev
On 13.05.2025 18:06, Kevin Wolf wrote: Am 28.04.2025 um 15:58 hat Michael Tokarev geschrieben: 28.04.2025 16:54, Michael Tokarev пишет: 25.04.2025 20:52, Kevin Wolf wrote: From: Denis Rastyogin This error was discovered by fuzzing qemu-img. Currently, running `qemu-img bench -d 0` in

Re: [PATCH for-10.0] scsi-disk: Apply error policy for host_status errors again

2025-05-13 Thread Michael Tokarev
On 13.05.2025 14:42, Kevin Wolf wrote: Am 12.05.2025 um 11:23 hat Michael Tokarev geschrieben: [..] This was already merged for 10.0 as commit 61b6d9b7. Heck. Yes, it is, and I already queued it for 9.2, too. Sorry for the noise. /mjt

Re: [PATCH v3 0/2] qapi/throttle: Fix qmp_block_set_io_throttle blocked for too long

2025-05-12 Thread Michael Tokarev
On 26.03.2025 12:26, zoudongjie via wrote: From: Zhu Yangyang Calling qmp_block_set_io_throttle() will be blocked for a long time when a network disk is configured and the network failure is just about to occur. This series add a timeout parameter for qmp_block_set_io_throttle to control its e

Re: [PATCH for-10.0] scsi-disk: Apply error policy for host_status errors again

2025-05-12 Thread Michael Tokarev
On 07.04.2025 18:59, Kevin Wolf wrote: Originally, all failed SG_IO requests called scsi_handle_rw_error() to apply the configured error policy. However, commit f3126d65, which was supposed to be a mere refactoring for scsi-disk.c, broke this and accidentally completed the SCSI request without co

Re: [PULL 4/4] qemu-img: improve queue depth validation in img_bench

2025-04-28 Thread Michael Tokarev
28.04.2025 16:54, Michael Tokarev пишет: 25.04.2025 20:52, Kevin Wolf wrote: From: Denis Rastyogin This error was discovered by fuzzing qemu-img. Currently, running `qemu-img bench -d 0` in img_bench is allowed, which is a pointless operation and causes qemu-img to hang. Signed-off-by

Re: [PULL 4/4] qemu-img: improve queue depth validation in img_bench

2025-04-28 Thread Michael Tokarev
25.04.2025 20:52, Kevin Wolf wrote: From: Denis Rastyogin This error was discovered by fuzzing qemu-img. Currently, running `qemu-img bench -d 0` in img_bench is allowed, which is a pointless operation and causes qemu-img to hang. Signed-off-by: Denis Rastyogin Message-ID: <20250327162423.25

Re: [PATCH for-10.0] scsi-disk: Apply error policy for host_status errors again

2025-04-10 Thread Michael Tokarev
10.04.2025 16:14, Kevin Wolf wrote: Am 10.04.2025 um 14:37 hat Michael Tokarev geschrieben: ...>> Does it make sense to apply this one for older stable qemu series? In particular, in 8.2, we lack cfe0880835cd3 "scsi-disk: Use positive return value for status in dma_readv/writev&qu

Re: [PATCH for-10.0] scsi-disk: Apply error policy for host_status errors again

2025-04-10 Thread Michael Tokarev
07.04.2025 18:59, Kevin Wolf пишет: Originally, all failed SG_IO requests called scsi_handle_rw_error() to apply the configured error policy. However, commit f3126d65, which was supposed to be a mere refactoring for scsi-disk.c, broke this and accidentally completed the SCSI request without consi

Re: [PATCH] vvfat: create_long_filename: fix out-of-bounds array access

2025-01-30 Thread Michael Tokarev
19.01.2025 12:15, Michael Tokarev wrote: create_long_filename() intentionally uses direntry_t->name[8+3] array as a larger array. This works, but makes statid code analysis tools unhappy. The problem here is that a directory entry holding long file name is significantly different from regu

Re: [PATCH 01/21] hw/i386/pc: Remove unused pc_compat_2_3 declarations

2025-01-30 Thread Michael Tokarev
17.01.2025 11:52, Thomas Huth wrote: On 16/01/2025 00.22, Philippe Mathieu-Daudé wrote: We removed the implementations in commit 46a2bd52571 ("hw/i386/pc: Remove deprecated pc-i440fx-2.3 machine") but forgot to remove the declarations. Do it now. Fixes: 46a2bd52571 ("hw/i386/pc: Remove deprecat

Re: [PATCH] vvfat: fix out of bounds array write

2025-01-22 Thread Michael Tokarev
22.01.2025 15:19, BALATON Zoltan wrote: On Wed, 22 Jan 2025, Michael Tokarev wrote: 22.01.2025 02:14, Pierrick Bouvier wrote: .. I agree the existing code (and this patch) is pretty cryptic for anyone not familiar with FAT format. However, I think it could be a good thing to first merge this

Re: [PATCH] vvfat: fix out of bounds array write

2025-01-21 Thread Michael Tokarev
22.01.2025 02:14, Pierrick Bouvier wrote: .. I agree the existing code (and this patch) is pretty cryptic for anyone not familiar with FAT format. However, I think it could be a good thing to first merge this one (which is correct, and works), and refactor this in a second time, so the current

Re: [PATCH] Skip resizing image to the same size

2025-01-20 Thread Michael Tokarev
20.01.2025 23:17, Fahrzin Hemmati wrote: My apologies, I saw the Signed-off-by requirement at first, but as I followed the docs I got to "git publish" and didn't realize "git publish" was actually able to send emails on my system (I don't remember setting up any SMTP settings). By that time, I fo

[PATCH] vvfat: create_long_filename(): refresh

2025-01-19 Thread Michael Tokarev
add comments explaining what is going on (since long file names are really weird), rewrite the second loop to do one UTF16 char at a time instead of byte, and fix coding style. Signed-off-by: Michael Tokarev --- block/vvfat.c | 54 +-- 1 file

[PATCH] vvfat: create_long_filename: fix out-of-bounds array access

2025-01-19 Thread Michael Tokarev
nto several parts within the entry, not just in regular 8+3 name field. Treat the entry as array of bytes instead. This fixes the OOB access from the compiler/tools PoV, but does not change the resulting code in any way. Keep the existing code style. Signed-off-by: Michael Tokarev --- bl

[PATCH v3, do not apply] vvfat: refresh writing long filename

2025-01-19 Thread Michael Tokarev
ys. A directory entry for a long FAT file name is significantly different from a directory entry for a regular FAT file name. This change makes whole logic dealing with the long filenames a bit more clear (hopefully). Based on ideas by Volker Rümelin. Signed-off-by: Michael Tokarev --- block/vvfat.c

[PATCH v2] vvfat: refresh writing long filename

2025-01-18 Thread Michael Tokarev
ys. A directory entry for a long FAT file name is significantly different from a directory entry for a regular FAT file name. This change makes whole logic dealing with the long filenames a bit more clear (hopefully). Based on ideas by Volker Rümelin. Signed-off-by: Michael Tokarev --- block/vvfat.c

Re: [PATCH v2] vvfat: refresh writing long filename

2025-01-18 Thread Michael Tokarev
19.01.2025 00:26, Michael Tokarev wrote: +static unsigned write_lfn_part(uint8_t *dest, unsigned dsize, + const gunichar2 *lptr, const gunichar2 *lend) +{ +unsigned i = 0; +for (; i < dsize / 2 && lptr + i <= lend; ++i) { /* incl. t

Re: [PATCH] vvfat: refresh writing long filename

2025-01-18 Thread Michael Tokarev
18.01.2025 23:54, BALATON Zoltan wrote: +typedef struct lfn_direntry_t { +    uint8_t sequence; +    uint8_t name01[10]; +    uint8_t attributes; +    uint8_t direntry_type; +    uint8_t sfn_checksum; +    uint8_t name0e[12]; +    uint16_t begin; +    uint8_t name1c[4]; +} QEMU_PACKED lfn_dirent

Re: [PATCH] vvfat: refresh writing long filename

2025-01-18 Thread Michael Tokarev
18.01.2025 23:32, Volker Rümelin wrote: The rules are: If the file name length in characters is a multiple of 13 you are done. Otherwise the remaining unused LFN direntry name array elements have to be filled with one 0x (a 16 bit 0) and the rest with 0x. BTW, are we really okay with a

Re: [PATCH] vvfat: refresh writing long filename

2025-01-18 Thread Michael Tokarev
18.01.2025 23:32, Volker Rümelin wrote: +static unsigned write_lfn_part(uint8_t *dest, unsigned dsize, + const gunichar2 *lptr, const gunichar2 *lend) +{ +unsigned i; +for(i = 0; i < dsize / 2 && lptr + i < lend; ++i) { +dest[i / 2 + 0] = lptr[i] & 0

[PATCH] vvfat: refresh writing long filename

2025-01-18 Thread Michael Tokarev
ys. A directory entry for a long FAT file name is significantly different from a directory entry for a regular FAT file name. This change makes whole logic dealing with the long filenames a bit more clear (hopefully). Based on ideas by Volker Rümelin. Signed-off-by: Michael Tokarev --- block/vvfat.c

Re: [PATCH] vvfat: fix out of bounds array write

2025-01-18 Thread Michael Tokarev
05.01.2025 16:59, Volker Rümelin wrote: In function create_long_filname(), the array name[8 + 3] in struct direntry_t is used as if it were defined as name[32]. This is intentional and works. It's nevertheless an out of bounds array access. To avoid this problem, this patch adds a struct lfn_dire

Re: [PATCH v2 01/13] hw/sd/sdhci: Set SDHC_NIS_DMA bit when appropriate

2025-01-16 Thread Michael Tokarev
17.01.2025 02:39, Bernhard Beschow wrote: Am 15. Januar 2025 12:55:29 UTC schrieb Michael Tokarev : Is this a qemu-stable material? Good question. Given that this part of the code has some further issues [1] I'd rather not alter stable behavior because we might just trade one bu

Re: [PATCH v17 00/11] New vmapple machine type and xhci fixes

2025-01-15 Thread Michael Tokarev
13.01.2025 00:00, Phil Dennis-Jordan wrote: This patch set introduces a new ARM and macOS HVF specific machine type called "vmapple". There are also some patches for fixing XHCI spec compliance issues and adding a workaround to a quirk in the macOS guest's XHCI driver. The vmapple machine type a

Re: [PATCH v2 01/13] hw/sd/sdhci: Set SDHC_NIS_DMA bit when appropriate

2025-01-15 Thread Michael Tokarev
11.01.2025 21:36, Bernhard Beschow wrote: In U-Boot, the fsl_esdhc[_imx] driver waits for both "transmit completed" and "DMA" bits in esdhc_send_cmd_common() by means of DATA_COMPLETE constant. QEMU currently misses to set the DMA bit which causes the driver to loop forever. Fix that by setting t

Re: [PATCH] vvfat: fix ubsan issue in create_long_filename

2024-12-22 Thread Michael Tokarev
04.12.2024 22:51, Pierrick Bouvier wrote: Found with test sbsaref introduced in [1]. .. Applied to the trivial-patches tree. Thank you! /mjt

Re: [PATCH-for-9.1? v2 4/4] hw/sd/sdhci: Check ADMA descriptors can be accessed

2024-12-20 Thread Michael Tokarev
01.08.2024 00:25, Philippe Mathieu-Daudé wrote: Since malicious guest can write invalid addresses to the ADMASYSADDR register, we need to check whether the descriptor could be correctly filled or not. Ping? This has been about the 9.1 release, now 9.2 is out already and we're working on 10.0..

Re: [PATCH ssh v2] ssh: Do not switch session to non-blocking mode

2024-11-26 Thread Michael Tokarev
13.11.2024 15:55, Richard W.M. Jones wrote: From: Jakub Jelen The libssh does not handle non-blocking mode in SFTP correctly. The driver code already changes the mode to blocking for the SFTP initialization, but for some reason changes to non-blocking mode. This used to work accidentally until

Re: [PATCH ssh] ssh: Do not switch session to non-blocking mode

2024-11-13 Thread Michael Tokarev
Heh. I was creating a qemu bug report on gitlab when this email arrived :) 13.11.2024 14:49, Richard W.M. Jones wrote: From: Jakub Jelen The libssh does not handle non-blocking mode in SFTP correctly. The driver code already changes the mode to blocking for the SFTP initialization, but for som

Re: [PATCH] hw/sd/sdcard: Fix calculation of size when using eMMC boot partitions

2024-11-05 Thread Michael Tokarev
28.10.2024 19:23, Jan Luebbe wrote: The sd_bootpart_offset() function calculates the *runtime* offset which changes as the guest switches between accessing the main user data area and the boot partitions by writing to the EXT_CSD_PART_CONFIG_ACC_MASK bits, so it shouldn't be used to calculate the

Re: [PATCH] raw-format: Fix error message for invalid offset/size

2024-10-25 Thread Michael Tokarev
29.08.2024 21:55, Kevin Wolf wrote: s->offset and s->size are only set at the end of the function and still contain the old values when formatting the error message. Print the parameters with the new values that we actually checked instead. Fixes: 500e2434207d ('raw-format: Split raw_read_option

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

2024-10-22 Thread Michael Tokarev
Ping #5? Thanks, /mjt 27.09.2024 09:10, Michael Tokarev wrote: This is a re-send of this patchset from Apr-24, after multiple pings. I rebased it on top of current qemu/master, though nothing has really changed - it is still the same changes. We should either apply it or drop it if it is not

Re: [PATCH v4 07/12] hw/sh4/r2d: Realize IDE controller before accessing it

2024-10-22 Thread Michael Tokarev
On 13.02.2024 16:03, Philippe Mathieu-Daudé wrote: We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Yoshinori Sato --- hw/sh4/r2d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sh4/r2d.c b/

Re: [PULL 3/5] block/reqlist: allow adding overlapping requests

2024-10-01 Thread Michael Tokarev
30.09.2024 11:43, Vladimir Sementsov-Ogievskiy wrote: From: Fiona Ebner Allow overlapping request by removing the assert that made it impossible. There are only two callers: 1. block_copy_task_create() It already asserts the very same condition before calling reqlist_init_req(). 2. cbw_snaps

[PATCH 22/27] qemu-img: bitmap: refresh options/--help

2024-09-26 Thread Michael Tokarev
Add missing long options and --help output. Signed-off-by: Michael Tokarev --- qemu-img.c | 40 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index fff537df26..7c20a5772d 100644 --- a/qemu-img.c +++ b/qemu-img.c

[PATCH 11/27] qemu-img: convert: refresh options/--help

2024-09-26 Thread Michael Tokarev
Add missing long options and --help output. convert uses -B for --backing, - why not -b? Signed-off-by: Michael Tokarev --- qemu-img.c | 90 -- 1 file changed, 81 insertions(+), 9 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index

[PATCH 10/27] qemu-img: compare: refresh options/--help

2024-09-26 Thread Michael Tokarev
Signed-off-by: Michael Tokarev --- qemu-img.c | 45 + 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 7a111bce72..ea66bfa195 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1488,25 +1488,52 @@ static int

[PATCH 18/27] qemu-img: resize: do not always eat last argument

2024-09-26 Thread Michael Tokarev
is not handled right is when there's an option between filename and size, and size is given as decrement, - in this case -size will be treated as option, not as size. Signed-off-by: Michael Tokarev --- qemu-img.c | 41 +++-- 1 file changed, 27 insertions(

[PATCH 26/27] qemu-img: inline list of supported commands, remove qemu-img-cmds.h include

2024-09-26 Thread Michael Tokarev
also add short description to each command and use it in --help Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé --- qemu-img.c | 40 ++-- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 39dfaa5144

[PATCH 24/27] qemu-img: measure: refresh options/--help

2024-09-26 Thread Michael Tokarev
Add missing long options and --help output. Also add -s short option for --size (and remove OPTION_SIZE). Signed-off-by: Michael Tokarev --- qemu-img.c | 53 - 1 file changed, 40 insertions(+), 13 deletions(-) diff --git a/qemu-img.c b/qemu

[PATCH 05/27] qemu-img: create: refresh options/--help

2024-09-26 Thread Michael Tokarev
Create helper function cmd_help() to display command-specific help text, and use it to print --help for 'create' subcommand. Add missing long options (eg --format) in img_create(). Remove usage of missing_argument()/unrecognized_option() in img_create(). Signed-off-by: Micha

[PATCH 27/27] qemu-img: extend cvtnum() and use it in more places

2024-09-26 Thread Michael Tokarev
ve allowed size suffixes from the error message as it makes no sense most of the time (should be in help instead). Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé --- qemu-img.c | 111 + tests/qemu-iotests/049.out | 9 +-

[PATCH 17/27] qemu-img: rebase: refresh options/--help

2024-09-26 Thread Michael Tokarev
-off-by: Michael Tokarev --- qemu-img.c | 55 +- 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 62f9ce4069..47dfa137c1 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -3793,26 +3793,61 @@ static int

[PATCH 23/27] qemu-img: dd: refresh options/--help

2024-09-26 Thread Michael Tokarev
Add missing long options and --help output. Signed-off-by: Michael Tokarev --- qemu-img.c | 39 +-- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 7c20a5772d..b3e521bc09 100644 --- a/qemu-img.c +++ b/qemu-img.c

[PATCH 03/27] qemu-img: global option processing and error printing

2024-09-26 Thread Michael Tokarev
changes command by command, with main() done last. unrecognized_option() and missing_argument() functions prototypes aren't changed by this patch, since they're called from many places and will be removed a few patches later. Only artifical "qemu-img" argv0 is provided in there for

[PATCH 20/27] qemu-img: amend: refresh options/--help

2024-09-26 Thread Michael Tokarev
Add missing long options and --help output. Signed-off-by: Michael Tokarev --- qemu-img.c | 34 ++ 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 688c01722c..76000c485c 100644 --- a/qemu-img.c +++ b/qemu-img.c

[PATCH 16/27] qemu-img: snapshot: refresh options/--help

2024-09-26 Thread Michael Tokarev
Add missing long options and --help output. Signed-off-by: Michael Tokarev --- qemu-img.c | 45 - 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 967f6343de..62f9ce4069 100644 --- a/qemu-img.c +++ b/qemu

[PATCH 19/27] qemu-img: resize: refresh options/--help

2024-09-26 Thread Michael Tokarev
Add missing long options and --help output. Signed-off-by: Michael Tokarev --- qemu-img.c | 38 +- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index da10fafffc..688c01722c 100644 --- a/qemu-img.c +++ b/qemu-img.c

[PATCH 09/27] qemu-img: commit: refresh options/--help

2024-09-26 Thread Michael Tokarev
Add missing long options and --help output. Signed-off-by: Michael Tokarev --- qemu-img.c | 44 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 9157a6b45d..7a111bce72 100644 --- a/qemu-img.c +++ b/qemu

[PATCH 21/27] qemu-img: bench: refresh options/--help

2024-09-26 Thread Michael Tokarev
Add missing long options and --help output. Signed-off-by: Michael Tokarev --- qemu-img.c | 64 +- 1 file changed, 54 insertions(+), 10 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 76000c485c..fff537df26 100644 --- a/qemu-img.c

[PATCH 15/27] qemu-img: snapshot: make -l (list) the default, simplify option handling

2024-09-26 Thread Michael Tokarev
-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé --- docs/tools/qemu-img.rst | 2 +- qemu-img.c | 52 ++--- 2 files changed, 19 insertions(+), 35 deletions(-) diff --git a/docs/tools/qemu-img.rst b/docs/tools/qemu-img.rst index 9b628c4da5

[PATCH 08/27] qemu-img: simplify --repair error message

2024-09-26 Thread Michael Tokarev
Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé --- qemu-img.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 1bd88fcf63..9157a6b45d 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -859,8 +859,9 @@ static int img_check(const

[PATCH 25/27] qemu-img: implement short --help, remove global help() function

2024-09-26 Thread Michael Tokarev
unrecognized_option() are now unused, remove them. Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé --- qemu-img.c | 172 - 1 file changed, 39 insertions(+), 133 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 3721cf070b..39dfaa5144

[PATCH 06/27] qemu-img: factor out parse_output_format() and use it in the code

2024-09-26 Thread Michael Tokarev
Use common code and simplify error message Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé --- qemu-img.c | 63 -- 1 file changed, 18 insertions(+), 45 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 7ed5e6d1a8

[PATCH 14/27] qemu-img: snapshot: allow specifying -f fmt

2024-09-26 Thread Michael Tokarev
For consistency with other commands, and since it already accepts --image-opts, allow specifying -f fmt too. Signed-off-by: Michael Tokarev Reviewed-by: Daniel P. Berrangé --- docs/tools/qemu-img.rst | 2 +- qemu-img-cmds.hx| 4 ++-- qemu-img.c | 9 ++--- 3 files

  1   2   3   4   >