Re: [PATCH 5/7] block/nfs: Fix 32-bit Windows build

2022-09-23 Thread Bin Meng
Hi, On Wed, Sep 21, 2022 at 8:10 PM Meng, Bin wrote: > > -Original Message- > From: Philippe Mathieu-Daudé On Behalf Of > Philippe Mathieu-Daudé > Sent: Sunday, September 18, 2022 5:32 AM > To: Bin Meng ; qemu-de...@nongnu.org > Cc: Meng, Bin ; Hanna Reitz ; > Kevin Wolf ; Peter Lieven

Re: [PATCH v2 20/39] tests/qtest: {ahci, ide}-test: Use relative path for temporary files for win32

2022-09-23 Thread John Snow
On Thu, Sep 22, 2022 at 4:03 PM Marc-André Lureau wrote: > > Hi > > On Tue, Sep 20, 2022 at 1:50 PM Bin Meng wrote: >> >> From: Bin Meng >> >> These test cases uses "blkdebug:path/to/config:path/to/image" for >> testing. On Windows, absolute file paths contain the delimiter ':' >> which causes t

[PATCHv2] block: use the request length for iov alignment

2022-09-23 Thread Keith Busch
From: Keith Busch An iov length needs to be aligned to the logical block size, which may be larger than the memory alignment. And since this is only used with file-posix backing storage, move the alignment function to there, where the value of the request_alignment is known to be the file's logic

Re: [PATCH] block: use the request length for iov alignment

2022-09-23 Thread Kevin Wolf
Am 20.09.2022 um 21:27 hat Keith Busch geschrieben: > On Wed, Sep 14, 2022 at 11:36:14AM +0100, Kevin Wolf wrote: > > Am 13.09.2022 um 15:12 hat Keith Busch geschrieben: > > > On Thu, Sep 08, 2022 at 09:45:26AM -0700, Keith Busch wrote: > > > > From: Keith Busch > > > > > > > > An iov length need

Re: [PATCH] block: unmap (discard) blocks only if discard_zeros flag is true

2022-09-23 Thread luzhipeng
在 2022/9/23 22:28, Kevin Wolf 写道: Am 23.09.2022 um 12:02 hat luzhipeng geschrieben: From: lu zhipeng we can unmap(discard) blocks for block devices of supporting discard zeros or regular file. Signed-off-by: lu zhipeng This more or less restores the state before commit 34fa110e. The com

[PATCH] file-posix: Remove unused s->discard_zeroes

2022-09-23 Thread Kevin Wolf
The field is unused (only ever set, but never read) since commit ac9185603. Additionally, the commit message of commit 34fa110e already explained earlier why it's unreliable. Remove it. Signed-off-by: Kevin Wolf --- block/file-posix.c | 9 - 1 file changed, 9 deletions(-) diff --git a/b

Re: [PATCH] block: unmap (discard) blocks only if discard_zeros flag is true

2022-09-23 Thread Kevin Wolf
Am 23.09.2022 um 12:02 hat luzhipeng geschrieben: > From: lu zhipeng > > we can unmap(discard) blocks for block devices of supporting discard zeros > or regular file. > > Signed-off-by: lu zhipeng This more or less restores the state before commit 34fa110e. The commit message there explains th

[PATCH] block: unmap (discard) blocks only if discard_zeros flag is true

2022-09-23 Thread luzhipeng
From: lu zhipeng we can unmap(discard) blocks for block devices of supporting discard zeros or regular file. Signed-off-by: lu zhipeng --- block/file-posix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index 48cd096624..c35dbc0d

[PATCH 1/3] block: bdrv_child_get_parent_aio_context is not GS

2022-09-23 Thread Hanna Reitz
All implementations of bdrv_child_get_parent_aio_context() are IO_CODE (or do not mark anything in the case of block jobs), so this too can be IO_CODE. By the definition of "I/O API functions" in block-io.h, this is a strict relaxation, as I/O code can be run from both GS and I/O code arbitrarily.

[PATCH 3/3] block: Start/end drain on correct AioContext

2022-09-23 Thread Hanna Reitz
bdrv_parent_drained_{begin,end}_single() are supposed to operate on the parent, not on the child, so they should not attempt to get the context to poll from the child but the parent instead. BDRV_POLL_WHILE(c->bs) does get the context from the child, so we should replace it with AIO_WAIT_WHILE() o

[PATCH 0/3] blcok: Start/end drain on correct AioContext

2022-09-23 Thread Hanna Reitz
Hi, bdrv_replace_child_noperm() drains the child via bdrv_parent_drained_{begin,end}_single(). When it removes a child, the bdrv_parent_drained_end_single() at its end will be called on an empty child, making the BDRV_POLL_WHILE() in it poll the main AioContext (because c->bs is NULL). That’s

[PATCH 2/3] block-backend: Update ctx immediately after root

2022-09-23 Thread Hanna Reitz
blk_get_aio_context() asserts that blk->ctx is always equal to the root BDS's context (if there is a root BDS). Therefore, blk_do_set_aio_context() must update blk->ctx immediately after the root BDS's context has changed. Without this patch, the next patch would break iotest 238, because bdrv_dr

Re: [PATCH v11 18/21] job.c: enable job lock/unlock and remove Aiocontext locks

2022-09-23 Thread Paolo Bonzini
On Thu, Sep 22, 2022 at 4:42 PM Emanuele Giuseppe Esposito wrote: > > Am 18/09/2022 um 19:12 schrieb Emanuele Giuseppe Esposito: > >> In replication_stop, we call job_cancel_sync() inside > >> aio_context_acquire - aio_context_release section. Should it be fixed? > > > I don't think it breaks anyt

Re: [PATCH] ratelimit: restrict the delay time to a non-negative value

2022-09-23 Thread Markus Armbruster
Alberto Garcia writes: > On Wed 21 Sep 2022 09:47:32 AM +08, Wang Liang wrote: >>> > -return limit->slice_end_time - now; >>> > +return MAX(limit->slice_end_time - now, 0); >>> >>> How can this be negative? slice_end_time is guaranteed to be larger >>> than >>> now: >>> >>> if (limi