On Mon, Sep 5, 2022 at 8:45 AM Paolo Bonzini wrote:
> Thanks, I will queue it.
>
> Paolo
>
> Il lun 5 set 2022, 02:00 Alberto Faria ha scritto:
>>
>> flatview_(read|write)_continue() must be called with an address in the
>> FlatView's addres
en modified since they last passed
those checks.
- Ignore translation units from git submodules.
- And more.
Alberto Faria (10):
Add an extensible static analyzer
Drop unused static function return values
static-analyzer: Support adding tests to checks
static-analyzer: Avoid reanaly
Make non-void static functions whose return values are ignored by
all callers return void instead.
These functions were found by static-analyzer.py.
Not all occurrences of this problem were fixed.
Signed-off-by: Alberto Faria
---
accel/kvm/kvm-all.c | 12 ++---
accel/tcg
hat the return value of static, non-void functions is used by
at least one caller.
Signed-off-by: Alberto Faria
---
static-analyzer.py | 486 +
static_analyzer/__init__.py| 242 ++
static_analyzer/return_value_never_used.py
Introduce an add_check_tests() method to add output-comparison tests to
checks, and add some tests to the "return-value-never-used" check.
Signed-off-by: Alberto Faria
---
static-analyzer.py | 133 -
static_analyzer/__init__.py
For each translation unit, run each check only if any of the translation
unit's files has been modified since the last time the check ran and
passed without reporting problems.
Signed-off-by: Alberto Faria
---
static-analyzer.py | 240 -
1
static analyzer.
Signed-off-by: Alberto Faria
---
include/qemu/coroutine.h| 13 +++
static_analyzer/__init__.py | 46 -
static_analyzer/coroutine_fn.py | 173
3 files changed, 231 insertions(+), 1 deletion(-)
create mode 100644
problems were found by static-analyzer.py.
Not all occurrences of these problems were fixed.
Signed-off-by: Alberto Faria
---
block.c| 2 +-
block/dirty-bitmap.c | 6 --
block/io.c | 18 +++---
block/monitor/block-hmp-cmds.c
; check to static-analyzer.py that enforces
no_coroutine_fn rules.
Signed-off-by: Alberto Faria
---
include/block/block-common.h | 2 +-
include/qemu/coroutine.h | 12
static_analyzer/no_coroutine_fn.py | 111 +
3 files changed, 124 insert
ine_fn function.
Signed-off-by: Alberto Faria
---
static_analyzer/__init__.py | 27
static_analyzer/coroutine_fn.py | 115 ++--
2 files changed, 138 insertions(+), 4 deletions(-)
diff --git a/static_analyzer/__init__.py b/static_analyzer/__init__.py
i
These problems were found by static-analyzer.py.
Not all occurrences of these problems were fixed.
Signed-off-by: Alberto Faria
---
block/backup.c | 2 +-
include/block/block_int-common.h | 12 +---
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/block
These calls were found by static-analyzer.py.
Not all occurrences of this problem were fixed.
Signed-off-by: Alberto Faria
---
block/commit.c | 2 +-
block/io.c | 4 ++--
block/mirror.c | 4 ++--
block/parallels.c | 28 ++--
block
On Wed, Aug 3, 2022 at 11:46 AM Dr. David Alan Gilbert
wrote:
>
> * Alberto Faria (afa...@redhat.com) wrote:
> > Make non-void static functions whose return values are ignored by
> > all callers return void instead.
> >
> > These functions were found by stati
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
>
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
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 (CWE-252
On Thu, Jun 9, 2022 at 4:27 PM Alberto Faria wrote:
> Start by making the interfaces of analogous non-coroutine and coroutine
> functions consistent with each other, then implement the non-coroutine
> ones using generated_co_wrapper.
>
> For the bdrv_pwrite_sync() case, also
ython3-clang` should suffice.
Alberto Faria (8):
Add an extensible static analyzer
Drop some unused static function return values
static-analyzer: Enforce coroutine_fn restrictions for direct calls
Fix some direct calls from non-coroutine_fn to coroutine_fn
static-analyzer: Enforce coroutin
, non-void functions is used by at least one caller.
Signed-off-by: Alberto Faria
---
static-analyzer.py | 509 +
1 file changed, 509 insertions(+)
create mode 100755 static-analyzer.py
diff --git a/static-analyzer.py b/static-analyzer.py
new file mode 10
These problems were found by static-analyzer.py. Only a few of the
reported cases were fixed.
Signed-off-by: Alberto Faria
---
block/block-backend.c | 13 -
block/copy-before-write.c | 3 ++-
block/dirty-bitmap.c | 6 --
block/iscsi.c | 3 ++-
block/qcow2
Make some non-void static functions whose return values are ignored by
all callers return void instead.
These functions were found by the shiny new static-analyzer.py. Only a
few of the reported cases were fixed.
Signed-off-by: Alberto Faria
---
block/file-posix.c | 6 +-
block/io.c
These problems were found by static-analyzer.py. Only a few of the
reported cases were fixed.
Signed-off-by: Alberto Faria
---
include/block/block_int-common.h | 12 +---
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/include/block/block_int-common.h b/include/block
Extend static-analyzer.py to enforce coroutine_fn restrictions on
function pointer operations.
Invalid operations include assigning a coroutine_fn value to a
non-coroutine_fn function pointer, and invoking a coroutine_fn function
pointer from a non-coroutine_fn function.
Signed-off-by: Alberto
ff-by: Alberto Faria
---
include/qemu/coroutine.h | 13 +++
static-analyzer.py | 207 +++
2 files changed, 220 insertions(+)
diff --git a/include/qemu/coroutine.h b/include/qemu/coroutine.h
index 08c5bb3c76..40a4037525 100644
--- a/include/qemu/coroutine.h
x27;s "coroutine-annotation-validity" and
"coroutine-calls" checks to enforce no_coroutine_fn rules.
Signed-off-by: Alberto Faria
---
include/block/block-common.h | 2 +-
include/qemu/coroutine.h | 12
static-analyzer.py | 35 +++
These calls were found by static-analyzer.py.
Signed-off-by: Alberto Faria
---
block/block-backend.c | 2 +-
block/io.c | 10 +-
block/parallels.c | 4 ++--
block/qcow2-refcount.c | 2 +-
block/qed-table.c | 2 +-
block/qed.c| 2 +-
block/vmdk.c
On Sat, Jul 2, 2022 at 3:13 PM Paolo Bonzini wrote:
> These functions should be coroutine_fn (all coroutine entry points
> should be).
Thanks, I see now that you fixed this in [1].
Alberto
[1] https://patchew.org/QEMU/20220509103019.215041-1-pbonz...@redhat.com/
On Sat, Jul 2, 2022 at 3:12 PM Paolo Bonzini wrote:
> Alberto, does this need a rebase?
This applies cleanly on "[PATCH v5 00/10] Implement
bdrv_{pread,pwrite,pwrite_sync,pwrite_zeroes}() using
generated_co_wrapper" [1], which applies cleanly to master.
Alberto
[1]
https://lore.kernel.org/qemu
On Thu, Jun 23, 2022 at 10:47 PM Eric Blake wrote:
> I did not get through all of the callers (you are right, there ARE a
> lot), but the ones I checked, particularly in block/qcow2-*.c, appear
> to handle -EIO just fine.
>
> I did notice, however, that qcow2-bitmap.c:free_bitmap_clusters()
> retu
8
> 1 file changed, 4 insertions(+), 4 deletions(-)
Isn't this sort of justification the wrong way around?
Regardless:
Reviewed-by: Alberto Faria
lock/qcow2-refcount.c | 4 ++--
> block/qcow2.h | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Alberto Faria
On Mon, May 9, 2022 at 11:54 AM Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini
> ---
> block/file-posix.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Alberto Faria
On Mon, May 9, 2022 at 11:39 AM Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini
> ---
> block/iscsi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Alberto Faria
; Signed-off-by: Paolo Bonzini
> ---
> include/block/nbd.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Alberto Faria
; util/qemu-coroutine.c| 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Alberto Faria
On Mon, May 9, 2022 at 11:57 AM Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini
> ---
> block/copy-before-write.c | 8
> 1 file changed, 4 insertions(+), 4 deletions(-)
Some overly long lines.
Reviewed-by: Alberto Faria
On Mon, May 9, 2022 at 11:46 AM Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini
> ---
> block/nfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Alberto Faria
19 insertions(+), 19 deletions(-)
Some overly long lines.
Reviewed-by: Alberto Faria
int64_t bytes, BdrvRequestFlags flags)
> +static int coroutine_fn quorum_co_pwrite_zeroes(BlockDriverState *bs,
> +int64_t offset, int64_t
> bytes,
> +BdrvRequestFlags flags)
>
> {
> return quorum_co_pwritev(bs, offset, bytes, NULL,
> --
> 2.35.1
Reviewed-by: Alberto Faria
On Mon, May 9, 2022 at 11:46 AM Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini
> ---
> block/blkverify.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Alberto Faria
On Mon, May 9, 2022 at 12:05 PM Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini
> ---
> block/qed.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Alberto Faria
On Mon, May 9, 2022 at 12:18 PM Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini
> ---
> block/vmdk.c | 20 ++--
> 1 file changed, 10 insertions(+), 10 deletions(-)
Some overly long lines.
Reviewed-by: Alberto Faria
On Mon, May 9, 2022 at 11:54 AM Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini
> ---
> block/nbd.c | 10 +-
> 1 file changed, 5 insertions(+), 5 deletions(-)
Reviewed-by: Alberto Faria
On Mon, May 9, 2022 at 12:13 PM Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini
> ---
> block/throttle.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Alberto Faria
On Mon, May 9, 2022 at 11:46 AM Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini
> ---
> block/parallels.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Reviewed-by: Alberto Faria
2 insertions(+), 1 deletion(-)
Reviewed-by: Alberto Faria
On Mon, May 9, 2022 at 12:08 PM Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini
> ---
> block/curl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Alberto Faria
On Mon, May 9, 2022 at 12:09 PM Paolo Bonzini wrote:
> From: Marc-André Lureau
>
> Signed-off-by: Marc-André Lureau
> Acked-by: Greg Kurz
> Signed-off-by: Paolo Bonzini
> ---
> hw/9pfs/9p.h | 9 ++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
Reviewed-by: Alberto Faria
On Mon, May 9, 2022 at 12:02 PM Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini
> ---
> block/nvme.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Reviewed-by: Alberto Faria
On Mon, May 9, 2022 at 12:02 PM Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini
> ---
> include/qemu/job.h | 2 +-
> job.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Alberto Faria
id
> *buf)
> +static int coroutine_fn raw_co_ioctl(BlockDriverState *bs, unsigned long int
> req, void *buf)
Overly long line.
> {
> BDRVRawState *s = bs->opaque;
> if (s->offset || s->has_size) {
> --
> 2.35.1
Reviewed-by: Alberto Faria
On Mon, May 9, 2022 at 12:13 PM Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini
> ---
> util/qemu-coroutine-lock.c | 14 +++---
> 1 file changed, 7 insertions(+), 7 deletions(-)
Reviewed-by: Alberto Faria
ile changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Alberto Faria
On Mon, Jul 4, 2022 at 2:52 PM Hanna Reitz wrote:
> There are a couple of places where you decided to replace “*len”
> variables that used to store the return value by a plain “ret”. That
> seems good to me, given how these functions no longer return length
> values, but you haven’t done so consis
Hi Víctor,
On Mon, Jul 4, 2022 at 3:18 PM Víctor Colombo
wrote:
> And I receive an exception on the line above saying that node is of type
> NoneType. Seems that `node = node.referenced` is setting `node` to None
> in this case.
>
> I was unable to understand the root cause of it. Is this an inco
On Mon, Jul 4, 2022 at 6:46 PM Víctor Colombo
wrote:
> Yes, this line is present at the beginning of the output
> Is this caused by problems with the code being analyzed or is it because
> libclang is getting confused with something that is outside of our
> control?
I think I found the problem: t
On Mon, Jul 4, 2022 at 5:28 PM Daniel P. Berrangé wrote:
> Have you done any measurement see how much of the overhead is from
> the checks you implemented, vs how much is inherantly forced on us
> by libclang ? ie what does it look like if you just load the libclang
> framework and run it actross
On Tue, Jul 5, 2022 at 8:16 AM Daniel P. Berrangé wrote:
> for i in `git ls-tree --name-only -r HEAD:`
> do
> clang-tidy $i 1>/dev/null 2>&1
> done
All of those invocations are probably failing quickly due to missing
includes and other problems, since the location of the co
On Tue, Jul 5, 2022 at 10:18 AM Hanna Reitz wrote:
> This moves blk_co_copy_range() from the “I/O API functions” section of
> this header into the “"I/O or GS" API functions” section. Is that intended?
Oops, thanks, it wasn't intended. Will fix.
Alberto
old return values
from blk_{pread,pwrite}(), as they don't return a length anymore.
- Drop variables in_ret and out_ret in qemu-img.c:img_dd().
- Initialize buf in test_sync_op_blk_pwritev_part().
- Keep blk_co_copy_range() in the "I/O API functions" section of
include
They currently return the value of their 'bytes' parameter on success.
Make them return 0 instead, for consistency with other I/O functions and
in preparation to implement them using generated_co_wrapper. This also
makes it clear that short reads/writes are not possible.
Signed-off-b
hat
file was updated manually.
Overly-long lines were then fixed by hand.
Signed-off-by: Alberto Faria
Reviewed-by: Eric Blake
Reviewed-by: Hanna Reitz
---
block.c | 2 +-
block/block-backend.c | 4 +--
block/commit.c| 4
For consistency with other I/O functions, and in preparation to
implement them using generated_co_wrapper.
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
Reviewed-by: Hanna Reitz
---
block/block-backend.c | 6 +++---
include/sysemu/block-backend-io.h | 6 +++---
2 files
It does not mutate the buffer.
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
Reviewed-by: Hanna Reitz
---
include/sysemu/block-backend-io.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/sysemu/block-backend-io.h
b/include/sysemu/block-backend-io.h
no effect on hw/block/nand.c, presumably due to the #if, so that
file was updated manually.
Overly-long lines were then fixed by hand.
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
Reviewed-by: Greg Kurz
Reviewed-by: Hanna Reitz
---
block.c | 2 +-
block
We need to add include/sysemu/block-backend-io.h to the inputs of the
block-gen.c target defined in block/meson.build.
Signed-off-by: Alberto Faria
Reviewed-by: Hanna Reitz
---
block/block-backend.c | 23 ---
block/coroutines.h| 4
block
Swap 'buf' and 'bytes' around for consistency with other I/O functions.
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
Reviewed-by: Hanna Reitz
---
block/block-backend.c | 4 ++--
include/sysemu/block-backend-io.h | 4 ++--
qemu-img.c
Implement them using generated_co_wrapper.
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
Reviewed-by: Hanna Reitz
---
include/sysemu/block-backend-io.h | 6 +
tests/unit/test-block-iothread.c | 42 ++-
2 files changed, 47 insertions(+), 1 deletion
Implement blk_preadv_part() using generated_co_wrapper.
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
Reviewed-by: Hanna Reitz
---
block/block-backend.c | 30 +++---
block/coroutines.h| 5 -
include/sysemu/block-backend-io.h
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
Reviewed-by: Hanna Reitz
---
block/block-backend.c | 12
block/coroutines.h| 3 ---
include/sysemu/block-backend-io.h | 3 ++-
3 files changed, 2 insertions(+), 16 deletions(-)
diff --git a
Also convert it into a generated_co_wrapper.
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
Reviewed-by: Hanna Reitz
---
block/block-backend.c | 14 --
block/coroutines.h| 5 -
include/sysemu/block-backend-io.h | 4
tests/unit/test
Also convert blk_truncate() into a generated_co_wrapper.
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
Reviewed-by: Hanna Reitz
---
block/block-backend.c | 7 ---
include/sysemu/block-backend-io.h | 8 ++--
tests/unit/test-block-iothread.c | 14
Some can be made static, others are unused generated_co_wrappers.
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
Reviewed-by: Hanna Reitz
---
block/block-backend.c | 6 +++---
block/coroutines.h| 19 ---
2 files changed, 3 insertions(+), 22 deletions(-)
diff
Also convert blk_ioctl() into a generated_co_wrapper.
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
Reviewed-by: Hanna Reitz
---
block/block-backend.c | 7 ---
block/coroutines.h| 6 --
include/sysemu/block-backend-io.h | 5 -
3 files changed
Also convert blk_pwrite_compressed() into a generated_co_wrapper.
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
Reviewed-by: Hanna Reitz
---
block/block-backend.c | 8
include/sysemu/block-backend-io.h | 7 +--
tests/unit/test-block-iothread.c | 18
Keep generated_co_wrapper and coroutine_fn pairs together. This should
make it clear that each I/O function has these two versions.
Also move blk_co_{pread,pwrite}()'s implementations out of the header
file for consistency.
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
---
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
Reviewed-by: Hanna Reitz
---
block/block-backend.c | 8
include/sysemu/block-backend-io.h | 5 +++--
tests/unit/test-block-iothread.c | 17 +
3 files changed, 20 insertions(+), 10 deletions(-)
diff
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
Reviewed-by: Hanna Reitz
---
block/block-backend.c | 11 ---
block/coroutines.h| 2 --
include/sysemu/block-backend-io.h | 2 +-
3 files changed, 1 insertion(+), 14 deletions(-)
diff --git a/block
Start by making the interfaces of analogous non-coroutine and coroutine
functions consistent with each other, then implement the non-coroutine
ones using generated_co_wrapper.
For the bdrv_pwrite_sync() case, also add the missing
bdrv_co_pwrite_sync() function.
Alberto Faria (7):
block: Add a
llers that rely on the previous behavior are adjusted
accordingly by hand.
Signed-off-by: Alberto Faria
---
block/cloop.c| 2 +-
block/crypto.c | 4 ++--
block/dmg.c | 10 +-
block/io.c | 10 ++
bl
t, buf, bytes, flags; @@
- bdrv_pwrite_sync(child, offset, buf, bytes, flags)
+ bdrv_pwrite_sync(child, offset, bytes, buf, flags)
Resulting overly-long lines were then fixed by hand.
Signed-off-by: Alberto Faria
---
block/blklogwrites.c | 6 ++--
block/bochs.c| 10 +
)
Resulting overly-long lines were then fixed by hand.
Signed-off-by: Alberto Faria
---
block/blklogwrites.c | 4 +--
block/bochs.c| 6 ++--
block/cloop.c| 10 +++---
block/crypto.c | 4 +--
block/dmg.c | 24
For consistency with other I/O functions, and in preparation to
implement bdrv_{pread,pwrite}() using generated_co_wrapper.
unsigned int fits in int64_t, so all callers remain correct.
Signed-off-by: Alberto Faria
---
block/coroutines.h | 4 ++--
include/block/block_int-io.h | 4
Also convert bdrv_pwrite_sync() to being implemented using
generated_co_wrapper.
Signed-off-by: Alberto Faria
---
block/io.c | 5 +++--
include/block/block-io.h | 8 ++--
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/block/io.c b/block/io.c
index ecd1c2a53c
Signed-off-by: Alberto Faria
---
block/io.c | 41
include/block/block-io.h | 15 +--
2 files changed, 9 insertions(+), 47 deletions(-)
diff --git a/block/io.c b/block/io.c
index 78a289192e..ecd1c2a53c 100644
--- a/block/io.c
It does not mutate the buffer.
Signed-off-by: Alberto Faria
---
include/block/block_int-io.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/block/block_int-io.h b/include/block/block_int-io.h
index bb454200e5..d4d3bed783 100644
--- a/include/block/block_int-io.h
On Fri, May 13, 2022 at 8:41 AM Paolo Bonzini wrote:
> This is different from bdrv_co_pwrite_zeroes in that it does not clear
> BDRV_REQ_MAY_UNMAP; but that's a bugfix really.
>
> It also doesn't call trace_bdrv_co_pwrite_zeroes, which is another bugfix.
I'll mention this in the commit message.
On Fri, May 13, 2022 at 9:22 AM Paolo Bonzini wrote:
> The callers only check the return code of vhdx_log_peek_hdr,
> vhdx_log_read_sectors, vhdx_log_write_sectors with ret < 0. But looking
> at the callers:
>
> - vhdx_log_read_desc propagates ret directly from a successful
> vhdx_log_read_sector
dd patch making qcow2_mark_dirty() use bdrv_pwrite_sync() instead of
calling bdrv_pwrite() and bdrv_flush() separately.
Alberto Faria (10):
block: Add a 'flags' param to bdrv_{pread,pwrite,pwrite_sync}()
block: Change bdrv_{pread,pwrite,pwrite_sync}() param order
block: Make
)
Resulting overly-long lines were then fixed by hand.
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
---
block/blklogwrites.c | 4 +--
block/bochs.c| 6 ++--
block/cloop.c| 10 +++---
block/crypto.c | 4 +--
block/dmg.c
For consistency with other I/O functions, and in preparation to
implement bdrv_{pread,pwrite}() using generated_co_wrapper.
unsigned int fits in int64_t, so all callers remain correct.
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
---
block/coroutines.h | 4 ++--
include
bdrv_pwrite_zeroes() now also calls trace_bdrv_co_pwrite_zeroes() and
clears the BDRV_REQ_MAY_UNMAP flag when appropriate, which it didn't
previously.
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
---
block/io.c | 41
in
t, buf, bytes, flags; @@
- bdrv_pwrite_sync(child, offset, buf, bytes, flags)
+ bdrv_pwrite_sync(child, offset, bytes, buf, flags)
Resulting overly-long lines were then fixed by hand.
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
---
block/blklogwrites.c | 6 ++--
block/bochs.c
Use bdrv_pwrite_sync() instead of calling bdrv_pwrite() and bdrv_flush()
separately.
Signed-off-by: Alberto Faria
---
block/qcow2.c | 9 +++--
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index f2fb54c51f..90a2dd406b 100644
--- a/block/qcow2.c
It does not mutate the buffer.
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
---
include/block/block_int-io.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/block/block_int-io.h b/include/block/block_int-io.h
index bb454200e5..d4d3bed783 100644
--- a
Also convert bdrv_pwrite_sync() to being implemented using
generated_co_wrapper.
Signed-off-by: Alberto Faria
---
block/io.c | 9 +
include/block/block-io.h | 8 ++--
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/block/io.c b/block/io.c
index
llers that rely on the previous behavior are adjusted
accordingly by hand.
Signed-off-by: Alberto Faria
Reviewed-by: Paolo Bonzini
---
block/cloop.c| 2 +-
block/crypto.c | 4 ++--
block/dmg.c | 10 +-
block/io.c
They currently return the value of their headerlen/buflen parameter on
success. Returning 0 instead makes it clear that short reads/writes are
not possible.
Signed-off-by: Alberto Faria
---
block/crypto.c | 52 +-
block/qcow2.c
Convert uses of bdrv_pwrite_sync() into bdrv_co_pwrite_sync() when the
callers are already coroutine_fn.
Signed-off-by: Alberto Faria
---
block/parallels.c | 2 +-
block/qcow2-snapshot.c | 6 +++---
block/qcow2.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff
gt; +
> +return nvme_get_free_req_nofail_locked(q);
> +}
> +
> /* With q->lock */
> static void nvme_put_free_req_locked(NVMeQueuePair *q, NVMeRequest *req)
> {
> @@ -506,7 +514,7 @@ static int nvme_admin_cmd_sync(BlockDriverState *bs,
> NvmeCmd *cmd)
> AioContext *aio_context = bdrv_get_aio_context(bs);
> NVMeRequest *req;
> int ret = -EINPROGRESS;
> -req = nvme_get_free_req(q);
> +req = nvme_get_free_req_nowait(q);
> if (!req) {
> return -EBUSY;
> }
> --
> 2.36.0
>
>
Reviewed-by: Alberto Faria
1 - 100 of 206 matches
Mail list logo