Re: [RFC v2 02/10] Drop unused static function return values

2022-08-12 Thread Alberto Faria
On Wed, Aug 3, 2022 at 12:15 PM Richard W.M. Jones wrote: > If it helps to think about this, Coverity checks for consistency. > Across the whole code base, is the return value of a function used or > ignored consistently. You will see Coverity errors like: > > Error: CHECKED_RETURN

Re: [RFC v2 02/10] Drop unused static function return values

2022-08-12 Thread Alberto Faria
On Wed, Aug 3, 2022 at 1:30 PM Peter Maydell wrote: > The problem with a patch like this is that it rolls up into a > single patch changes to the API of many functions in multiple > subsystems across the whole codebase. Some of those changes > might be right; some might be wrong. No single person

Re: [RFC v2 00/10] Introduce an extensible static analyzer

2022-08-12 Thread Alberto Faria
On Thu, Aug 4, 2022 at 12:44 PM Marc-André Lureau wrote: > Hi > > Great work so far! This seems easier to hack than my attempt to use > clang-tidy to write some qemu checks > (https://github.com/elmarco/clang-tools-extra) > > The code seems quite generic, I wonder if such a tool in python wasn't

Re: [PATCH v2 0/8] parallels: Refactor the code of images checks and fix a bug

2022-08-12 Thread Denis V. Lunev
On 11.08.2022 17:00, Alexander Ivanov wrote: Fix image inflation when offset in BAT is out of image. Replace whole BAT syncing by flushing only dirty blocks. Move all the checks outside the main check function in separate functions Use WITH_QEMU_LOCK_GUARD for more clean code. Alexander

Re: [PATCH v2 8/8] parallels: Replace qemu_co_mutex_lock by WITH_QEMU_LOCK_GUARD

2022-08-12 Thread Denis V. Lunev
On 11.08.2022 17:00, Alexander Ivanov wrote: Replace the way we use mutex in parallels_co_check() for more clean code. I think that "cleaness" is the same, but new code would be just shorter ;) or less error prone. v2: Fix an incorrect usage of WITH_QEMU_LOCK_GUARD. Signed-off-by: Alexander

Re: [PATCH v2 7/8] parallels: Move statistic collection to a separate function

2022-08-12 Thread Denis V. Lunev
On 11.08.2022 17:00, Alexander Ivanov wrote: v2: Move fragmentation counting code to this function too. same note here about ChnageLog and motivation Signed-off-by: Alexander Ivanov --- block/parallels.c | 54 +++ 1 file changed, 31

Re: [PATCH v2 6/8] parallels: Move check of leaks to a separate function

2022-08-12 Thread Denis V. Lunev
On 11.08.2022 17:00, Alexander Ivanov wrote: v2: No changes. same notes about motivation, changelog as before Signed-off-by: Alexander Ivanov --- block/parallels.c | 85 +-- 1 file changed, 52 insertions(+), 33 deletions(-) diff --git

Re: [PATCH v2 5/8] parallels: Move check of cluster outside image to a separate function

2022-08-12 Thread Denis V. Lunev
On 11.08.2022 17:00, Alexander Ivanov wrote: v2: Move unrelated helper parallels_set_bat_entry creation to a separate patch. same notes as for previous patch Signed-off-by: Alexander Ivanov --- block/parallels.c | 48 ++- 1 file changed,

Re: [PATCH v2 4/8] parallels: Move check of unclean image to a separate function

2022-08-12 Thread Denis V. Lunev
On 11.08.2022 17:00, Alexander Ivanov wrote: v2: Revert the condition with s->header_unclean. same comment about change log as previously And commit message misses motivation part, why we are doing this rework. What is the goal of this change? The code part is clean. Signed-off-by:

Re: [PATCH v2 3/8] parallels: Replace bdrv_co_pwrite_sync by bdrv_co_flush for BAT flushing

2022-08-12 Thread Denis V. Lunev
Use generic infrastructure for BAT writing in parallels_co_check() On 11.08.2022 17:00, Alexander Ivanov wrote: It's too costly to write all the BAT to the disk. Let the flush function write only dirty blocks. Use parallels_set_bat_entry for setting a BAT entry and marking a relevant block as

Re: [PATCH v2 2/8] parallels: Move BAT entry setting to a separate function

2022-08-12 Thread Denis V. Lunev
On 11.08.2022 17:00, Alexander Ivanov wrote: Will need to set BAT entry in multiple places. Move the code of settings entries and marking relevant blocks dirty to a separate helper parallels_set_bat_entry. The comment and the patch text is ambiguous. You say that we need to set BAT in multiple

Re: [PATCH v2 1/8] parallels: Out of image offset in BAT leads to image inflation

2022-08-12 Thread Denis V. Lunev
On 11.08.2022 17:00, Alexander Ivanov wrote: When an image is opened, data_end field in BDRVParallelsState is setted as the biggest offset in the BAT plus cluster size. If there is a corrupted offset pointing outside the image, the image size increase accordingly. It potentially leads to

[PATCH] hw/nvme: remove param zoned.auto_transition

2022-08-12 Thread Niklas Cassel via
The intention of the Zoned Namespace Command Set Specification was never to make an automatic zone transition optional. Excerpt from the nvmexpress.org zns mailing list: """ A question came up internally on the differences between ZNS and ZAC/ZBC that asked about when a controller should