[Question] qemu-img convert block alignment

2021-04-01 Thread Zhenyu Ye
Hi all, commit 8dcd3c9b91 ("qemu-img: align result of is_allocated_sectors") introduces block alignment when doing qemu-img convert. However, the alignment is: s.alignment = MAX(pow2floor(s.min_sparse), DIV_ROUND_UP(out_bs->bl.request_alignment,

Re: [PATCH 0/6] Add debug interface to kick/call on purpose

2021-04-01 Thread Jason Wang
在 2021/3/30 下午3:29, Dongli Zhang 写道: On 3/28/21 8:56 PM, Jason Wang wrote: 在 2021/3/27 上午5:16, Dongli Zhang 写道: Hi Jason, On 3/26/21 12:24 AM, Jason Wang wrote: 在 2021/3/26 下午1:44, Dongli Zhang 写道: The virtio device/driver (e.g., vhost-scsi or vhost-net) may hang due to the loss of

Re: [BUG FIX][PATCH v3 0/3] vhost-user-blk: fix bug on device disconnection during initialization

2021-04-01 Thread Valentin Sinitsyn
On 01.04.2021 14:21, Denis Plotnikov wrote: This is a series fixing a bug in host-user-blk. More specifically, it's not just a bug but crasher. Valentine Is there any chance for it to be considered for the next rc? Thanks! Denis On 29.03.2021 16:44, Denis Plotnikov wrote: ping! On

General question about parsing an rbd filename

2021-04-01 Thread Connor Kuehl
Hi, block/rbd.c hints that: * Configuration values containing :, @, or = can be escaped with a * leading "\". Right now, much of the parsing code will allow anyone to escape _anything_ so long as it's preceded by '\'. Is this the intended behavior? Or should the parser be updated to

[PATCH v2 1/2] iotests/231: Update expected deprecation message

2021-04-01 Thread Connor Kuehl
The deprecation message in the expected output has technically been wrong since the wrong version of a patch was applied to it. Because of this, the test fails. Correct the expected output so that it passes. Signed-off-by: Connor Kuehl Reviewed-by: Max Reitz --- Reworded the commit log and

[PATCH v2 2/2] block/rbd: Add an escape-aware strchr helper

2021-04-01 Thread Connor Kuehl
Sometimes the parser needs to further split a token it has collected from the token input stream. Right now, it does a cursory check to see if the relevant characters appear in the token to determine if it should break it down further. However, qemu_rbd_next_tok() will escape characters as it

[PATCH v2 0/2] Fix segfault in qemu_rbd_parse_filename

2021-04-01 Thread Connor Kuehl
Replaced the change to qemu_rbd_next_tok with a standalone escape-aware helper for patch 2. Connor Kuehl (2): iotests/231: Update expected deprecation message block/rbd: Add an escape-aware strchr helper block/rbd.c| 20 ++-- tests/qemu-iotests/231 | 4

issuing [block-]job-complete to jobs in STANDBY state

2021-04-01 Thread John Snow
Hi; downstream we've run into an issue where VMs under heavy load with many simultaneously concurrent block jobs running might occasionally flicker into the STANDBY state, during which time they will be unable to receive JOB COMPLETE commands. I assume this flicker is due to

Re: [PATCH 2/2] block/rbd: Don't unescape in qemu_rbd_next_tok()

2021-04-01 Thread Connor Kuehl
On 4/1/21 12:24 PM, Max Reitz wrote: On 01.04.21 17:52, Connor Kuehl wrote: That's qemu_rbd_unescape()'s job! No need to duplicate the labor. Furthermore, this was causing some confusion in the parsing logic to where the caller might test for the presence of a character to split on like so:

[PULL 1/9] vhost-user-blk: use different event handlers on initialization

2021-04-01 Thread Michael S. Tsirkin
From: Denis Plotnikov It is useful to use different connect/disconnect event handlers on device initialization and operation as seen from the further commit fixing a bug on device initialization. This patch refactors the code to make use of them: we don't rely any more on the VM state for

[PULL 3/9] vhost-user-blk: add immediate cleanup on shutdown

2021-04-01 Thread Michael S. Tsirkin
From: Denis Plotnikov Qemu crashes on shutdown if the chardev used by vhost-user-blk has been finalized before the vhost-user-blk. This happens with char-socket chardev operating in the listening mode (server). The char-socket chardev emits "close" event at the end of finalizing when its

[PULL 2/9] vhost-user-blk: perform immediate cleanup if disconnect on initialization

2021-04-01 Thread Michael S. Tsirkin
From: Denis Plotnikov Commit 4bcad76f4c39 ("vhost-user-blk: delay vhost_user_blk_disconnect") introduced postponing vhost_dev cleanup aiming to eliminate qemu aborts because of connection problems with vhost-blk daemon. However, it introdues a new problem. Now, any communication errors during

Re: [PATCH 2/2] block/rbd: Don't unescape in qemu_rbd_next_tok()

2021-04-01 Thread Max Reitz
On 01.04.21 17:52, Connor Kuehl wrote: That's qemu_rbd_unescape()'s job! No need to duplicate the labor. Furthermore, this was causing some confusion in the parsing logic to where the caller might test for the presence of a character to split on like so: if (strchr(image_name, '/')) {

Re: [PATCH 1/2] iotests/231: Update expected deprecation message

2021-04-01 Thread Connor Kuehl
On 4/1/21 12:07 PM, Max Reitz wrote: On 01.04.21 18:52, Max Reitz wrote: On 01.04.21 17:52, Connor Kuehl wrote: The deprecation message changed slightly at some point in the past but the expected output wasn't updated along with it; causing it to fail. Fix it, so it passes. Signed-off-by:

Re: [PATCH 1/2] iotests/231: Update expected deprecation message

2021-04-01 Thread Max Reitz
On 01.04.21 18:52, Max Reitz wrote: On 01.04.21 17:52, Connor Kuehl wrote: The deprecation message changed slightly at some point in the past but the expected output wasn't updated along with it; causing it to fail. Fix it, so it passes. Signed-off-by: Connor Kuehl ---  

Re: [PATCH 1/2] iotests/231: Update expected deprecation message

2021-04-01 Thread Max Reitz
On 01.04.21 17:52, Connor Kuehl wrote: The deprecation message changed slightly at some point in the past but the expected output wasn't updated along with it; causing it to fail. Fix it, so it passes. Signed-off-by: Connor Kuehl --- tests/qemu-iotests/231.out | 4 +--- 1 file changed, 1

[PATCH v2] iotests: add test for removing persistent bitmap from backing file

2021-04-01 Thread Vladimir Sementsov-Ogievskiy
Just demonstrate one of x-blockdev-reopen usecases. We can't simply remove persistent bitmap from RO node (for example from backing file), as we need to remove it from the image too. So, we should reopen the node first. Signed-off-by: Vladimir Sementsov-Ogievskiy --- v2: [by Max's review] -

Re: [PATCH] iotests/qsd-jobs: Filter events in the first test

2021-04-01 Thread Vladimir Sementsov-Ogievskiy
01.04.2021 18:30, Max Reitz wrote: On 01.04.21 16:37, Vladimir Sementsov-Ogievskiy wrote: 01.04.2021 17:37, Vladimir Sementsov-Ogievskiy wrote: 01.04.2021 16:28, Max Reitz wrote: The job may or may not be ready before the 'quit' is issued.  Whether it is is irrelevant; for the purpose of the

Re: [PATCH v3 2/2] block: Add backend_defaults property

2021-04-01 Thread Stefan Hajnoczi
On Thu, Mar 11, 2021 at 12:39:16AM +0900, Akihiko Odaki wrote: > backend_defaults property allow users to control if default block > properties should be decided with backend information. > > If it is off, any backend information will be discarded, which is > suitable if you plan to perform live

[PATCH 1/2] iotests/231: Update expected deprecation message

2021-04-01 Thread Connor Kuehl
The deprecation message changed slightly at some point in the past but the expected output wasn't updated along with it; causing it to fail. Fix it, so it passes. Signed-off-by: Connor Kuehl --- tests/qemu-iotests/231.out | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git

[PATCH 0/2] Fix segfault in qemu_rbd_parse_filename

2021-04-01 Thread Connor Kuehl
Connor Kuehl (2): iotests/231: Update expected deprecation message block/rbd: Don't unescape in qemu_rbd_next_tok() block/rbd.c| 3 --- tests/qemu-iotests/231 | 4 tests/qemu-iotests/231.out | 7 --- 3 files changed, 8 insertions(+), 6 deletions(-) -- 2.30.2

[PATCH 2/2] block/rbd: Don't unescape in qemu_rbd_next_tok()

2021-04-01 Thread Connor Kuehl
That's qemu_rbd_unescape()'s job! No need to duplicate the labor. Furthermore, this was causing some confusion in the parsing logic to where the caller might test for the presence of a character to split on like so: if (strchr(image_name, '/')) { found_str = qemu_rbd_next_tok(image_name,

Re: [PATCH v3 1/2] block/file-posix: Optimize for macOS

2021-04-01 Thread Stefan Hajnoczi
On Thu, Mar 11, 2021 at 12:39:15AM +0900, Akihiko Odaki wrote: > @@ -1586,6 +1589,7 @@ out: > } > } > > +G_GNUC_UNUSED Why isn't translate_err() used in the F_PUNCHHOLE case below? If you really want to avoid using it on macOS, please add a #if with the necessary conditions here so it's

Re: [PATCH 2/2] iotests/qsd-jobs: Use common.qemu for the QSD

2021-04-01 Thread Max Reitz
On 01.04.21 16:44, Vladimir Sementsov-Ogievskiy wrote: 01.04.2021 16:28, Max Reitz wrote: Using common.qemu allows us to wait for specific replies, so we can for example wait for events.  This allows starting the active commit job and then wait for it to be ready before quitting the QSD, so we

Re: [PATCH] iotests/qsd-jobs: Filter events in the first test

2021-04-01 Thread Max Reitz
On 01.04.21 16:37, Vladimir Sementsov-Ogievskiy wrote: 01.04.2021 17:37, Vladimir Sementsov-Ogievskiy wrote: 01.04.2021 16:28, Max Reitz wrote: The job may or may not be ready before the 'quit' is issued.  Whether it is is irrelevant; for the purpose of the test, it only needs to still be

Re: [PATCH 2/2] iotests/qsd-jobs: Use common.qemu for the QSD

2021-04-01 Thread Vladimir Sementsov-Ogievskiy
01.04.2021 16:28, Max Reitz wrote: Using common.qemu allows us to wait for specific replies, so we can for example wait for events. This allows starting the active commit job and then wait for it to be ready before quitting the QSD, so we the output is always the same. (Strictly speaking, this

Re: [PATCH] iotests/qsd-jobs: Filter events in the first test

2021-04-01 Thread Vladimir Sementsov-Ogievskiy
01.04.2021 17:37, Vladimir Sementsov-Ogievskiy wrote: 01.04.2021 16:28, Max Reitz wrote: The job may or may not be ready before the 'quit' is issued.  Whether it is is irrelevant; for the purpose of the test, it only needs to still be there.  Filter the job status change and READY events from

Re: [PATCH] iotests/qsd-jobs: Filter events in the first test

2021-04-01 Thread Vladimir Sementsov-Ogievskiy
01.04.2021 16:28, Max Reitz wrote: The job may or may not be ready before the 'quit' is issued. Whether it is is irrelevant; for the purpose of the test, it only needs to still be there. Filter the job status change and READY events from the output so it becomes reliable. Reported-by: Peter

[RFC PATCH 2/3] qemu-iotests: add option to attach gdbserver

2021-04-01 Thread Emanuele Giuseppe Esposito
Add -gdb flag and GDB_QEMU environmental variable to python tests to attach a gdbserver to each qemu_system instance. The GDB_QEMU will just contain the options to provide to gdbserver, if empty and -gdb is set it will default to "localhost:12345". The gdb option is provided to

[RFC PATCH 3/3] qemu-iotests: add gdbserver option to script tests too

2021-04-01 Thread Emanuele Giuseppe Esposito
The only limitation here is that running a script with gdbserver will make the test output mismatch with the expected results, making the test fail. Signed-off-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/common.rc | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff

[RFC PATCH 0/3] qemu-iotests: attach gdbserver to qemu instance

2021-04-01 Thread Emanuele Giuseppe Esposito
This series adds the option to attach gdbserver to the qemu_system_* instance running in the qemu-iotests. Patch 1 adds the possibility to set a custom timer for the QMP socket, necessary otherwise the connection will just drop after 15 seconds, making the use of gdb very hard. Patch 2 adds the

[RFC PATCH 1/3] python: qemu: add timer parameter for qmp.accept socket

2021-04-01 Thread Emanuele Giuseppe Esposito
Extend the _post_launch function to include the timer as parameter instead of defaulting to 15 sec. Signed-off-by: Emanuele Giuseppe Esposito --- python/qemu/machine.py | 4 ++-- python/qemu/qtest.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH 2/2] iotests/qsd-jobs: Use common.qemu for the QSD

2021-04-01 Thread Max Reitz
Using common.qemu allows us to wait for specific replies, so we can for example wait for events. This allows starting the active commit job and then wait for it to be ready before quitting the QSD, so we the output is always the same. (Strictly speaking, this is only necessary for the first test

[PATCH] iotests/qsd-jobs: Filter events in the first test

2021-04-01 Thread Max Reitz
The job may or may not be ready before the 'quit' is issued. Whether it is is irrelevant; for the purpose of the test, it only needs to still be there. Filter the job status change and READY events from the output so it becomes reliable. Reported-by: Peter Maydell Suggested-by: Vladimir

[PATCH 1/2] iotests/common.qemu: Allow using the QSD

2021-04-01 Thread Max Reitz
For block things, we often do not need to run all of qemu, so allow using the qemu-storage-daemon instead. Signed-off-by: Max Reitz --- tests/qemu-iotests/common.qemu | 53 +++--- 1 file changed, 43 insertions(+), 10 deletions(-) diff --git

[PATCH 0/2] iotests/qsd-jobs: Use common.qemu for the QSD

2021-04-01 Thread Max Reitz
(Alternative to: “iotests/qsd-jobs: Filter events in the first test”) Hi, The qsd-jobs test has kind of unreliable output, because sometimes the job is ready before ‘quit’, and sometimes it is not. This series presents one approach to fix that, which is to extend common.qemu to allow running

Re: [PULL for-6.0 0/6] Block patches

2021-04-01 Thread Peter Maydell
On Wed, 31 Mar 2021 at 10:51, Stefan Hajnoczi wrote: > > The following changes since commit 6d40ce00c1166c317e298ad82ecf10e650c4f87d: > > Update version for v6.0.0-rc1 release (2021-03-30 18:19:07 +0100) > > are available in the Git repository at: > > https://gitlab.com/stefanha/qemu.git

Re: [PATCH] iotests: Test mirror-top filter permissions

2021-04-01 Thread Max Reitz
On 01.04.21 10:32, Vladimir Sementsov-Ogievskiy wrote: 31.03.2021 15:28, Max Reitz wrote: Add a test accompanying commit 53431b9086b2832ca1aeff0c55e186e9ed79bd11 ("block/mirror: Fix mirror_top's permissions"). Signed-off-by: Max Reitz ---   tests/qemu-iotests/tests/mirror-top-perms | 121

[BUG FIX][PATCH v3 0/3] vhost-user-blk: fix bug on device disconnection during initialization

2021-04-01 Thread Denis Plotnikov
This is a series fixing a bug in host-user-blk. Is there any chance for it to be considered for the next rc? Thanks! Denis On 29.03.2021 16:44, Denis Plotnikov wrote: ping! On 25.03.2021 18:12, Denis Plotnikov wrote: v3: * 0003: a new patch added fixing the problem on vm shutdown I

Re: [PATCH v3 2/4] block: check for sys/disk.h

2021-04-01 Thread Paolo Bonzini
On 01/04/21 10:03, Philippe Mathieu-Daudé wrote: On 4/1/21 7:08 AM, Joelle van Dyne wrote: On Mon, Mar 15, 2021 at 11:03 AM Joelle van Dyne wrote: Some BSD platforms do not have this header. Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Joelle van Dyne

Re: [PATCH] iotests: Test mirror-top filter permissions

2021-04-01 Thread Vladimir Sementsov-Ogievskiy
31.03.2021 15:28, Max Reitz wrote: Add a test accompanying commit 53431b9086b2832ca1aeff0c55e186e9ed79bd11 ("block/mirror: Fix mirror_top's permissions"). Signed-off-by: Max Reitz --- tests/qemu-iotests/tests/mirror-top-perms | 121 ++

Re: [PATCH v3 2/4] block: check for sys/disk.h

2021-04-01 Thread Philippe Mathieu-Daudé
On 4/1/21 7:08 AM, Joelle van Dyne wrote: > On Mon, Mar 15, 2021 at 11:03 AM Joelle van Dyne wrote: >> >> Some BSD platforms do not have this header. >> >> Reviewed-by: Peter Maydell >> Reviewed-by: Philippe Mathieu-Daudé >> Signed-off-by: Joelle van Dyne > > Please bear with me as I am still