Re: [PATCH v2] Document qemu-img options data_file and data_file_raw

2021-05-03 Thread Connor Kuehl
On 4/30/21 9:45 AM, Max Reitz wrote: >> + ``data_file_raw`` >> +If this option is set to ``on``, QEMU will always keep the external >> +data file consistent as a standalone read-only raw image. It does >> +this by forwarding updates through to the raw image in addition to >> +updat

Re: [PATCH 2/2] qemu-img: Require -F with -b backing image

2021-05-03 Thread Eric Blake
On 5/3/21 4:36 PM, Eric Blake wrote: > Back in commit d9f059aa6c (qemu-img: Deprecate use of -b without -F), > we deprecated the ability to create a file with a backing image that > requires qemu to perform format probing. Qemu can still probe older > files for backwards compatibility, but it is t

[PATCH 1/2] qcow2: Prohibit backing file changes in 'qemu-img amend'

2021-05-03 Thread Eric Blake
This was deprecated back in bc5ee6da7 (qcow2: Deprecate use of qemu-img amend to change backing file), and no one in the meantime has given any reasons why it should be supported. Time to make change attempts a hard error (but for convenience, specifying the _same_ backing chain is not forbidden).

[PATCH 2/2] qemu-img: Require -F with -b backing image

2021-05-03 Thread Eric Blake
Back in commit d9f059aa6c (qemu-img: Deprecate use of -b without -F), we deprecated the ability to create a file with a backing image that requires qemu to perform format probing. Qemu can still probe older files for backwards compatibility, but it is time to finish off the ability to create such

Re: [PATCH] hw/ide: Fix crash when plugging a piix3-ide device into the x-remote machine

2021-05-03 Thread Philippe Mathieu-Daudé
Hi Elena, +Mark You asked to use the next KVM-external call slot to talk about the ISA bus issues. I haven't scheduled the call because it seems this thread helped to figure the problems and Markus's analysis resumed them all. From here it should be clearer to see what has to be done to go where

Re: [PATCH v2 1/6] vhost-user-blk: Make sure to set Error on realize failure

2021-05-03 Thread Raphael Norwitz
Acked-by: Raphael Norwitz On Thu, Apr 29, 2021 at 07:13:11PM +0200, Kevin Wolf wrote: > We have to set errp before jumping to virtio_err, otherwise the caller > (virtio_device_realize()) will take this as success and crash when it > later tries to access things that we've already freed in the err

Re: [PATCH] Add missing coroutine_fn function signature to functions

2021-05-03 Thread Stefan Hajnoczi
On Fri, Apr 30, 2021 at 09:34:41PM +, cennedee wrote: > From 447601c28d5ed0b1208a0560390f760e75ce5613 Mon Sep 17 00:00:00 2001 > From: Cenne Dee > Date: Fri, 30 Apr 2021 15:52:28 -0400 > Subject: [PATCH] Add missing coroutine_fn function signature to functions > > Patch adds the signature for

Re: [PATCH v2 1/6] vhost-user-blk: Make sure to set Error on realize failure

2021-05-03 Thread Eric Blake
On 4/29/21 12:13 PM, Kevin Wolf wrote: > We have to set errp before jumping to virtio_err, otherwise the caller > (virtio_device_realize()) will take this as success and crash when it > later tries to access things that we've already freed in the error path. > > Fixes: 77542d431491788d1e8e79d93ce1

Re: [PATCH v2 2/6] vhost-user-blk: Don't reconnect during initialisation

2021-05-03 Thread Raphael Norwitz
So we're not going with the suggestion to retry once or a fixed number of times? Any reason why not? On Thu, Apr 29, 2021 at 07:13:12PM +0200, Kevin Wolf wrote: > This is a partial revert of commits 77542d43149 and bc79c87bcde. > > Usually, an error during initialisation means that the configurat

Re: [PATCH 5/6] block: simplify bdrv_child_user_desc()

2021-05-03 Thread Alberto Garcia
On Mon 03 May 2021 01:34:01 PM CEST, Vladimir Sementsov-Ogievskiy wrote: > All existing parent types (block nodes, block devices, jobs) has the > realization. So, drop unreachable code. > > Signed-off-by: Vladimir Sementsov-Ogievskiy With the updated description that you propose in your reply t

