Re: [Qemu-block] [Qemu-devel] [PATCH v2 09/11] monitor: Split out monitor/qmp.c

2019-06-12 Thread Markus Armbruster
Kevin Wolf writes: > Am 12.06.2019 um 15:11 hat Markus Armbruster geschrieben: >> Kevin Wolf writes: >> >> > Move QMP infrastructure from monitor/misc.c to monitor/qmp.c. This is >> > code that can be shared for all targets, so compile it only once. >> >> Less code compiled per target, yay!

Re: [Qemu-block] [Qemu-devel] [PATCH v2 10/11] monitor: Split out monitor/hmp.c

2019-06-12 Thread Markus Armbruster
Kevin Wolf writes: > Am 12.06.2019 um 15:17 hat Markus Armbruster geschrieben: >> Kevin Wolf writes: >> >> > Move HMP infrastructure from monitor/misc.c to monitor/hmp.c. This is >> > code that can be shared for all targets, so compile it only once. >> > >> > The amount of function and

[Qemu-block] [PATCH] iotests: Fix 129

2019-06-12 Thread Max Reitz
Throttling on the BB have not affected block jobs in a while, so 129 is prone to break (at least on tmpfs with high system load). We can fix the problem by running the job from a throttle node. Signed-off-by: Max Reitz --- Depends on "[PATCH v5 00/42] block: Deal with filters". Based-on:

[Qemu-block] [PATCH v5 39/42] iotests: Add filter commit test cases

2019-06-12 Thread Max Reitz
This patch adds some tests on how commit copes with filter nodes. Signed-off-by: Max Reitz --- tests/qemu-iotests/040 | 177 + tests/qemu-iotests/040.out | 4 +- 2 files changed, 179 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/040

[Qemu-block] [PATCH v5 36/42] iotests: Add tests for mirror @replaces loops

2019-06-12 Thread Max Reitz
This adds two tests for cases where our old check_to_replace_node() function failed to detect that executing this job with these parameters would result in a cyclic graph. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- tests/qemu-iotests/041 | 124

[Qemu-block] [PATCH v5 34/42] block: Inline bdrv_co_block_status_from_*()

2019-06-12 Thread Max Reitz
With bdrv_filtered_rw_bs(), we can easily handle this default filter behavior in bdrv_co_block_status(). blkdebug wants to have an additional assertion, so it keeps its own implementation, except bdrv_co_block_status_from_file() needs to be inlined there. Suggested-by: Eric Blake Signed-off-by:

Re: [Qemu-block] [PATCH 0/2] vl: Drain before (block) job cancel when quitting

2019-06-12 Thread Max Reitz
On 13.06.19 00:08, Max Reitz wrote: > Quitting qemu should lead to qemu exiting pretty much immediately. That > means if you have a block job running on a throttled block node, the > node should ignore its throttling and the job should be cancelled > immediately. > > Unfortunately, that is not

[Qemu-block] [PATCH v5 40/42] iotests: Add filter mirror test cases

2019-06-12 Thread Max Reitz
This patch adds some test cases how mirroring relates to filters. One of them tests what happens when you mirror off a filtered COW node, two others use the mirror filter node as basically our only example of an implicitly created filter node so far (besides the commit filter). Signed-off-by:

[Qemu-block] [PATCH v5 28/42] stream: Deal with filters

2019-06-12 Thread Max Reitz
Signed-off-by: Max Reitz --- qapi/block-core.json | 4 block/stream.c | 23 +++ blockdev.c | 2 +- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index df52a90736..a3c5298cf5 100644 ---

Re: [Qemu-block] [PATCH v5 22/42] block: Use CAFs in bdrv_get_allocated_file_size()

2019-06-12 Thread Max Reitz
On 13.06.19 00:09, Max Reitz wrote: > Signed-off-by: Max Reitz > --- > block.c | 26 -- > 1 file changed, 24 insertions(+), 2 deletions(-) > > diff --git a/block.c b/block.c > index 11b7ba8cf6..856d9b58be 100644 > --- a/block.c > +++ b/block.c > @@ -4511,15 +4511,37 @@

[Qemu-block] [PATCH v5 42/42] iotests: Test committing to overridden backing

2019-06-12 Thread Max Reitz
Signed-off-by: Max Reitz --- tests/qemu-iotests/040 | 61 ++ tests/qemu-iotests/040.out | 4 +-- 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040 index 31c2a8da3b..5cbbd30ee3 100755 ---

[Qemu-block] [PATCH v5 41/42] iotests: Add test for commit in sub directory

2019-06-12 Thread Max Reitz
Add a test for committing an overlay in a sub directory to one of the images in its backing chain, using both relative and absolute filenames. Signed-off-by: Max Reitz --- tests/qemu-iotests/020 | 36 tests/qemu-iotests/020.out | 10 ++ 2 files

[Qemu-block] [PATCH v5 37/42] block: Leave BDS.backing_file constant

2019-06-12 Thread Max Reitz
Parts of the block layer treat BDS.backing_file as if it were whatever the image header says (i.e., if it is a relative path, it is relative to the overlay), other parts treat it like a cache for bs->backing->bs->filename (relative paths are relative to the CWD). Considering

