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

2024-05-31 Thread Michael Tokarev
A friendly ping? It took me quite some time and energy for all this. It'd be sad if it gets lost. /mjt 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 a

Re: [PATCH] block/curl: use strlen instead of strchr

2024-06-28 Thread Michael Tokarev
On 6/28/24 08:49, Vladimir Sementsov-Ogievskiy wrote: We already know where colon is, so no reason to search for it. Also, avoid a code, which looks like we forget to check return value of strchr() to NULL. Suggested-by: Kevin Wolf Signed-off-by: Vladimir Sementsov-Ogievskiy --- This replaces

Re: [PATCH] block/curl: use strlen instead of strchr

2024-06-28 Thread Michael Tokarev
On 6/29/24 09:20, Michael Tokarev wrote: On 6/28/24 08:49, Vladimir Sementsov-Ogievskiy wrote: We already know where colon is, so no reason to search for it. Also, avoid a code, which looks like we forget to check return value of strchr() to NULL. Suggested-by: Kevin Wolf Signed-off-by

Re: [PATCH] block/curl: use strlen instead of strchr

2024-06-28 Thread Michael Tokarev
On 6/29/24 09:36, Michael Tokarev wrote: .. +    while (p < end && *t) { +    if (*t == ' ') { +    if (g_ascii_isspace(*p)) { +    ++p; +    } else { +    ++t; } +    } else if (*t == g_ascii_tolower(*p)) {

[PATCH] block/curl: rewrite http header parsing function

2024-06-29 Thread Michael Tokarev
Existing code was long, unclear and twisty. Signed-off-by: Michael Tokarev --- block/curl.c | 44 ++-- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/block/curl.c b/block/curl.c index 419f7c89ef..9802d0319d 100644 --- a/block/curl.c +++ b

Re: [PATCH] block/curl: rewrite http header parsing function

2024-06-30 Thread Michael Tokarev
01.07.2024 09:54, Vladimir Sementsov-Ogievskiy wrote: +    const char *t = "accept-ranges : bytes "; /* A lowercase template */ Note: you make parser less strict: you allow "bytes" to be uppercase (was allowed only for accept-ranges", and you allow whitespaces before colon. Yes, exactly. I

Re: [PULL 4/4] block: Parse filenames only when explicitly requested

2024-07-03 Thread Michael Tokarev
ake Reviewed-by: Stefan Hajnoczi Reviewed-by: Hanna Czenczek (cherry picked from commit 7ead946998610657d38d1a505d5f25300d4ca613) Signed-off-by: Michael Tokarev (Mjt: backport patch to 7.2, without: v8.0.0-2069-g8394c35ee148 "block: Fix AioContext locking in bdrv_open_child()" v8.1.0-8

Re: [PULL 4/4] block: Parse filenames only when explicitly requested

2024-07-04 Thread Michael Tokarev
04.07.2024 14:29, Kevin Wolf wrote: Am 03.07.2024 um 23:16 hat Michael Tokarev geschrieben: I'm attaching backports of this change to 8.2 and 7.2 series. Please check if the resulting backports are correct, or if they're needed in the first place. Note: 7.2 lacks quite some locki

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 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. S

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

Re: [PATCH v5 1/5] vvfat: Fix bug in writing to middle of file

2024-08-11 Thread Michael Tokarev
12.06.2024 15:43, Amjad Alsharafi wrote: Before this commit, the behavior when calling `commit_one_file` for example with `offset=0x2000` (second cluster), what will happen is that we won't fetch the next cluster from the fat, and instead use the first cluster for the read operation. This is due

Re: [PATCH v5 0/5] vvfat: Fix write bugs for large files and add iotests

2024-08-11 Thread Michael Tokarev
12.06.2024 15:43, Amjad Alsharafi wrote: These patches fix some bugs found when modifying files in vvfat. First, there was a bug when writing to the cluster 2 or above of a file, it will copy the cluster before it instead, so, when writing to cluster=2, the content of cluster=1 will be copied int

Re: [PULL 5/5] nbd/server: CVE-2024-7409: Close stray clients at server-stop

2024-08-11 Thread Michael Tokarev
09.08.2024 00:53, Eric Blake wrote: A malicious client can attempt to connect to an NBD server, and then intentionally delay progress in the handshake, including if it does not know the TLS secrets. Although the previous two patches reduce this behavior by capping the default max-connections par

Re: [PATCH v5 0/5] vvfat: Fix write bugs for large files and add iotests

2024-08-11 Thread Michael Tokarev
11.08.2024 12:52, Amjad Alsharafi wrote: Hi! This actually has been reviewed and approved (last version was v6 here: https://patchew.org/QEMU/cover.1721470238.git.amjadsharaf...@gmail.com/) It has been merged into upstream here: https://gitlab.com/qemu-project/qemu/-/commit/6d00c6f98256ad

Re: [PATCH v5 0/5] vvfat: Fix write bugs for large files and add iotests

2024-08-11 Thread Michael Tokarev
11.08.2024 13:19, Amjad Alsharafi wrote: ... It would be great to include this patch in `stable`. Thank you. The question here is whenever I should include whole series (5 patches) or just one? I picked up all 5 for now. Thanks, /mjt

Re: [PATCH v2] block/reqlist: allow adding overlapping requests

2024-08-11 Thread Michael Tokarev
12.07.2024 17:07, Fiona Ebner wrote: 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_snapshot_read_lock() There is no need to

Re: [PULL 5/5] nbd/server: CVE-2024-7409: Close stray clients at server-stop

2024-08-12 Thread Michael Tokarev
[Trim CC list] 12.08.2024 17:44, Eric Blake wrote: On Sun, Aug 11, 2024 at 11:02:52AM GMT, Michael Tokarev wrote: .. Eric, from the 5-patch series, only this last patch is Cc'd for stable, but it obviously does not work without all 4 previous patches. Do you mean whole series shou

Re: [PULL 00/10] Crypto fixes patches

2024-09-10 Thread Michael Tokarev
On 9/9/24 17:16, Daniel P. Berrangé wrote: Various crypto fixes * Support sha384 with glib crypto backend * Improve error reporting for unsupported cipher modes * Avoid memory leak when bad cipher mode is given * Run pbkdf tests on macOS * Runtime check for pbkdf hash impls with gnutl

Re: [Qemu-block] [PATCH] qemu-img / curl: When fetching Content-Size use GET instead of HEAD.

2015-12-08 Thread Michael Tokarev
08.12.2015 00:23, Boris Schrijver wrote: [] > It's is therefore better to use only the GET request method, and discard the > body at the first call. Nooo! Please N! Fetching a large file once might be too long already. Fetching it twice is twice as long. Oh well!.. Thanks, /mjt

Re: [Qemu-block] [PATCH] iscsi: fix readcapacity error message

2016-01-10 Thread Michael Tokarev
16.12.2015 07:40, Zhu Lingshan wrote: > fix:The error message for readcapacity 16 incorrectly mentioned > a readcapacity 10 failure, fixed the error message. Applied to -trivial, thanks! /mjt

[Qemu-block] [PULL 16/19] hw/ide: Remove superfluous return statements

2016-01-11 Thread Michael Tokarev
From: Thomas Huth The "return;" statements at the end of functions do not make much sense, so let's remove them. Cc: qemu-block@nongnu.org Signed-off-by: Thomas Huth Reviewed-by: John Snow Signed-off-by: Michael Tokarev --- hw/ide/atapi.c | 1 - hw/ide/macio.c | 2 -- 2 f

Re: [Qemu-block] [PATCH] hw/block/nvme: Simplify if-statements a little bit

2016-10-15 Thread Michael Tokarev
12.10.2016 18:18, Thomas Huth wrote: The condition '!A || (A && B)' is equivalent to '!A || B'. Applied to -trivial, thanks! /mjt

Re: [Qemu-block] [PATCH] iotests: fix the redirection order in 083

2016-05-06 Thread Michael Tokarev
26.04.2016 13:13, Wei Jiangang wrote: > It should redirect stdout to /dev/null first, > then redirect stderr to whatever stdout currently points at. Actually this is interesting. By doing this like it was done initially, we see any possible errors from grep or python, because errors will go to in

[Qemu-block] [PULL 41/52] block: Use DIV_ROUND_UP

2016-06-05 Thread Michael Tokarev
From: Laurent Vivier Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d). This patch is the result of coccinelle script scripts/coccinelle/round.cocci CC: qemu-block@nongnu.org Signed-off-by: Laurent Vivier Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- block/vvfat.c | 3

[Qemu-block] [PULL 39/52] qcow/qcow2: Use DIV_ROUND_UP

2016-06-05 Thread Michael Tokarev
From: Laurent Vivier Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d). This patch is the result of coccinelle script scripts/coccinelle/round.cocci CC: qemu-block@nongnu.org Signed-off-by: Laurent Vivier Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- block/qcow.c

[Qemu-block] [PULL 40/52] qed: Use DIV_ROUND_UP

2016-06-05 Thread Michael Tokarev
From: Laurent Vivier Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d). This patch is the result of coccinelle script scripts/coccinelle/round.cocci CC: qemu-block@nongnu.org Signed-off-by: Laurent Vivier Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- block/qed-check.c | 3

[Qemu-block] [PULL 38/52] parallels: Use DIV_ROUND_UP

2016-06-05 Thread Michael Tokarev
From: Laurent Vivier Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d). This patch is the result of coccinelle script scripts/coccinelle/round.cocci CC: qemu-block@nongnu.org Signed-off-by: Laurent Vivier Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- block/parallels.c | 2

Re: [Qemu-block] [PATCH] qtest/ahci: Fix clang 3.5.0 error

2015-03-19 Thread Michael Tokarev
17.03.2015 23:58, John Snow wrote: > A thinko that clang 3.5.0 caught. > Thankfully does not introduce any new failures. Applied to trivial, changing subject to the one suggested by Markus. Thanks, /mjt

Re: [Qemu-block] block-commit & dropping privs

2015-04-01 Thread Michael Tokarev
30.03.2015 18:36, Kevin Wolf wrote: > Am 27.03.2015 um 18:12 hat Eric Blake geschrieben: >> On 03/27/2015 09:36 AM, Michael Tokarev wrote: >>> Wonder how to specify cache mode, or should I open these with proper >>> O_DIRECT/O_SYNC/whatever? It looks like it's po

Re: [Qemu-block] block-commit & dropping privs

2015-04-01 Thread Michael Tokarev
01.04.2015 12:26, Michael Tokarev пишет: > 30.03.2015 18:36, Kevin Wolf wrote: >> Am 27.03.2015 um 18:12 hat Eric Blake geschrieben: >>> On 03/27/2015 09:36 AM, Michael Tokarev wrote: >>>> Wonder how to specify cache mode, or should I open these with proper >>&g

Re: [Qemu-block] block-commit & dropping privs

2015-04-02 Thread Michael Tokarev
01.04.2015 15:34, Kevin Wolf wrote: [] > Overriding the backing file should work like this: > > -drive file=...,backing.file.filename=/dev/fdset/2 Oh-ok, this works. Sort of. Because after performing commit (is there a difference between commit hmp command and block-commit qmp command? I u

Re: [Qemu-block] block-commit & dropping privs

2015-04-02 Thread Michael Tokarev
02.04.2015 14:24, Kevin Wolf wrote: [] >> But overall, I think qemu-system should not modify backing >> file name in this case. > > So you would leave the backing file with the data that you just > committed down one level in your backing file chain? Wouldn't that > defeat the whole purpose of com

Re: [Qemu-block] block-commit & dropping privs

2015-04-06 Thread Michael Tokarev
02.04.2015 16:19, Kevin Wolf wrote: > Am 02.04.2015 um 14:04 hat Michael Tokarev geschrieben: >> 02.04.2015 14:24, Kevin Wolf wrote: >> [] >>>> But overall, I think qemu-system should not modify backing >>>> file name in this case. >>> >>> S

Re: [Qemu-block] [PATCH] sheepdog: Fix error message if failed to load vmstate

2015-06-02 Thread Michael Tokarev
02.06.2015 12:32, Fam Zheng wrote: > if (ret < 0) { > -error_report("failed to save vmstate %s", strerror(errno)); > +if (load) { > +error_report("failed to load vmstate %s", strerror(errno)); > +} else { > +error_report("

Re: [Qemu-block] [PATCH v3] opts: produce valid command line in qemu_opts_print

2015-09-06 Thread Michael Tokarev
07.07.2015 17:42, Kővágó, Zoltán wrote: > This will let us print options in a format that the user would actually > write it on the command line (foo=bar,baz=asd,etc=def), without > prepending a spurious comma at the beginning of the list, or quoting > values unnecessarily. This patch provides the

Re: [Qemu-block] [PATCH] ide: fix ATAPI command permissions

2015-09-10 Thread Michael Tokarev
09.09.2015 19:28, John Snow wrote: > We're a little too lenient with what we'll let an ATAPI drive handle. > Clamp down on the IDE command execution table to remove CD_OK permissions > from commands that are not and have never been ATAPI commands. FWIW, this issue has been assigned CVE-2015-6855 i

Re: [Qemu-block] [PATCH] ide: fix ATAPI command permissions

2015-09-14 Thread Michael Tokarev
14.09.2015 21:04, John Snow wrote: > On 09/11/2015 02:56 AM, Michael Tokarev wrote: >> 09.09.2015 19:28, John Snow wrote: >>> We're a little too lenient with what we'll let an ATAPI drive handle. >>> Clamp down on the IDE command execution table to remove CD_

Re: [Qemu-block] [PATCH 0/4] coccinelle: re-run scripts from scripts/coccinelle

2018-03-23 Thread Michael Tokarev
22.03.2018 19:12, Laurent Vivier wrote: > I've re-run some scripts from the coccinelle directory, > and they have found some problems. > > This series fixes them. > > Laurent Vivier (4): > error: Strip trailing '\n' from error string arguments (again again) > error: Remove NULL checks on erro

[Qemu-block] megasas & scsi-disk - interesting I/O errors

2018-05-19 Thread Michael Tokarev
Hello. I've an interesting case here with megasas virtual device. TL;DR see summary at the end. Initially I were testing a backport of CVE-2017-9503 fix to qemu 2.8.1 (which is in debian stable), and while testing I found out that the last patch from the fix makes megasas- attached storage devic

Re: [Qemu-block] [PATCH 1/2] virtio-blk: Remove useless condition around g_free()

2017-04-23 Thread Michael Tokarev
07.02.2017 16:27, Fam Zheng wrote: > Laszlo spotted and studied this wasteful "if". He pointed out: > > The original virtio_blk_free_request needed an "if" as it accesses one > field, since 671ec3f05655 ("virtio-blk: Convert VirtIOBlockReq.elem to > pointer", 2014-06-11); later on in f897bf751fbd

Re: [Qemu-block] [PATCH] MAINTAINERS: Update paths for AioContext implementation

2017-05-04 Thread Michael Tokarev
Applied to -trivial, mentioning c2b38b2 in commit message, thanks! /mjt

Re: [Qemu-block] [PATCH v20 00/10] Block replication for continuous checkpoints

2016-06-10 Thread Michael Tokarev
08.06.2016 04:11, Changlong Xie wrote: > Block replication is a very important feature which is used for > continuous checkpoints(for example: COLO). ... I'm not sure I understand why this has been sent to qemu-trivial? :) Thanks /mjt

Re: [Qemu-block] [PATCH v2] curl: Operate on zero-length file

2016-09-14 Thread Michael Tokarev
08.07.2016 14:18, Tomáš Golembiovský wrote: Another attempt to fix the bug 1596870. When creating new disk backed by remote file accessed via HTTPS and the backing file has zero length, qemu-img terminates with uniformative error message: qemu-img: disk.qcow2: CURL: Error opening file: Whi

[Qemu-block] [PULL 24/27] sheepdog: remove useless casts

2016-09-14 Thread Michael Tokarev
From: Laurent Vivier This patch is the result of coccinelle script scripts/coccinelle/typecast.cocci CC: Hitoshi Mitake CC: qemu-block@nongnu.org Signed-off-by: Laurent Vivier Reviewed-by: Hitoshi Mitake Signed-off-by: Michael Tokarev --- block/sheepdog.c | 4 ++-- 1 file changed, 2

Re: [Qemu-block] [PATCH v2] osdep: Fix ROUND_UP(64-bit, 32-bit)

2017-09-24 Thread Michael Tokarev
14.09.2017 16:49, Eric Blake wrote: > When using bit-wise operations that exploit the power-of-two > nature of the second argument of ROUND_UP(), we still need to > ensure that the mask is as wide as the first argument (done > by using a ternary to force proper arithmetic promotion). > Unpatched, R

Re: [Qemu-block] [PATCH] nbd-client: Use correct macro parenthesization

2017-09-24 Thread Michael Tokarev
19.09.2017 00:46, Eric Blake wrote: > If 'bs' is a complex expression, we were only casting the front half > rather than the full expression. Luckily, none of the callers were > passing bad arguments, but it's better to be robust up front. Applied to -trivial. /mjt

Re: [PATCH] scsi: megasas: Internal cdbs have 16-byte length

2023-03-01 Thread Michael Tokarev
28.02.2023 20:11, Guenter Roeck wrote: Host drivers do not necessarily set cdb_len in megasas io commands. With commits 6d1511cea0 ("scsi: Reject commands if the CDB length exceeds buf_len") and fe9d8927e2 ("scsi: Add buf_len parameter to scsi_req_new()"), this results in failures to boot Linux f

Re: [PATCH] block/export/fuse.c: fix musl build

2021-10-24 Thread Michael Tokarev
22.10.2021 12:52, Fabrice Fontaine пишет: Include linux/falloc.h if CONFIG_FALLOCATE_ZERO_RANGE is defined to fix https://gitlab.com/qemu-project/qemu/-/commit/50482fda98bd62e072c30b7ea73c985c4e9d9bbb and avoid the following build failure on musl: ../block/export/fuse.c: In function 'fuse_falloc

Re: -blockdev vs -snapshot bug

2022-05-31 Thread Michael Tokarev
31.05.2022 11:30, Philippe Mathieu-Daudé wrote: Cc'ing qemu-block@ FWIW, it is https://bugs.launchpad.net/qemu/+bug/1860759 - I found that one after asking on the qemu ML. Thanks, /mjt

[PATCH] doc: do not recommend -blockdev

2023-03-18 Thread Michael Tokarev
ore, quite some constructs does not work with -blockdev, - for example this is -snapshot. Instead of "recommended" word, use another construct here. Signed-off-by: Michael Tokarev --- qemu-options.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-options.

Re: [PATCH] doc: do not recommend -blockdev

2023-03-18 Thread Michael Tokarev
ld be somewhere anyway. It's a separate step though. Signed-off-by: Michael Tokarev --- qemu-options.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index 59bdf67a2c..8fe31b465d 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1143

Re: [PATCH 04/11] qemu-options: finesse the recommendations around -blockdev

2023-04-01 Thread Michael Tokarev
30.03.2023 13:11, Alex Bennée wrote: We are a bit premature in recommending -blockdev/-device as the best way to configure block devices, especially in the common case. Improve the language to hopefully make things clearer. Suggested-by: Michael Tokarev Signed-off-by: Alex Bennée --- qemu

Re: [PATCH v2 05/11] qemu-options: finesse the recommendations around -blockdev

2023-04-04 Thread Michael Tokarev
04.04.2023 16:57, Kevin Wolf пишет: Let's not make the use of -drive look more advisable than it really is. If you're writing a management tool/script and you're still using -drive today, you're doing it wrong. Kevin, maybe I'm wrong here, but what to do with the situation which started it all,

Re: [PULL 09/28] block: bdrv/blk_co_unref() for calls in coroutine context

2023-05-11 Thread Michael Tokarev
10.05.2023 15:20, Kevin Wolf wrote: These functions must not be called in coroutine context, because they need write access to the graph. How important for this and 2 surrounding changes to be for 7.2-stable (if we'll ever release one)? It smells like real bugs are being fixed here, is it ever

Re: [PULL 09/28] block: bdrv/blk_co_unref() for calls in coroutine context

2023-05-15 Thread Michael Tokarev
15.05.2023 16:07, Kevin Wolf wrote: Am 11.05.2023 um 17:32 hat Michael Tokarev geschrieben: 10.05.2023 15:20, Kevin Wolf wrote: These functions must not be called in coroutine context, because they need write access to the graph. How important for this and 2 surrounding changes to be for 7.2

Re: [PULL 17/18] aio-posix: do not nest poll handlers

2023-05-18 Thread Michael Tokarev
17.05.2023 19:51, Kevin Wolf wrote: From: Stefan Hajnoczi QEMU's event loop supports nesting, which means that event handler functions may themselves call aio_poll(). The condition that triggered a handler must be reset before the nested aio_poll() call, otherwise the same handler will be calle

Re: [PATCH 1/6] qemu-img: rebase: stop when reaching EOF of old backing file

2023-06-01 Thread Michael Tokarev
01.06.2023 22:28, Andrey Drobyshev via пишет: In case when we're rebasing within one backing chain, and when target image is larger than old backing file, bdrv_is_allocated_above() ends up setting *pnum = 0. As a result, target offset isn't getting incremented, and we get stuck in an infinite fo

Re: [PULL 02/17] block: Collapse padded I/O vecs exceeding IOV_MAX

2023-06-06 Thread Michael Tokarev
05.06.2023 18:45, Hanna Czenczek wrote: When processing vectored guest requests that are not aligned to the storage request alignment, we pad them by adding head and/or tail buffers for a read-modify-write cycle. The guest can submit I/O vectors up to IOV_MAX (1024) in length, but with this padd

Re: [PULL 02/17] block: Collapse padded I/O vecs exceeding IOV_MAX

2023-06-06 Thread Michael Tokarev
06.06.2023 11:45, Hanna Czenczek wrote: On 06.06.23 10:00, Michael Tokarev wrote: .. This seems to be over-complicated, both of them, no? I would have preferred to have this discussion while the patch was still on-list for review (this specific version was for two months, counting from the

Re: [PULL 05/17] parallels: Out of image offset in BAT leads to image inflation

2023-06-06 Thread Michael Tokarev
05.06.2023 18:45, Hanna Czenczek wrote: From: Alexander Ivanov data_end field in BDRVParallelsState is set to the biggest offset present in BAT. If this offset is outside of the image, any further write will create the cluster at this offset and/or the image will be truncated to this offset on

Re: [PULL 05/17] parallels: Out of image offset in BAT leads to image inflation

2023-06-07 Thread Michael Tokarev
07.06.2023 09:51, Michael Tokarev wrote: 05.06.2023 18:45, Hanna Czenczek wrote: From: Alexander Ivanov data_end field in BDRVParallelsState is set to the biggest offset present in BAT. If this offset is outside of the image, any further write will create the cluster at this offset and/or the

Re: [PULL 05/17] parallels: Out of image offset in BAT leads to image inflation

2023-06-09 Thread Michael Tokarev
09.06.2023 11:54, Denis V. Lunev wrote: On 6/7/23 17:14, Hanna Czenczek wrote: ..>>> This, and a few other parallels changes in this series: Should these be applied to -stable too, or is it not important? Personally, I don’t think they need to be in stable; but I’ll leave the final judgment

Re: [PATCH v3 8/8] hw/ide/ahci: fix broken SError handling

2023-07-19 Thread Michael Tokarev
19.07.2023 14:59, Philippe Mathieu-Daudé wrote: On 9/6/23 16:08, Niklas Cassel wrote: From: Niklas Cassel When encountering an NCQ error, you should not write the NCQ tag to the SError register. This is completely wrong. The SError register has a clear definition, where each bit represents a

Re: [PULL 1/1] hw/nvme: fix endianness issue for shadow doorbells

2023-07-19 Thread Michael Tokarev
tched my eye in a row of applied patches.. Also, why v is computed a few lines before it is used, with some expressions between the assignment and usage? How about the following patch: From: Michael Tokarev Date: Wed, 19 Jul 2023 23:10:53 +0300 Subject: [PATCH trivial] hw/nvme: fix siz

Re: -drive if=none: can't we make this the default?

2023-11-02 Thread Michael Tokarev
02.11.2023 17:06, Kevin Wolf: Am 02.11.2023 um 12:01 hat Peter Maydell geschrieben: Whoops, have I got the terminology wrong again? To me these are "snapshots" (they do store the whole VM state including the current state of the disk, and "qemu-img info" lists them as "snapshots"), whereas I nev

Re: [PATCH v3 4/6] block/nvme: nvme_process_completion() fix bound for cid

2023-11-07 Thread Michael Tokarev
17.10.2023 15:59, Vladimir Sementsov-Ogievskiy: NVMeQueuePair::reqs has length NVME_NUM_REQS, which less than NVME_QUEUE_SIZE by 1. Fixes: 1086e95da17050 ("block/nvme: switch to a NVMeRequest freelist") Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Stefan Hajnoczi Reviewed-by: Maksi

Re: [PATCH] file-posix: fix over-writing of returning zone_append offset

2023-11-07 Thread Michael Tokarev
30.10.2023 10:38, Naohiro Aota wrote: raw_co_zone_append() sets "s->offset" where "BDRVRawState *s". This pointer is used later at raw_co_prw() to save the block address where the data is written. When multiple IOs are on-going at the same time, a later IO's raw_co_zone_append() call over-writes

Re: [PATCH v2] block/file-posix: fix update_zones_wp() caller

2023-11-07 Thread Michael Tokarev
25.08.2023 07:05, Sam Li wrote: When the zoned request fail, it needs to update only the wp of the target zones for not disrupting the in-flight writes on these other zones. The wp is updated successfully after the request completes. Fixed the callers with right offset and nr_zones. This smell

Re: [PATCH v3] hw/ide/ahci: fix legacy software reset

2023-11-17 Thread Michael Tokarev
10.11.2023 12:51, Kevin Wolf: Am 08.11.2023 um 23:26 hat Niklas Cassel geschrieben: From: Niklas Cassel Legacy software contains a standard mechanism for generating a reset to a Serial ATA device - setting the SRST (software reset) bit in the Device Control register. ... Fixes: e2a5d9b3d9c3

Re: [PATCH 0/3] block: Make snapshots fail gracefully on inactive images

2023-12-22 Thread Michael Tokarev
01.12.2023 17:25, Kevin Wolf : Kevin Wolf (3): block: Fix crash when loading snapshot on inactive node vl: Improve error message for conflicting -incoming and -loadvm iotests: Basic tests for internal snapshots This smells like a stable-8.2 material, at least the first change (tho I'd

Re: [PATCH] docs: fix typo

2023-12-23 Thread Michael Tokarev
15.12.2023 01:53, Samuel Tardieu wrote: Signed-off-by: Samuel Tardieu --- docs/tools/qemu-img.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Applied to the trivial-patches tree, with a more specific subject line: docs/tools/qemu-img.rst: fix typo (sumarizes) Thanks, /mjt

Re: [PATCH] virtio-blk: Fix potential nullpointer read access in virtio_blk_data_plane_destroy

2023-12-25 Thread Michael Tokarev
24.12.2023 14:43, Stefan Weil: Fixes: CID 1532828 Fixes: b6948ab01d ("virtio-blk: add iothread-vq-mapping parameter") Signed-off-by: Stefan Weil Applied to the trivial-patches tree, thank you! /mjt

Re: [PATCH 0/3] monitor: only run coroutine commands in qemu_aio_context

2024-01-18 Thread Michael Tokarev
16.01.2024 22:00, Stefan Hajnoczi wrote: Several bugs have been reported related to how QMP commands are rescheduled in qemu_aio_context: - https://gitlab.com/qemu-project/qemu/-/issues/1933 - https://issues.redhat.com/browse/RHEL-17369 - https://bugzilla.redhat.com/show_bug.cgi?id=2215192 - http

Re: [PATCH v2 0/3] hw/pflash: implement update buffer for block writes

2024-01-20 Thread Michael Tokarev
08.01.2024 19:08, Gerd Hoffmann: When running qemu with edk2 efi firmware on aarch64 the efi variable store in pflash can get corrupted. qemu not doing proper block writes -- flush all or nothing to storage -- is a hot candidate for being the root cause. This little series tries to fix that wit

Re: [PULL 0/2] Block patches

2024-01-25 Thread Michael Tokarev
22.01.2024 19:01, Stefan Hajnoczi : Akihiko Odaki (1): coroutine-ucontext: Save fake stack for pooled coroutine Fiona Ebner (1): block/io: clear BDRV_BLOCK_RECURSE flag after recursing in bdrv_co_block_status These too also look like -stable matherial, both of the changes. Please l

Re: [PATCH v2] block/blkio: Make s->mem_region_alignment be 64 bits

2024-02-01 Thread Michael Tokarev
30.01.2024 15:20, Richard W.M. Jones : With GCC 14 the code failed to compile on i686 (and was wrong for any version of GCC): ../block/blkio.c: In function ‘blkio_file_open’: ../block/blkio.c:857:28: error: passing argument 3 of ‘blkio_get_uint64’ from incompatible pointer type [-Wincompatible-

Re: [PATCH] pflash: fix sectors vs bytes confusion in blk_pread_nonzeroes()

2024-02-01 Thread Michael Tokarev
30.01.2024 03:27, Stefan Hajnoczi wrote: The following expression is incorrect because blk_pread_nonzeroes() deals in units of bytes, not sectors: bytes = MIN(size - offset, BDRV_REQUEST_MAX_SECTORS) ^^^ BDRV_REQUEST_MAX_BYTES is the appropr

Re: [PATCH 3/3] monitor: only run coroutine commands in qemu_aio_context

2024-02-03 Thread Michael Tokarev
16.01.2024 22:00, Stefan Hajnoczi пишет: monitor_qmp_dispatcher_co() runs in the iohandler AioContext that is not polled during nested event loops. The coroutine currently reschedules itself in the main loop's qemu_aio_context AioContext, which is polled during nested event loops. One known probl

Re: [PATCH 3/3] monitor: only run coroutine commands in qemu_aio_context

2024-02-03 Thread Michael Tokarev
03.02.2024 12:01, Michael Tokarev wrote: ... This change broke something in 7.2. I'm still debugging it, will come with a follow-up once some more details are found, I'll also check current master with and without this commit. The prob happens with multiple suspend-resume cycles, -

Re: [PATCH] iotests: fix leak of tmpdir in dry-run mode

2024-02-05 Thread Michael Tokarev
x27;.join([os.path.basename(t) for t in tests])) +with env: +print('\n'.join([os.path.basename(t) for t in tests])) else: with TestRunner(env, tap=args.tap, color=args.color) as tr: Reviewed-by: Michael Tokarev (with my limited understanding of this code) Thanks! /mjt

Re: [PATCH] iotests: give tempdir an identifying name

2024-02-05 Thread Michael Tokarev
05.02.2024 18:51, Daniel P. Berrangé wrote: If something goes wrong causing the iotests not to cleanup their temporary directory, it is useful if the dir had an identifying name to show what is to blame. Signed-off-by: Daniel P. Berrangé Revieved-by: Michael Tokarev Thank you again for the

[PATCH trivial] qemu-nbd: mention --tls-hostname option in qemu-nbd --help

2024-02-06 Thread Michael Tokarev
This option was not documented. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1240 Signed-off-by: Michael Tokarev --- qemu-nbd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qemu-nbd.c b/qemu-nbd.c index bac0b5e3ec..d7b3ccab21 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -114,6

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

2024-02-07 Thread Michael Tokarev
Use common code and simplify error message Signed-off-by: Michael Tokarev --- qemu-img.c | 63 -- 1 file changed, 18 insertions(+), 45 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 7668f86769..eb6017d339 100644 --- a/qemu-img.c

[RFC/INCOMPLETE PATCH 0/8] Attempt to make qemu-img options consistent and --help working

2024-02-07 Thread Michael Tokarev
d to have more or less common option descriptions, using various parameters, variables or #defines, but in different commands the same options has slightly different wording, and in some option names are different, so it looks like it's best to have complete text in each subcommand. Michael Toka

[PATCH 1/8] qemu-img: pass current cmdname into command handlers

2024-02-07 Thread Michael Tokarev
useful in --help output as well. Signed-off-by: Michael Tokarev --- qemu-img.c | 150 ++--- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index bcbf51402d..a634747701 100644 --- a/qemu-img.c +++ b/qemu-img.

[PATCH 4/8] qemu-img: refresh options/--help for "check" command

2024-02-07 Thread Michael Tokarev
Add missing long options and --help output. Signed-off-by: Michael Tokarev --- qemu-img.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index f851b290cc..e7d5b1b24b 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -780,7 +780,9

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

2024-02-07 Thread Michael Tokarev
Use common code and simplify error message Signed-off-by: Michael Tokarev --- qemu-img.c | 63 -- 1 file changed, 18 insertions(+), 45 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index b94622fadb..f851b290cc 100644 --- a/qemu-img.c

[PATCH 8/8] qemu-img: refresh options/--help for "convert" command

2024-02-07 Thread Michael Tokarev
Signed-off-by: Michael Tokarev --- qemu-img.c | 46 +- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index ea3fe95169..c8fba27e35 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -2351,14 +2351,28 @@ static int

[PATCH 5/8] qemu-img: simplify --repair error message

2024-02-07 Thread Michael Tokarev
Signed-off-by: Michael Tokarev --- qemu-img.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index e7d5b1b24b..31c1891b43 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -829,8 +829,8 @@ static int img_check(const char *cmdname, int argc, char **argv

[PATCH 2/8] qemu-img: refresh options/--help for "create" subcommand

2024-02-07 Thread Michael Tokarev
Add missing long options (eg --format). Create helper function cmd_help() to display command-specific help text, and use it to print --help for create. Signed-off-by: Michael Tokarev --- qemu-img.c | 33 - 1 file changed, 32 insertions(+), 1 deletion(-) diff

[PATCH 6/8] qemu-img: refresh options/--help for "commit" command

2024-02-07 Thread Michael Tokarev
Add missing long options and --help output. Signed-off-by: Michael Tokarev --- qemu-img.c | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index 31c1891b43..7ff63aeea2 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1015,8 +1015,15

[PATCH 7/8] qemu-img: refresh options/--help for "compare" command

2024-02-07 Thread Michael Tokarev
Signed-off-by: Michael Tokarev --- qemu-img.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index 7ff63aeea2..ea3fe95169 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1447,9 +1447,15 @@ static int img_compare(const char *cmdname

Re: [RFC/INCOMPLETE PATCH 0/8] Attempt to make qemu-img options consistent and --help working

2024-02-07 Thread Michael Tokarev
07.02.2024 22:01, Manos Pitsidianakis: Hello Michael, Such changes are long overdue. However given the complexity of commands and arguments, maybe it'd be a good idea to write a code generator for the command line interface, This way you could also generate --help outputs, manpages, shell comple

Re: [PULL 1/1] virtio-blk: avoid using ioeventfd state in irqfd conditional

2024-02-07 Thread Michael Tokarev
06.02.2024 18:31, Stefan Hajnoczi : Requests that complete in an IOThread use irqfd to notify the guest while requests that complete in the main loop thread use the traditional qdev irq code path. The reason for this conditional is that the irq code path requires the BQL: if (s->ioeventfd_sta

Re: [PULL 1/1] virtio-blk: avoid using ioeventfd state in irqfd conditional

2024-02-08 Thread Michael Tokarev
08.02.2024 11:42, Kevin Wolf wrote: The patch email itself was CCed to qemu-stable and even contained a note for backporting to stable: https://lists.gnu.org/archive/html/qemu-block/2024-01/msg00278.html Ahh. Yes. I'm having a large(ish) queue in stable and missed the fact I already has this

Re: [PATCH] pflash: fix sectors vs bytes confusion in blk_pread_nonzeroes()

2024-02-08 Thread Michael Tokarev
09.02.2024 00:21, Stefan Hajnoczi wrote: On Thu, 1 Feb 2024 at 06:37, Michael Tokarev wrote: for (;;) { -bytes = MIN(size - offset, BDRV_REQUEST_MAX_SECTORS); +bytes = MIN(size - offset, BDRV_REQUEST_MAX_BYTES); Hmm. This smells like a -stable material, but you know

Re: [PATCH 0/2] block: Allow concurrent BB context changes

2024-02-09 Thread Michael Tokarev
02.02.2024 17:47, Hanna Czenczek : Hi, Without the AioContext lock, a BB's context may kind of change at any time (unless it has a root node, and I/O requests are pending). That also means that its own context (BlockBackend.ctx) and that of its root node can differ sometimes (while the context

Re: [PATCH v2 3/3] virtio-blk: Use ioeventfd_attach in start_ioeventfd

2024-02-09 Thread Michael Tokarev
02.02.2024 18:31, Hanna Czenczek : Commit d3f6f294aeadd5f88caf0155e4360808c95b3146 ("virtio-blk: always set ioeventfd during startup") has made virtio_blk_start_ioeventfd() always kick the virtqueue (set the ioeventfd), regardless of whether the BB is drained. That is no longer necessary, becaus

[PATCH 00/23] qemu-img: refersh options and --help handling

2024-02-09 Thread Michael Tokarev
le1) with target (file2). For bitmap, things are scary, I'm not sure what -b SRC_FILENAME really means, - for now I gave it --source option, but this does not make it more clear, suggestions welcome. There are many other inconsistencies, I can't fix them all in one go.. :) Michael Tokarev

  1   2   3   4   >