Re: [PATCH 3/6] block-backend: improve blk_root_get_parent_desc()

2021-05-03 Thread Alberto Garcia
On Mon 03 May 2021 01:33:59 PM CEST, Vladimir Sementsov-Ogievskiy wrote: > We have different types of parents: block nodes, block backends and > jobs. So, it makes sense to specify type together with name. > > While being here also use g_autofree. > > iotest 307 output is updated. > > Signed-off-

Re: [PATCH 1/6] block: fix leak of tran in bdrv_root_attach_child

2021-05-03 Thread Alberto Garcia
On Mon 03 May 2021 01:33:57 PM CEST, Vladimir Sementsov-Ogievskiy wrote: > @@ -2918,12 +2918,18 @@ BdrvChild *bdrv_root_attach_child(BlockDriverState > *child_bs, > child_role, perm, shared_perm, opaque, > &child, tran, errp

Re: [PATCH 2/6] block: bdrv_reopen_multiple(): fix leak of tran object

2021-05-03 Thread Alberto Garcia
On Mon 03 May 2021 01:33:58 PM CEST, Vladimir Sementsov-Ogievskiy wrote: > We have one path, where tran object is created, but we don't touch and > don't free it in any way: "goto cleanup" in first loop with calls to > bdrv_flush(). > > Fix it simply moving tran_new() call below that loop. > > Re

Re: [PATCH v3 14/15] qemu_iotests: add option to show qemu binary logs on stdout

2021-05-03 Thread Max Reitz
On 30.04.21 23:04, Emanuele Giuseppe Esposito wrote: On 30/04/2021 15:50, Max Reitz wrote: On 14.04.21 19:03, Emanuele Giuseppe Esposito wrote: Using the flag -p, allow the qemu binary to print to stdout. This helps especially when doing print-debugging. I think this shouldn’t refer to prin

Re: [PATCH v3 05/15] qemu-iotests: delay QMP socket timers

2021-05-03 Thread Max Reitz
On 30.04.21 23:03, Emanuele Giuseppe Esposito wrote: On 30/04/2021 13:59, Max Reitz wrote: On 14.04.21 19:03, Emanuele Giuseppe Esposito wrote: Attaching a gdbserver implies that the qmp socket should wait indefinitely for an answer from QEMU. Signed-off-by: Emanuele Giuseppe Esposito ---  

Re: [PATCH v3 04/15] qemu-iotests: add option to attach gdbserver

2021-05-03 Thread Max Reitz
On 30.04.21 23:03, Emanuele Giuseppe Esposito wrote: On 30/04/2021 13:38, Max Reitz wrote: On 14.04.21 19:03, Emanuele Giuseppe Esposito wrote: Add -gdb flag and GDB_QEMU environmental variable to python tests to attach a gdbserver to each qemu instance. Well, this patch doesn’t do this, bu

Re: [PATCH 2/2] block: Fix Transaction leak in bdrv_reopen_multiple()

2021-05-03 Thread Kevin Wolf
Am 03.05.2021 um 15:09 hat Vladimir Sementsov-Ogievskiy geschrieben: > 03.05.2021 15:41, Kevin Wolf wrote: > > Am 03.05.2021 um 13:40 hat Vladimir Sementsov-Ogievskiy geschrieben: > > > 03.05.2021 14:05, Kevin Wolf wrote: > > > > Like other error paths, this one needs to call tran_finalize() and cl

Re: [PATCH 2/4] block/vvfat: Fix leak of BDRVVVFATState::used_clusters

2021-05-03 Thread Stefano Garzarella
On Fri, Apr 30, 2021 at 06:25:17PM +0200, Philippe Mathieu-Daudé wrote: used_clusters is allocated in enable_write_target(), called by vvfat_open(), but never free'd. Allocate it using GLib API, and free it in vvfat_close(). This fixes (QEMU built with --enable-sanitizers): Direct leak of 6450

Re: [PATCH 1/4] block/vvfat: Fix leak of BDRVVVFATState::qcow_filename

2021-05-03 Thread Stefano Garzarella
On Fri, Apr 30, 2021 at 06:25:16PM +0200, Philippe Mathieu-Daudé wrote: qcow_filename is allocated in enable_write_target(), called by vvfat_open(), but never free'd. Free it in vvfat_close(). This fixes (QEMU built with --enable-sanitizers): Direct leak of 4096 byte(s) in 1 object(s) allocate

Re: [PATCH 2/2] block: Fix Transaction leak in bdrv_reopen_multiple()

2021-05-03 Thread Vladimir Sementsov-Ogievskiy
03.05.2021 15:41, Kevin Wolf wrote: Am 03.05.2021 um 13:40 hat Vladimir Sementsov-Ogievskiy geschrieben: 03.05.2021 14:05, Kevin Wolf wrote: Like other error paths, this one needs to call tran_finalize() and clean up the BlockReopenQueue, too. We don't need the "abort" loop on that path. And

Re: [PATCH 2/2] block: Fix Transaction leak in bdrv_reopen_multiple()

2021-05-03 Thread Kevin Wolf
Am 03.05.2021 um 13:40 hat Vladimir Sementsov-Ogievskiy geschrieben: > 03.05.2021 14:05, Kevin Wolf wrote: > > Like other error paths, this one needs to call tran_finalize() and clean > > up the BlockReopenQueue, too. > > We don't need the "abort" loop on that path. And clean-up of > BlockReopenQu

Re: [PATCH 1/2] block: Fix Transaction leak in bdrv_root_attach_child()

2021-05-03 Thread Vladimir Sementsov-Ogievskiy
03.05.2021 15:14, Vladimir Sementsov-Ogievskiy wrote: 03.05.2021 14:53, Max Reitz wrote: On 03.05.21 13:51, Vladimir Sementsov-Ogievskiy wrote: 03.05.2021 14:49, Max Reitz wrote: On 03.05.21 13:05, Kevin Wolf wrote: The error path needs to call tran_finalize(), too. Fixes: CID 1452773 Fixes:

[PATCH 7/6] block: document child argument of bdrv_attach_child_common()

2021-05-03 Thread Vladimir Sementsov-Ogievskiy
The logic around **child is not obvious: this reference is used not only to return resulting child, but also to rollback NULL value on transaction abort. Let's document this. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/b

Re: [PATCH 1/2] block: Fix Transaction leak in bdrv_root_attach_child()

2021-05-03 Thread Vladimir Sementsov-Ogievskiy
03.05.2021 14:53, Max Reitz wrote: On 03.05.21 13:51, Vladimir Sementsov-Ogievskiy wrote: 03.05.2021 14:49, Max Reitz wrote: On 03.05.21 13:05, Kevin Wolf wrote: The error path needs to call tran_finalize(), too. Fixes: CID 1452773 Fixes: 548a74c0dbc858edd1a7ee3045b5f2fe710bd8b1 Signed-off-by

Re: [PATCH 1/2] block: Fix Transaction leak in bdrv_root_attach_child()

2021-05-03 Thread Vladimir Sementsov-Ogievskiy
03.05.2021 14:49, Max Reitz wrote: On 03.05.21 13:05, Kevin Wolf wrote: The error path needs to call tran_finalize(), too. Fixes: CID 1452773 Fixes: 548a74c0dbc858edd1a7ee3045b5f2fe710bd8b1 Signed-off-by: Kevin Wolf ---   block.c | 7 ---   1 file changed, 4 insertions(+), 3 deletions(-) d

Re: [PATCH 1/2] block: Fix Transaction leak in bdrv_root_attach_child()

2021-05-03 Thread Max Reitz
On 03.05.21 13:51, Vladimir Sementsov-Ogievskiy wrote: 03.05.2021 14:49, Max Reitz wrote: On 03.05.21 13:05, Kevin Wolf wrote: The error path needs to call tran_finalize(), too. Fixes: CID 1452773 Fixes: 548a74c0dbc858edd1a7ee3045b5f2fe710bd8b1 Signed-off-by: Kevin Wolf ---   block.c | 7

Re: [PATCH 4/6] block: improve bdrv_child_get_parent_desc()

2021-05-03 Thread Vladimir Sementsov-Ogievskiy
03.05.2021 14:34, Vladimir Sementsov-Ogievskiy wrote: We have different types of parents: block nodes, block backends and jobs. So, it makes sense to specify type together with name. I forget to note the main thing of the commit: This handler us used to compose an error message about permissio

Re: [PATCH 1/2] block: Fix Transaction leak in bdrv_root_attach_child()

2021-05-03 Thread Max Reitz
On 03.05.21 13:05, Kevin Wolf wrote: The error path needs to call tran_finalize(), too. Fixes: CID 1452773 Fixes: 548a74c0dbc858edd1a7ee3045b5f2fe710bd8b1 Signed-off-by: Kevin Wolf --- block.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/block.c b/block.c index

Re: [PATCH 2/2] block: Fix Transaction leak in bdrv_reopen_multiple()

2021-05-03 Thread Vladimir Sementsov-Ogievskiy
03.05.2021 14:05, Kevin Wolf wrote: Like other error paths, this one needs to call tran_finalize() and clean up the BlockReopenQueue, too. We don't need the "abort" loop on that path. And clean-up of BlockReopenQueue is at "cleanup:" label. So I'd prefer Peter's suggestion (my "[PATCH 2/6] bl

Re: [PATCH 1/2] block: Fix Transaction leak in bdrv_root_attach_child()

2021-05-03 Thread Vladimir Sementsov-Ogievskiy
03.05.2021 14:05, Kevin Wolf wrote: The error path needs to call tran_finalize(), too. Fixes: CID 1452773 Fixes: 548a74c0dbc858edd1a7ee3045b5f2fe710bd8b1 Signed-off-by: Kevin Wolf --- block.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/block.c b/block.c index 8

[PATCH 5/6] block: simplify bdrv_child_user_desc()

2021-05-03 Thread Vladimir Sementsov-Ogievskiy
All existing parent types (block nodes, block devices, jobs) has the realization. So, drop unreachable code. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/block.c b/block.c index 1de2365843..20efd7a7b0 100644 ---

[PATCH 3/6] block-backend: improve blk_root_get_parent_desc()

2021-05-03 Thread Vladimir Sementsov-Ogievskiy
We have different types of parents: block nodes, block backends and jobs. So, it makes sense to specify type together with name. While being here also use g_autofree. iotest 307 output is updated. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/block-backend.c | 9 - tests/q

[PATCH 0/6] block permission updated follow-up

2021-05-03 Thread Vladimir Sementsov-Ogievskiy
Hi all! Here are two coverity fixes and improvement of error message. Vladimir Sementsov-Ogievskiy (6): block: fix leak of tran in bdrv_root_attach_child block: bdrv_reopen_multiple(): fix leak of tran object block-backend: improve blk_root_get_parent_desc() block: improve bdrv_child_get_

[PATCH 6/6] block: improve permission conflict error message

2021-05-03 Thread Vladimir Sementsov-Ogievskiy
Now permissions are updated as follows: 1. do graph modifications ignoring permissions 2. do permission update (of course, we rollback [1] if [2] fails) So, on stage [2] we can't say which users are "old" and which are "new" and exist only since [1]. And current error message is a bit outdated

[PATCH 4/6] block: improve bdrv_child_get_parent_desc()

2021-05-03 Thread Vladimir Sementsov-Ogievskiy
We have different types of parents: block nodes, block backends and jobs. So, it makes sense to specify type together with name. iotest 283 output is updated. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block.c| 2 +- tests/qemu-iotests/283.out | 2 +- 2 files changed, 2

[PATCH 2/6] block: bdrv_reopen_multiple(): fix leak of tran object

2021-05-03 Thread Vladimir Sementsov-Ogievskiy
We have one path, where tran object is created, but we don't touch and don't free it in any way: "goto cleanup" in first loop with calls to bdrv_flush(). Fix it simply moving tran_new() call below that loop. Reported-by: Coverity (CID 1452772) Reported-by: Peter Maydell Suggested-by: Peter Mayde

[PATCH 1/6] block: fix leak of tran in bdrv_root_attach_child

2021-05-03 Thread Vladimir Sementsov-Ogievskiy
bdrv_attach_child_common() doesn't require tran_finalize() on failure (it does tran_add() only on success path). Still tran_new() must be paired with tran_finalize() anyway, at least to free empty Transaction object itself. So, refactor the function for clean finalization code, same on all paths.

[PATCH 0/2] block: Fix Transaction leaks

2021-05-03 Thread Kevin Wolf
These are two follow-up fixes for Vladimir's "block: update graph permissions update". The bugs were reported by Coverity. Kevin Wolf (2): block: Fix Transaction leak in bdrv_root_attach_child() block: Fix Transaction leak in bdrv_reopen_multiple() block.c | 9 + 1 file changed, 5 in

[PATCH 2/2] block: Fix Transaction leak in bdrv_reopen_multiple()

2021-05-03 Thread Kevin Wolf
Like other error paths, this one needs to call tran_finalize() and clean up the BlockReopenQueue, too. Fixes: CID 1452772 Fixes: 72373e40fbc7e4218061a8211384db362d3e7348 Signed-off-by: Kevin Wolf --- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block.c b/block.c in

[PATCH 1/2] block: Fix Transaction leak in bdrv_root_attach_child()

2021-05-03 Thread Kevin Wolf
The error path needs to call tran_finalize(), too. Fixes: CID 1452773 Fixes: 548a74c0dbc858edd1a7ee3045b5f2fe710bd8b1 Signed-off-by: Kevin Wolf --- block.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/block.c b/block.c index 874c22c43e..5c0ced6238 100644 --- a/block

Re: [PULL 37/64] block/snapshot: Fix fallback

2021-05-03 Thread Kevin Wolf
Am 03.05.2021 um 11:45 hat Max Reitz geschrieben: > On 03.05.21 11:40, Kevin Wolf wrote: > > Am 01.05.2021 um 00:30 hat Peter Maydell geschrieben: > > > On Mon, 7 Sept 2020 at 12:11, Kevin Wolf wrote: > > > > > > > > From: Max Reitz > > > > > > > > If the top node's driver does not provide snap

Re: [PATCH v2 2/3] hw/pci-host/raven: Manually reset the OR_IRQ device

2021-05-03 Thread Philippe Mathieu-Daudé
On 5/2/21 10:45 PM, Peter Maydell wrote: > On Sun, 2 May 2021 at 21:31, Philippe Mathieu-Daudé wrote: >> >> The OR_IRQ device is bus-less, thus isn't reset automatically. >> Add the raven_pcihost_reset() handler to manually reset the OR IRQ. >> >> Fixes: f40b83a4e31 ("40p: use OR gate to wire up r

[PATCH] block/snapshot: Clarify goto fallback behavior

2021-05-03 Thread Max Reitz
In the bdrv_snapshot_goto() fallback code, we work with a pointer to either bs->file or bs->backing. We close that child, close the node (with .bdrv_close()), apply the snapshot on the child node, and then re-open the node (with .bdrv_open()). In order for .bdrv_open() to attach the same child no

Re: [PULL 37/64] block/snapshot: Fix fallback

2021-05-03 Thread Max Reitz
On 03.05.21 11:40, Kevin Wolf wrote: Am 01.05.2021 um 00:30 hat Peter Maydell geschrieben: On Mon, 7 Sept 2020 at 12:11, Kevin Wolf wrote: From: Max Reitz If the top node's driver does not provide snapshot functionality and we want to fall back to a node down the chain, we need to snapshot

Re: [PULL 37/64] block/snapshot: Fix fallback

2021-05-03 Thread Kevin Wolf
Am 01.05.2021 um 00:30 hat Peter Maydell geschrieben: > On Mon, 7 Sept 2020 at 12:11, Kevin Wolf wrote: > > > > From: Max Reitz > > > > If the top node's driver does not provide snapshot functionality and we > > want to fall back to a node down the chain, we need to snapshot all > > non-COW child

Re: [PATCH] block: Drop the sheepdog block driver

2021-05-03 Thread Peter Krempa
On Sat, May 01, 2021 at 09:57:47 +0200, Markus Armbruster wrote: > It was deprecated in commit e1c4269763, v5.2.0. See that commit > message for rationale. > > Signed-off-by: Markus Armbruster > --- > docs/system/deprecated.rst |9 - > docs/system/device-url-syntax.rst.inc |

Re: [PATCH] block: simplify write-threshold and drop write notifiers

2021-05-03 Thread Vladimir Sementsov-Ogievskiy
30.04.2021 13:04, Max Reitz wrote: On 22.04.21 00:09, Vladimir Sementsov-Ogievskiy wrote: write-notifiers are used only for write-threshold. New code for such purpose should create filters. Let's handle write-threshold simply in generic code and drop write notifiers at all. Also move part of w