[Qemu-block] [PATCH v5 32/42] block: Make bdrv_get_cumulative_perm() public

2019-06-12 Thread Max Reitz
This is useful in other files like blockdev.c to determine for example whether a node can be written to or not. Signed-off-by: Max Reitz --- include/block/block_int.h | 3 +++ block.c | 6 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git

[Qemu-block] [PATCH v5 35/42] block: Fix check_to_replace_node()

2019-06-12 Thread Max Reitz
Currently, check_to_replace_node() only allows mirror to replace a node in the chain of the source node, and only if it is the first non-filter node below the source. Well, technically, the idea is that you can exactly replace a quorum child by mirroring from quorum. This has (probably) two

[Qemu-block] [PATCH v5 38/42] iotests: Let complete_and_wait() work with commit

2019-06-12 Thread Max Reitz
complete_and_wait() and wait_ready() currently only work for mirror jobs. Let them work for active commit jobs, too. Signed-off-by: Max Reitz --- tests/qemu-iotests/iotests.py | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/iotests.py

[Qemu-block] [PATCH v5 33/42] blockdev: Fix active commit choice

2019-06-12 Thread Max Reitz
We have to perform an active commit whenever the top node has a parent that has taken the WRITE permission on it. Signed-off-by: Max Reitz --- blockdev.c | 24 +--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/blockdev.c b/blockdev.c index

[Qemu-block] [PATCH v5 25/42] mirror: Deal with filters

2019-06-12 Thread Max Reitz
This includes some permission limiting (for example, we only need to take the RESIZE permission for active commits where the base is smaller than the top). Signed-off-by: Max Reitz --- block/mirror.c | 110 + blockdev.c | 47

[Qemu-block] [PATCH v5 24/42] block: Use child access functions for QAPI queries

2019-06-12 Thread Max Reitz
query-block and query-named-block-nodes now return any filtered child under "backing", not just bs->backing or COW children. This is so that filters do not interrupt the reported backing chain. This changes the output for iotest 184, as the throttled node now appears as a backing child.

[Qemu-block] [PATCH v5 26/42] backup: Deal with filters

2019-06-12 Thread Max Reitz
Signed-off-by: Max Reitz --- block/backup.c | 9 + blockdev.c | 19 +++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/block/backup.c b/block/backup.c index 715e1d3be8..88435f883d 100644 --- a/block/backup.c +++ b/block/backup.c @@ -502,6 +502,7 @@

[Qemu-block] [PATCH v5 29/42] nbd: Use CAF when looking for dirty bitmap

2019-06-12 Thread Max Reitz
When looking for a dirty bitmap to share, we should handle filters by just including them in the search (so they do not break backing chains). Signed-off-by: Max Reitz --- nbd/server.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index

[Qemu-block] [PATCH v5 30/42] qemu-img: Use child access functions

2019-06-12 Thread Max Reitz
This changes iotest 204's output, because blkdebug on top of a COW node used to make qemu-img map disregard the rest of the backing chain (the backing chain was broken by the filter). With this patch, the allocation in the base image is reported correctly. Signed-off-by: Max Reitz ---

[Qemu-block] [PATCH v5 21/42] block: Use CAFs for debug breakpoints

2019-06-12 Thread Max Reitz
When looking for a blkdebug node (which implements debug breakpoints), use bdrv_primary_bs() to iterate through the graph, because that is where a blkdebug node would be. Signed-off-by: Max Reitz --- block.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block.c

[Qemu-block] [PATCH v5 27/42] commit: Deal with filters

2019-06-12 Thread Max Reitz
This includes some permission limiting (for example, we only need to take the RESIZE permission if the base is smaller than the top). Signed-off-by: Max Reitz --- block/block-backend.c | 16 --- block/commit.c| 97 --- blockdev.c|

[Qemu-block] [PATCH v5 31/42] block: Drop backing_bs()

2019-06-12 Thread Max Reitz
We want to make it explicit where bs->backing is used, and we have done so. The old role of backing_bs() is now effectively taken by bdrv_filtered_cow_bs(). Signed-off-by: Max Reitz --- include/block/block_int.h | 5 - 1 file changed, 5 deletions(-) diff --git a/include/block/block_int.h

[Qemu-block] [PATCH v5 16/42] block: Use child access functions when flushing

2019-06-12 Thread Max Reitz
If the driver does not support .bdrv_co_flush() so bdrv_co_flush() itself has to flush the children of the given node, it should not flush just bs->file->bs, but in fact both the child that stores data, and the one that stores metadata (if they are separate). In any case, the BLKDBG_EVENT()

[Qemu-block] [PATCH v5 19/42] block: Use CAF in bdrv_co_rw_vmstate()

2019-06-12 Thread Max Reitz
If a node whose driver does not provide VM state functions has a metadata child, the VM state should probably go there; if it is a filter, the VM state should probably go there. It follows that we should generally go down to the primary child. Signed-off-by: Max Reitz --- block/io.c | 5 +++--

[Qemu-block] [PATCH v5 14/42] block: Use CAFs when working with backing chains

2019-06-12 Thread Max Reitz
Use child access functions when iterating through backing chains so filters do not break the chain. Signed-off-by: Max Reitz --- block.c | 40 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/block.c b/block.c index 11f37983d9..505b3e9a01

[Qemu-block] [PATCH v5 23/42] blockdev: Use CAF in external_snapshot_prepare()

2019-06-12 Thread Max Reitz
This allows us to differentiate between filters and nodes with COW backing files: Filters cannot be used as overlays at all (for this function). Signed-off-by: Max Reitz --- blockdev.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index

[Qemu-block] [PATCH v5 20/42] block/snapshot: Fall back to storage child

2019-06-12 Thread Max Reitz
If the top node's driver does not provide snapshot functionality and we want to go down the chain, we should go towards the child which stores the data, i.e. the storage child. bdrv_snapshot_goto() becomes a bit weird because we may have to redirect the actual child pointer, so it only works if

[Qemu-block] [PATCH v5 22/42] block: Use CAFs in bdrv_get_allocated_file_size()

2019-06-12 Thread Max Reitz
Signed-off-by: Max Reitz --- block.c | 26 -- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/block.c b/block.c index 11b7ba8cf6..856d9b58be 100644 --- a/block.c +++ b/block.c @@ -4511,15 +4511,37 @@ exit: int64_t

[Qemu-block] [PATCH v5 17/42] block: Use CAFs in bdrv_refresh_limits()

2019-06-12 Thread Max Reitz
Signed-off-by: Max Reitz --- block/io.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/block/io.c b/block/io.c index 64408cf19a..659ea0c52a 100644 --- a/block/io.c +++ b/block/io.c @@ -151,6 +151,8 @@ static void bdrv_merge_limits(BlockLimits *dst, const

[Qemu-block] [PATCH v5 10/42] block: Use CAF in bdrv_is_encrypted()

2019-06-12 Thread Max Reitz
bdrv_is_encrypted() should not only check the BDS's backing child, but any filtered child: If a filter's child is encrypted, the filter node itself naturally is encrypted, too. Furthermore, we need to recurse down the chain. (CAF means child access function.) Signed-off-by: Max Reitz ---

[Qemu-block] [PATCH v5 18/42] block: Use CAFs in bdrv_refresh_filename()

2019-06-12 Thread Max Reitz
bdrv_refresh_filename() and the kind of related bdrv_dirname() should look to the primary child when they wish to copy the underlying file's filename. Signed-off-by: Max Reitz --- block.c | 29 + 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/block.c

[Qemu-block] [PATCH v5 15/42] block: Re-evaluate backing file handling in reopen

2019-06-12 Thread Max Reitz
Reopening a node's backing child needs a bit of special handling because the "backing" child has different defaults than all other children (among other things). Adding filter support here is a bit more difficult than just using the child access functions. In fact, we often have to directly use

[Qemu-block] [PATCH v5 07/42] block: *filtered_cow_child() for *has_zero_init()

2019-06-12 Thread Max Reitz
bdrv_has_zero_init() and the related bdrv_unallocated_blocks_are_zero() should use bdrv_filtered_cow_child() if they want to check whether the given BDS has a COW backing file. Signed-off-by: Max Reitz --- block.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block.c

[Qemu-block] [PATCH v5 11/42] block: Add bdrv_supports_compressed_writes()

2019-06-12 Thread Max Reitz
Filters cannot compress data themselves but they have to implement .bdrv_co_pwritev_compressed() still (or they cannot forward compressed writes). Therefore, checking whether bs->drv->bdrv_co_pwritev_compressed is non-NULL is not sufficient to know whether the node can actually handle compressed

[Qemu-block] [PATCH v5 06/42] qcow2: Implement .bdrv_storage_child()

2019-06-12 Thread Max Reitz
Signed-off-by: Max Reitz --- block/qcow2.c | 9 + 1 file changed, 9 insertions(+) diff --git a/block/qcow2.c b/block/qcow2.c index 9396d490d5..57675c9416 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -5085,6 +5085,13 @@ void qcow2_signal_corruption(BlockDriverState *bs, bool fatal,

[Qemu-block] [PATCH v5 13/42] block: Use CAFs in block status functions

2019-06-12 Thread Max Reitz
Use the child access functions in the block status inquiry functions as appropriate. Signed-off-by: Max Reitz --- block/io.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/block/io.c b/block/io.c index 73ade04834..53aabf86b5 100644 --- a/block/io.c +++

[Qemu-block] [PATCH v5 02/42] copy-on-read: Support compressed writes

2019-06-12 Thread Max Reitz
Signed-off-by: Max Reitz --- block/copy-on-read.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/block/copy-on-read.c b/block/copy-on-read.c index 53972b1da3..88e1c1f538 100644 --- a/block/copy-on-read.c +++ b/block/copy-on-read.c @@ -114,6 +114,16 @@ static int coroutine_fn

[Qemu-block] [PATCH v5 09/42] block: Include filters when freezing backing chain

2019-06-12 Thread Max Reitz
In order to make filters work in backing chains, the associated functions must be able to deal with them and freeze all filter links, be they COW or R/W filter links. While at it, add some comments that note which functions require their caller to ensure that a given child link is not frozen, and

[Qemu-block] [PATCH v5 12/42] block: Use bdrv_filtered_rw* where obvious

2019-06-12 Thread Max Reitz
Places that use patterns like if (bs->drv->is_filter && bs->file) { ... something about bs->file->bs ... } should be BlockDriverState *filtered = bdrv_filtered_rw_bs(bs); if (filtered) { ... something about @filtered ... } instead. Signed-off-by: Max Reitz

[Qemu-block] [PATCH v5 08/42] block: bdrv_set_backing_hd() is about bs->backing

2019-06-12 Thread Max Reitz
bdrv_set_backing_hd() is a function that explicitly cares about the bs->backing child. Highlight that in its description and use child_bs(bs->backing) instead of backing_bs(bs) to make it more obvious. Signed-off-by: Max Reitz --- block.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[Qemu-block] [PATCH v5 05/42] block: Add chain helper functions

2019-06-12 Thread Max Reitz
Add some helper functions for skipping filters in a chain of block nodes. Signed-off-by: Max Reitz --- include/block/block_int.h | 3 +++ block.c | 55 +++ 2 files changed, 58 insertions(+) diff --git a/include/block/block_int.h

[Qemu-block] [PATCH v5 04/42] block: Add child access functions

2019-06-12 Thread Max Reitz
There are BDS children that the general block layer code can access, namely bs->file and bs->backing. Since the introduction of filters and external data files, their meaning is not quite clear. bs->backing can be a COW source, or it can be an R/W-filtered child; bs->file can be an R/W-filtered

[Qemu-block] [PATCH v5 01/42] block: Mark commit and mirror as filter drivers

2019-06-12 Thread Max Reitz
The commit and mirror block nodes are filters, so they should be marked as such. (Strictly speaking, BDS.is_filter's documentation states that a filter's child must be bs->file. The following patch will relax this restriction, however.) Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia

[Qemu-block] [PATCH v5 00/42] block: Deal with filters

2019-06-12 Thread Max Reitz
Hi, When we introduced filters, we did it a bit casually. Sure, we talked a lot about them before, but that was mostly discussion about where implicit filters should be added to the graph (note that we currently only have two implicit filters, those being mirror and commit). But in the end, we

[Qemu-block] [PATCH 2/2] iotests: Test quitting with job on throttled node

2019-06-12 Thread Max Reitz
When qemu quits, all throttling should be ignored. That means, if there is a mirror job running from a throttled node, it should be cancelled immediately and qemu close without blocking. Signed-off-by: Max Reitz --- tests/qemu-iotests/218 | 55 --

[Qemu-block] [PATCH v5 03/42] throttle: Support compressed writes

2019-06-12 Thread Max Reitz
Signed-off-by: Max Reitz --- block/throttle.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/block/throttle.c b/block/throttle.c index f64dcc27b9..de1b6bd7e8 100644 --- a/block/throttle.c +++ b/block/throttle.c @@ -152,6 +152,15 @@ static int coroutine_fn

[Qemu-block] [PATCH 1/2] vl: Drain before (block) job cancel when quitting

2019-06-12 Thread Max Reitz
If the main loop cancels all block jobs while the block layer is not drained, this cancelling may not happen instantaneously. We can start a drained section before vm_shutdown(), which entails another bdrv_drain_all(); this nested bdrv_drain_all() will thus be a no-op, basically. We do not have

[Qemu-block] [PATCH 0/2] vl: Drain before (block) job cancel when quitting

2019-06-12 Thread Max Reitz
Quitting qemu should lead to qemu exiting pretty much immediately. That means if you have a block job running on a throttled block node, the node should ignore its throttling and the job should be cancelled immediately. Unfortunately, that is not what happens. Currently, the node will be

Re: [Qemu-block] [PATCH v7] ssh: switch from libssh2 to libssh

2019-06-12 Thread Philippe Mathieu-Daudé
Hi Pino, On 6/12/19 4:48 PM, Pino Toscano wrote: > Rewrite the implementation of the ssh block driver to use libssh instead > of libssh2. The libssh library has various advantages over libssh2: > - easier API for authentication (for example for using ssh-agent) > - easier API for known_hosts

Re: [Qemu-block] [QEMU] [PATCH v2 0/8] Add Qemu to SeaBIOS LCHS interface

2019-06-12 Thread Gerd Hoffmann
On Wed, Jun 12, 2019 at 04:30:03PM +0300, Sam Eiderman wrote: > > > > On 12 Jun 2019, at 16:06, Gerd Hoffmann wrote: > > > > On Wed, Jun 12, 2019 at 02:59:31PM +0300, Sam Eiderman wrote: > >> v1: > >> > >> Non-standard logical geometries break under QEMU. > >> > >> A virtual disk which

Re: [Qemu-block] [Qemu-devel] [PATCH 0/7] file-posix: Add dynamic-auto-read-only QAPI feature

2019-06-12 Thread Markus Armbruster
Markus Armbruster writes: > This series adds optional feature lists to struct definitions in the > QAPI schema and makes use of them to advertise the new behaviour of > auto-read-only=on in file-posix. Queued, thanks!

Re: [Qemu-block] [Qemu-devel] [PATCH 6/7] file-posix: Add dynamic-auto-read-only QAPI feature

2019-06-12 Thread Markus Armbruster
Eric Blake writes: > On 6/6/19 10:38 AM, Markus Armbruster wrote: >> From: Kevin Wolf >> >> In commit 23dece19da4 ('file-posix: Make auto-read-only dynamic') , >> auto-read-only=on changed its behaviour in file-posix for the 4.0 >> release. This change cannot be detected through the usual

Re: [Qemu-block] [Qemu-devel] [PATCH v2 11/11] monitor: Split out monitor/monitor.c

2019-06-12 Thread Kevin Wolf
Am 12.06.2019 um 15:49 hat Markus Armbruster geschrieben: > Kevin Wolf writes: > > > Move the monitor core infrastructure from monitor/misc.c to > > monitor/monitor.c. This is code that can be shared for all targets, so > > compile it only once. > > > > What remains in monitor/misc.c after this

Re: [Qemu-block] [Qemu-devel] [PATCH v2 10/11] monitor: Split out monitor/hmp.c

2019-06-12 Thread Kevin Wolf
Am 12.06.2019 um 15:17 hat Markus Armbruster geschrieben: > Kevin Wolf writes: > > > Move HMP infrastructure from monitor/misc.c to monitor/hmp.c. This is > > code that can be shared for all targets, so compile it only once. > > > > The amount of function and particularly extern variables in > >

Re: [Qemu-block] [Qemu-devel] [PATCH v2 09/11] monitor: Split out monitor/qmp.c

2019-06-12 Thread Kevin Wolf
Am 12.06.2019 um 15:11 hat Markus Armbruster geschrieben: > Kevin Wolf writes: > > > Move QMP infrastructure from monitor/misc.c to monitor/qmp.c. This is > > code that can be shared for all targets, so compile it only once. > > Less code compiled per target, yay! > > > The amount of function

Re: [Qemu-block] [Qemu-devel] [PATCH v2 04/11] monitor: Create MonitorHMP with readline state

2019-06-12 Thread Kevin Wolf
Am 12.06.2019 um 16:08 hat Markus Armbruster geschrieben: > Kevin Wolf writes: > > > Am 12.06.2019 um 11:07 hat Markus Armbruster geschrieben: > >> Cc: Peter for a monitor I/O thread question. > >> > >> Kevin Wolf writes: > >> > >> > The ReadLineState in Monitor is only used for HMP monitors.

[Qemu-block] [PATCH v7] ssh: switch from libssh2 to libssh

2019-06-12 Thread Pino Toscano
Rewrite the implementation of the ssh block driver to use libssh instead of libssh2. The libssh library has various advantages over libssh2: - easier API for authentication (for example for using ssh-agent) - easier API for known_hosts handling - supports newer types of keys in known_hosts Use

Re: [Qemu-block] [PATCH v5 04/12] block/io_uring: implements interfaces for io_uring

2019-06-12 Thread Stefan Hajnoczi
On Tue, Jun 11, 2019 at 07:17:14PM +0800, Fam Zheng wrote: > On Mon, 06/10 19:18, Aarushi Mehta wrote: > > +/* Prevent infinite loop if submission is refused */ > > +if (ret <= 0) { > > +if (ret == -EAGAIN) { > > +continue; > > +} > > +

Re: [Qemu-block] [Qemu-devel] [PATCH v2 03/11] monitor: Make MonitorQMP a child class of Monitor

2019-06-12 Thread Markus Armbruster
Kevin Wolf writes: > Am 12.06.2019 um 09:59 hat Markus Armbruster geschrieben: >> Kevin Wolf writes: >> >> > Currently, struct Monitor mixes state that is only relevant for HMP, >> > state that is only relevant for QMP, and some actually shared state. >> > In particular, a MonitorQMP field is

Re: [Qemu-block] [Qemu-devel] [PATCH v2 00/11] monitor: Split monitor.c in core/HMP/QMP/misc

2019-06-12 Thread Markus Armbruster
Kevin Wolf writes: > monitor.c mixes a lot of different things in a single file: The core > monitor infrastructure, HMP infrastrcture, QMP infrastructure, and the > implementation of several HMP and QMP commands. Almost worse, struct > Monitor mixes state for HMP, for QMP, and state actually

Re: [Qemu-block] [Qemu-devel] [PATCH v2 04/11] monitor: Create MonitorHMP with readline state

2019-06-12 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > Kevin Wolf writes: > > > Am 12.06.2019 um 11:07 hat Markus Armbruster geschrieben: > >> Cc: Peter for a monitor I/O thread question. > >> > >> Kevin Wolf writes: > >> > >> > The ReadLineState in Monitor is only used for HMP monitors. Create >

Re: [Qemu-block] [Qemu-devel] [PATCH v2 04/11] monitor: Create MonitorHMP with readline state

2019-06-12 Thread Markus Armbruster
Kevin Wolf writes: > Am 12.06.2019 um 11:07 hat Markus Armbruster geschrieben: >> Cc: Peter for a monitor I/O thread question. >> >> Kevin Wolf writes: >> >> > The ReadLineState in Monitor is only used for HMP monitors. Create >> > MonitorHMP and move it there. >> > >> > Signed-off-by: Kevin

Re: [Qemu-block] [Qemu-devel] [PATCH v2 11/11] monitor: Split out monitor/monitor.c

2019-06-12 Thread Markus Armbruster
Kevin Wolf writes: > Move the monitor core infrastructure from monitor/misc.c to > monitor/monitor.c. This is code that can be shared for all targets, so > compile it only once. > > What remains in monitor/misc.c after this patch is mostly monitor > command implementations and code that requires

Re: [Qemu-block] [Qemu-devel] [PATCH v2 05/11] monitor: Move cmd_table to MonitorHMP

2019-06-12 Thread Kevin Wolf
Am 12.06.2019 um 13:45 hat Markus Armbruster geschrieben: > Kevin Wolf writes: > > > Monitor.cmd_table contains the handlers for HMP commands, so there is no > > reason to keep it in the state shared with QMP. Move it to MonitorHMP. > > > > Signed-off-by: Kevin Wolf > > Reviewed-by: Dr. David

Re: [Qemu-block] [SeaBIOS] [QEMU] [PATCH v2 0/8] Add Qemu to SeaBIOS LCHS interface

2019-06-12 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190612115939.23825-1-shmuel.eider...@oracle.com/ Hi, This series failed the asan build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN ===

Re: [Qemu-block] [QEMU] [PATCH v2 0/8] Add Qemu to SeaBIOS LCHS interface

2019-06-12 Thread Sam Eiderman
> On 12 Jun 2019, at 16:06, Gerd Hoffmann wrote: > > On Wed, Jun 12, 2019 at 02:59:31PM +0300, Sam Eiderman wrote: >> v1: >> >> Non-standard logical geometries break under QEMU. >> >> A virtual disk which contains an operating system which depends on >> logical geometries (consistent values

Re: [Qemu-block] [PATCH v6] ssh: switch from libssh2 to libssh

2019-06-12 Thread Philippe Mathieu-Daudé
Cc'ing Alex (Docker, Travis) and Stefan (MinGW) On 6/5/19 11:36 PM, Pino Toscano wrote: > Rewrite the implementation of the ssh block driver to use libssh instead > of libssh2. The libssh library has various advantages over libssh2: > - easier API for authentication (for example for using

Re: [Qemu-block] [Qemu-devel] [PATCH v2 10/11] monitor: Split out monitor/hmp.c

2019-06-12 Thread Markus Armbruster
Kevin Wolf writes: > Move HMP infrastructure from monitor/misc.c to monitor/hmp.c. This is > code that can be shared for all targets, so compile it only once. > > The amount of function and particularly extern variables in > monitor_int.h is probably a bit larger than it needs to be, but this

Re: [Qemu-block] [QEMU] [PATCH v2 0/8] Add Qemu to SeaBIOS LCHS interface

2019-06-12 Thread Gerd Hoffmann
On Wed, Jun 12, 2019 at 02:59:31PM +0300, Sam Eiderman wrote: > v1: > > Non-standard logical geometries break under QEMU. > > A virtual disk which contains an operating system which depends on > logical geometries (consistent values being reported from BIOS INT13 > AH=08) will most likely break

Re: [Qemu-block] [Qemu-devel] [QEMU] [PATCH 7/8] bootdevice: FW_CFG interface for LCHS values

2019-06-12 Thread Sam Eiderman
> On 12 Jun 2019, at 15:27, Laszlo Ersek wrote: > > On 06/12/19 11:42, Sam Eiderman wrote: >> Using fw_cfg, supply logical CHS values directly from QEMU to the BIOS. >> >> Non-standard logical geometries break under QEMU. >> >> A virtual disk which contains an operating system which depends

Re: [Qemu-block] [Qemu-devel] [PATCH v2 09/11] monitor: Split out monitor/qmp.c

2019-06-12 Thread Markus Armbruster
Kevin Wolf writes: > Move QMP infrastructure from monitor/misc.c to monitor/qmp.c. This is > code that can be shared for all targets, so compile it only once. Less code compiled per target, yay! > The amount of function and particularly extern variables in > monitor_int.h is probably a bit

Re: [Qemu-block] [Qemu-devel] [PATCH v2 08/11] monitor: Create monitor_int.h with common definitions

2019-06-12 Thread Markus Armbruster
One more nit... Kevin Wolf writes: > Before we can split monitor.c, we need to create a header file that monitor/misc.c > contains the common definitions that will be used by multiple source > files. > > Signed-off-by: Kevin Wolf > Reviewed-by: Dr. David Alan Gilbert

Re: [Qemu-block] [SeaBIOS] [QEMU] [PATCH v2 0/8] Add Qemu to SeaBIOS LCHS interface

2019-06-12 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190612115939.23825-1-shmuel.eider...@oracle.com/ Hi, This series seems to have some coding style problems. See output below for more information: Subject: [SeaBIOS] [QEMU] [PATCH v2 0/8] Add Qemu to SeaBIOS LCHS interface Type: series Message-id:

Re: [Qemu-block] [Qemu-devel] [QEMU] [PATCH 7/8] bootdevice: FW_CFG interface for LCHS values

2019-06-12 Thread Laszlo Ersek
On 06/12/19 11:42, Sam Eiderman wrote: > Using fw_cfg, supply logical CHS values directly from QEMU to the BIOS. > > Non-standard logical geometries break under QEMU. > > A virtual disk which contains an operating system which depends on > logical geometries (consistent values being reported

[Qemu-block] [QEMU] [PATCH v2 1/8] block: Refactor macros - fix tabbing

2019-06-12 Thread Sam Eiderman
Fixing tabbing in block related macros. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- hw/ide/qdev.c| 2 +- include/hw/block/block.h | 16 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/ide/qdev.c

[Qemu-block] [QEMU] [PATCH v2 2/8] block: Support providing LCHS from user

2019-06-12 Thread Sam Eiderman
Add logical geometry variables to BlockConf. A user can now supply "lcyls", "lheads" & "lsecs" for any HD device that supports CHS ("cyls", "heads", "secs"). These devices include: * ide-hd * scsi-hd * virtio-blk-pci In future commits we will use the provided LCHS and pass it to the

[Qemu-block] [QEMU] [PATCH v2 0/8] Add Qemu to SeaBIOS LCHS interface

2019-06-12 Thread Sam Eiderman
v1: Non-standard logical geometries break under QEMU. A virtual disk which contains an operating system which depends on logical geometries (consistent values being reported from BIOS INT13 AH=08) will most likely break under QEMU/SeaBIOS if it has non-standard logical geometries - for example

Re: [Qemu-block] [Qemu-devel] [PATCH v2 06/11] Move monitor.c to monitor/misc.c

2019-06-12 Thread Markus Armbruster
Kevin Wolf writes: > Create a new monitor/ subdirectory and move monitor.c there. As the plan > is to move the monitor core into separate files, use the chance to > rename it to misc.c. I figure we'll want to move most of (all of?) monitor/misc.c out. Not a job this series must finish, of

[Qemu-block] [QEMU] [PATCH v2 3/8] bootdevice: Add interface to gather LCHS

2019-06-12 Thread Sam Eiderman
Add an interface to provide direct logical CHS values for boot devices. We will use this interface in the next commits. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- bootdevice.c| 55 +

[Qemu-block] [QEMU] [PATCH v2 5/8] bootdevice: Gather LCHS from all relevant devices

2019-06-12 Thread Sam Eiderman
Relevant devices are: * ide-hd (and ide-cd, ide-drive) * scsi-hd (and scsi-cd, scsi-disk, scsi-block) * virtio-blk-pci We do not call del_boot_device_lchs() for ide-* since we don't need to - IDE block devices do not support unplugging. Reviewed-by: Karl Heubaum Reviewed-by: Arbel

Re: [Qemu-block] [Qemu-devel] [PATCH v2 07/11] monitor: Move {hmp, qmp}.c to monitor/{hmp, qmp}-cmds.c

2019-06-12 Thread Markus Armbruster
Kevin Wolf writes: > Now that we have a monitor/ subdirectory, let's move hmp.c and qmp.c > from the root directory there. As they contain implementations of > monitor commands, rename them to {hmp,qmp}-cmds.c, so that {hmp,qmp}.c > are free for the HMP and QMP infrastructure. > > Signed-off-by:

[Qemu-block] [QEMU] [PATCH v2 8/8] hd-geo-test: Add tests for lchs override

2019-06-12 Thread Sam Eiderman
Add QTest tests to check the logical geometry override option. The tests in hd-geo-test are out of date - they only test IDE and do not test interesting MBRs. I added a few helper functions which will make adding more tests easier. QTest's fw_cfg helper functions support only legacy fw_cfg, so

[Qemu-block] [QEMU] [PATCH v2 4/8] scsi: Propagate unrealize() callback to scsi-hd

2019-06-12 Thread Sam Eiderman
We will need to add LCHS removal logic to scsi-hd's unrealize() in the next commit. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- hw/scsi/scsi-bus.c | 15 +++ include/hw/scsi/scsi.h | 1 + 2 files changed, 16 insertions(+) diff --git

[Qemu-block] [QEMU] [PATCH v2 7/8] bootdevice: FW_CFG interface for LCHS values

2019-06-12 Thread Sam Eiderman
Using fw_cfg, supply logical CHS values directly from QEMU to the BIOS. Non-standard logical geometries break under QEMU. A virtual disk which contains an operating system which depends on logical geometries (consistent values being reported from BIOS INT13 AH=08) will most likely break under

[Qemu-block] [QEMU] [PATCH v2 6/8] bootdevice: Refactor get_boot_devices_list

2019-06-12 Thread Sam Eiderman
Move device name construction to a separate function. We will reuse this function in the following commit to pass logical CHS parameters through fw_cfg much like we currently pass bootindex. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- bootdevice.c | 61

Re: [Qemu-block] [Qemu-devel] [PATCH v2 05/11] monitor: Move cmd_table to MonitorHMP

2019-06-12 Thread Markus Armbruster
Kevin Wolf writes: > Monitor.cmd_table contains the handlers for HMP commands, so there is no > reason to keep it in the state shared with QMP. Move it to MonitorHMP. > > Signed-off-by: Kevin Wolf > Reviewed-by: Dr. David Alan Gilbert > --- > monitor.c | 23 +++ > 1 file

Re: [Qemu-block] [Qemu-devel] [PATCH v2 03/11] monitor: Make MonitorQMP a child class of Monitor

2019-06-12 Thread Kevin Wolf
Am 12.06.2019 um 09:59 hat Markus Armbruster geschrieben: > Kevin Wolf writes: > > > Currently, struct Monitor mixes state that is only relevant for HMP, > > state that is only relevant for QMP, and some actually shared state. > > In particular, a MonitorQMP field is present in the state of any

Re: [Qemu-block] [SeaBIOS] [QEMU] [PATCH 0/8] Add Qemu to SeaBIOS LCHS interface

2019-06-12 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190612094237.47462-1-shmuel.eider...@oracle.com/ Hi, This series failed the asan build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN ===

Re: [Qemu-block] [SeaBIOS] [QEMU] [PATCH 0/8] Add Qemu to SeaBIOS LCHS interface

2019-06-12 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190612094237.47462-1-shmuel.eider...@oracle.com/ Hi, This series seems to have some coding style problems. See output below for more information: Subject: [SeaBIOS] [QEMU] [PATCH 0/8] Add Qemu to SeaBIOS LCHS interface Type: series Message-id:

Re: [Qemu-block] [Qemu-devel] [PATCH v2 04/11] monitor: Create MonitorHMP with readline state

2019-06-12 Thread Kevin Wolf
Am 12.06.2019 um 11:07 hat Markus Armbruster geschrieben: > Cc: Peter for a monitor I/O thread question. > > Kevin Wolf writes: > > > The ReadLineState in Monitor is only used for HMP monitors. Create > > MonitorHMP and move it there. > > > > Signed-off-by: Kevin Wolf > > Reviewed-by: Dr.

Re: [Qemu-block] [Qemu-devel] [PATCH v2 04/11] monitor: Create MonitorHMP with readline state

2019-06-12 Thread Peter Xu
On Wed, Jun 12, 2019 at 11:07:01AM +0200, Markus Armbruster wrote: [...] > > +struct MonitorHMP { > > +Monitor common; > > +/* > > + * State used only in the thread "owning" the monitor. > > + * If @use_io_thread, this is @mon_iothread. > > + * Else, it's the main thread. > >

[Qemu-block] [QEMU] [PATCH 8/8] hd-geo-test: Add tests for lchs override

2019-06-12 Thread Sam Eiderman
Add QTest tests to check the logical geometry override option. The tests in hd-geo-test are out of date - they only test IDE and do not test interesting MBRs. I added a few helper functions which will make adding more tests easier. QTest's fw_cfg helper functions support only legacy fw_cfg, so

[Qemu-block] [QEMU] [PATCH 7/8] bootdevice: FW_CFG interface for LCHS values

2019-06-12 Thread Sam Eiderman
Using fw_cfg, supply logical CHS values directly from QEMU to the BIOS. Non-standard logical geometries break under QEMU. A virtual disk which contains an operating system which depends on logical geometries (consistent values being reported from BIOS INT13 AH=08) will most likely break under

[Qemu-block] [QEMU] [PATCH 4/8] scsi: Propagate unrealize() callback to scsi-hd

2019-06-12 Thread Sam Eiderman
We will need to add LCHS removal logic to scsi-hd's unrealize() in the next commit. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- hw/scsi/scsi-bus.c | 15 +++ include/hw/scsi/scsi.h | 1 + 2 files changed, 16 insertions(+) diff --git

[Qemu-block] [QEMU] [PATCH 6/8] bootdevice: Refactor get_boot_devices_list

2019-06-12 Thread Sam Eiderman
Move device name construction to a separate function. We will reuse this function in the following commit to pass logical CHS parameters through fw_cfg much like we currently pass bootindex. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- bootdevice.c | 61

[Qemu-block] [QEMU] [PATCH 2/8] block: Support providing LCHS from user

2019-06-12 Thread Sam Eiderman
Add logical geometry variables to BlockConf. A user can now supply "lcyls", "lheads" & "lsecs" for any HD device that supports CHS ("cyls", "heads", "secs"). These devices include: * ide-hd * scsi-hd * virtio-blk-pci In future commits we will use the provided LCHS and pass it to the

[Qemu-block] [QEMU] [PATCH 1/8] block: Refactor macros - fix tabbing

2019-06-12 Thread Sam Eiderman
Fixing tabbing in block related macros. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- hw/ide/qdev.c| 2 +- include/hw/block/block.h | 16 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/ide/qdev.c

  1   2   >