Re: [Qemu-block] [Qemu-devel] [PATCH v3 06/15] monitor: Rename HMP command type and tables

2019-06-13 Thread Markus Armbruster
Kevin Wolf writes: > This renames the type for HMP monitor commands and the tables holding > the commands to make clear that they are related to HMP and to allow > making them public later: > > * mon_cmd_t -> HMPCommand (fixing use of a reserved name, too) > * mon_cmds -> hmp_cmds > * info_cmds

Re: [Qemu-block] [Qemu-devel] [PATCH v3 05/15] monitor: Remove Monitor.cmd_table indirection

2019-06-13 Thread Markus Armbruster
Kevin Wolf writes: > Monitor.cmd_table is initialised to point to mon_cmds and never changed > afterwards. We can remove the indirection and just reference mon_cmds > directly instead. > > Signed-off-by: Kevin Wolf Reviewed-by: Markus Armbruster

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

2019-06-13 Thread Gerd Hoffmann
Hi, > Can there be a guest that will fail the MBR in such a way? Yes. > Look at the following MBR partition table of a Windows XP guest in our > production > environment: > > Disk size in sectors: 16777216 > > Binary (only one partition 16 bytes): 80 01 01 00 07 fe ff ff 3f 00 00 00 d5 > ea

Re: [Qemu-block] [Qemu-devel] testsuite spurious failure due to leftover files

2019-06-13 Thread Markus Armbruster
Eric Blake writes: > iotests ./check -qcow2 failed for me today: > > 191 fail [10:46:04] [10:46:13] 0s (last: 7s)output > mismatch (see 191.out.bad) > --- /home/eblake/qemu/tests/qemu-iotests/191.out 2019-05-24 > 09:27:46.449348997 -0500 > +++

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: Hide timestamps for skipped tests

2019-06-13 Thread Philippe Mathieu-Daudé
On 6/13/19 8:37 PM, Max Reitz wrote: > Currently, the "thistime" variable is not reinitialized on every loop > iteration. This leads to tests that do not yield a run time (because > they failed or were skipped) printing the run time of the previous test > that did. Fix that by reinitializing

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

2019-06-13 Thread Eric Blake
On 6/13/19 2:31 PM, Max Reitz wrote: >> @@ -657,71 +644,147 @@ static int connect_to_ssh(BDRVSSHState *s, >> BlockdevOptionsSsh *opts, > > [...] > >> +/* >> + * Try to disable the Nagle algorithm on TCP sockets to reduce latency, >> + * but do not fail if it cannot be disabled. >>

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: Hide timestamps for skipped tests

2019-06-13 Thread Eric Blake
On 6/13/19 1:37 PM, Max Reitz wrote: > Currently, the "thistime" variable is not reinitialized on every loop > iteration. This leads to tests that do not yield a run time (because > they failed or were skipped) printing the run time of the previous test > that did. Fix that by reinitializing

Re: [Qemu-block] [PATCH v4 0/7] qemu-img: Add salvaging mode to convert

2019-06-13 Thread Max Reitz
On 07.05.19 22:35, Max Reitz wrote: > Hi, > > This series adds a --salvage option to qemu-img convert. With this, > qemu-img will not abort when it encounters an I/O error. Instead, it > tries to narrow it down and will treat the affected sectors as being > completely 0 (and print a warning). >

Re: [Qemu-block] [PATCH] qemu-img: Fix options leakage in img_rebase()

2019-06-13 Thread Max Reitz
On 28.05.19 21:53, Max Reitz wrote: > img_rebase() can leak a QDict in two occasions. Fix it. > > Coverity: CID 1401416 > Fixes: d16699b64671466b42079c45b89127aeea1ca565 > Fixes: 330c72957196e0ae382abcaa97ebf4eb9bc8574f > Signed-off-by: Max Reitz > --- > qemu-img.c | 3 +++ > 1 file changed, 3

Re: [Qemu-block] [PATCH v3 0/8] block: Ignore loosening perm restrictions failures

2019-06-13 Thread Max Reitz
Ping just the final three patches left to review On 22.05.19 19:03, Max Reitz wrote: > Hi, > > This series is mainly a fix for > https://bugzilla.redhat.com/show_bug.cgi?id=1703793. The problem > described there is that mirroring to a gluster volume, then switching > off the volume makes qemu

Re: [Qemu-block] [PATCH v2 0/2] blockdev: Overlays are not snapshots

2019-06-13 Thread Max Reitz
On 03.06.19 22:22, Max Reitz wrote: > QEMU’s always been confused over what a snapshot is: Is it the overlay? > Is it the backing image? > > Confusion is rarely a good thing. I can’t think of any objective reason > why the overlay would be a snapshot. A snapshot is something that does > not

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

2019-06-13 Thread Stefan Weil
On 12.06.19 15:27, Philippe Mathieu-Daudé wrote: > Cc'ing Alex (Docker, Travis) and Stefan (MinGW) [...] > Note, libssh is not available on MinGW. Nor is it available for Mingw64: https://cygwin.com/cgi-bin2/package-grep.cgi?grep=mingw64-x86_64-libssh=x86_64 That makes building for Windows more

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

2019-06-13 Thread Max Reitz
On 13.06.19 15:20, 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 handling > -

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

2019-06-13 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190613153405.24769-1-kw...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20190613153405.24769-1-kw...@redhat.com Subject: [Qemu-devel] [PATCH v3 00/15] monitor: Split monitor.c

[Qemu-block] [PATCH] iotests: Hide timestamps for skipped tests

2019-06-13 Thread Max Reitz
Currently, the "thistime" variable is not reinitialized on every loop iteration. This leads to tests that do not yield a run time (because they failed or were skipped) printing the run time of the previous test that did. Fix that by reinitializing "thistime" for every test. Signed-off-by: Max

Re: [Qemu-block] [Qemu-devel] [PATCH v8 0/7] backup-top filter driver for backup

2019-06-13 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190529154654.95870-1-vsement...@virtuozzo.com/ Hi, This series failed build test on s390x host. Please find the details below. === TEST SCRIPT BEGIN === #!/bin/bash # Testing script will be invoked under the git checkout with # HEAD pointing to a

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

2019-06-13 Thread Paolo Bonzini
On 13/06/19 19:15, Philippe Mathieu-Daudé wrote: > > On 6/13/19 6:24 PM, no-re...@patchew.org wrote: >> === TEST SCRIPT BEGIN === >> #!/bin/bash >> time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1 >> === TEST SCRIPT END === > >> The full log is available at >>

Re: [Qemu-block] [PATCH v8 7/7] block/backup: use backup-top instead of write notifiers

2019-06-13 Thread Max Reitz
On 29.05.19 17:46, Vladimir Sementsov-Ogievskiy wrote: > Drop write notifiers and use filter node instead. Changes: > > 1. copy-before-writes now handled by filter node, so, drop all >is_write_notifier arguments. > > 2. we don't have intersecting requests, so their handling is dropped. >

Re: [Qemu-block] [Qemu-devel] [RFC 0/3] block: Inquire images’ rotational info

2019-06-13 Thread Max Reitz
On 13.06.19 18:12, Stefan Hajnoczi wrote: > On Fri, May 24, 2019 at 07:28:09PM +0200, Max Reitz wrote: >> Hi, >> >> http://lists.nongnu.org/archive/html/qemu-block/2019-05/msg00569.html >> shows that optimizations affect HDDs and SSDs differently. It would be >> nice if we could differentiate

Re: [Qemu-block] [Qemu-devel] [PATCH v8 0/7] backup-top filter driver for backup

2019-06-13 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190529154654.95870-1-vsement...@virtuozzo.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-devel] [RFC 0/3] block: Inquire images’ rotational info

2019-06-13 Thread Stefan Hajnoczi
On Fri, May 24, 2019 at 07:28:09PM +0200, Max Reitz wrote: > Hi, > > http://lists.nongnu.org/archive/html/qemu-block/2019-05/msg00569.html > shows that optimizations affect HDDs and SSDs differently. It would be > nice if we could differentiate between the two and then choose to adjust > our

Re: [Qemu-block] [PATCH 3/3] block/nbd: merge NBDClientSession struct back to BDRVNBDState

2019-06-13 Thread Max Reitz
On 13.06.19 17:16, Eric Blake wrote: > On 6/11/19 5:27 AM, Vladimir Sementsov-Ogievskiy wrote: >> No reason to keep it separate, it differs from others block driver >> behavior and therefor confuses. Instead of generic > > s/therefor/therefore/ (both spellings are valid, but the former looks >

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

2019-06-13 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190613132000.2146-1-ptosc...@redhat.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 === #!/bin/bash time

Re: [Qemu-block] [PATCH v8 6/7] block: add lock/unlock range functions

2019-06-13 Thread Max Reitz
On 29.05.19 17:46, Vladimir Sementsov-Ogievskiy wrote: > From: Vladimir Sementsov-Ogievskiy > > Introduce lock/unlock range functionality, based on serialized > requests. This is needed to refactor backup, dropping local > tracked-request-like synchronization. > > Signed-off-by: Vladimir

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

2019-06-13 Thread Max Reitz
On 13.06.19 17:28, Vladimir Sementsov-Ogievskiy wrote: > 13.06.2019 1:09, Max Reitz wrote: >> 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

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

2019-06-13 Thread Philippe Mathieu-Daudé
On 6/13/19 6:24 PM, no-re...@patchew.org wrote: > === TEST SCRIPT BEGIN === > #!/bin/bash > time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1 > === TEST SCRIPT END === > The full log is available at >

Re: [Qemu-block] [PATCH v8 4/7] block: introduce backup-top filter driver

2019-06-13 Thread Max Reitz
On 29.05.19 17:46, Vladimir Sementsov-Ogievskiy wrote: > Backup-top filter does copy-before-write operation. It should be > inserted above active disk and has a target node for CBW, like the > following: > > +---+ > | Guest | > +---+ > |r,w > v >

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

2019-06-13 Thread Max Reitz
[re-adding the original CCs, why not] On 13.06.19 16:30, Vladimir Sementsov-Ogievskiy wrote: > 13.06.2019 17:21, Max Reitz wrote: >> On 13.06.19 16:19, Vladimir Sementsov-Ogievskiy wrote: >>> 13.06.2019 1:08, Max Reitz wrote: If the main loop cancels all block jobs while the block layer is

[Qemu-block] [PULL 4/9] iotests: Use qemu-nbd's --pid-file

2019-06-13 Thread Eric Blake
From: Max Reitz Signed-off-by: Max Reitz Message-Id: <20190508211820.17851-5-mre...@redhat.com> Signed-off-by: Eric Blake --- tests/qemu-iotests/common.rc | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc

[Qemu-block] [PULL 6/9] nbd/server: Nicer spelling of max BLOCK_STATUS reply length

2019-06-13 Thread Eric Blake
Commit 3d068aff (3.0) introduced NBD_MAX_BITMAP_EXTENTS as a limit on how large we would allow a reply to NBD_CMD_BLOCK_STATUS to grow when it is visiting a qemu:dirty-bitmap: context. Later, commit fb7afc79 (3.1) reused the constant to limit base:allocation context replies, although the name is

[Qemu-block] [PULL 1/9] qemu-nbd: Add --pid-file option

2019-06-13 Thread Eric Blake
From: Max Reitz --fork is a bit boring if there is no way to get the child's PID. This option helps. Signed-off-by: Max Reitz Message-Id: <20190508211820.17851-2-mre...@redhat.com> Signed-off-by: Eric Blake --- qemu-nbd.texi | 2 ++ qemu-nbd.c| 11 +++ 2 files changed, 13

[Qemu-block] [PULL 7/9] block/nbd-client: drop stale logout

2019-06-13 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Drop one on failure path (we have errp) and turn two others into trace points. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20190611102720.86114-2-vsement...@virtuozzo.com> Reviewed-by: Eric Blake Signed-off-by: Eric Blake ---

[Qemu-block] [PULL 5/9] iotests: Let 233 run concurrently

2019-06-13 Thread Eric Blake
From: Max Reitz common.nbd's nbd_server_set_tcp_port() tries to find a free port, and then uses it for the whole test run. However, this is racy because even if the port was free at the beginning, there is no guarantee it will continue to be available. Therefore, 233 currently cannot reliably

[Qemu-block] [PULL 2/9] iotests.py: Add qemu_nbd_early_pipe()

2019-06-13 Thread Eric Blake
From: Max Reitz qemu_nbd_pipe() currently unconditionally reads qemu-nbd's output. That is not ideal because qemu-nbd may keep stderr open after the parent process has exited. Currently, the only user of qemu_nbd_pipe() is 147, which discards the whole output if the parent process returned

[Qemu-block] [PULL 3/9] qemu-nbd: Do not close stderr

2019-06-13 Thread Eric Blake
From: Max Reitz We kept old_stderr specifically so we could keep emitting error message on stderr. However, qemu_daemon() closes stderr. Therefore, we need to dup() stderr to old_stderr before invoking qemu_daemon(). Signed-off-by: Max Reitz Reviewed-by: Eric Blake Message-Id:

[Qemu-block] [PATCH v3 15/15] vl: Deprecate -mon pretty=... for HMP monitors

2019-06-13 Thread Kevin Wolf
The -mon pretty=on|off switch of the -mon option applies only the QMP monitors. It used to be silently ignored for HMP. Deprecate this combination so that we can make it an error in future versions. Signed-off-by: Kevin Wolf --- vl.c | 10 +- qemu-deprecated.texi | 6

[Qemu-block] [PATCH v3 14/15] monitor: Replace monitor_init() with monitor_init_{hmp, qmp}()

2019-06-13 Thread Kevin Wolf
Most callers know which monitor type they want to have. Instead of calling monitor_init() with flags that can describe both types of monitors, make monitor_init_{hmp,qmp}() public interfaces that take specific bools instead of flags and call these functions directly. Signed-off-by: Kevin Wolf

[Qemu-block] [PATCH v3 12/15] monitor: Split out monitor/monitor.c

2019-06-13 Thread Kevin Wolf
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 (which could move to hmp-cmds.c or qmp-cmds.c later)

[Qemu-block] [PATCH v3 13/15] monitor: Split Monitor.flags into separate bools

2019-06-13 Thread Kevin Wolf
Monitor.flags contains three different flags: One to distinguish HMP from QMP; one specific to HMP (MONITOR_USE_READLINE) that is ignored with QMP; and another one specific to QMP (MONITOR_USE_PRETTY) that is ignored with HMP. Split the flags field into three bools and move them to the right

[Qemu-block] [PATCH v3 09/15] monitor: Create monitor-internal.h with common definitions

2019-06-13 Thread Kevin Wolf
Before we can split monitor/misc.c, we need to create a header file that contains the common definitions that will be used by multiple source files. For a start, add the type definitions for Monitor, MonitorHMP and MonitorQMP and their dependencies. We'll add functions as needed when splitting

[Qemu-block] [PATCH v3 03/15] monitor: Make MonitorQMP a child class of Monitor

2019-06-13 Thread Kevin Wolf
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 monitor, even if it's not a QMP monitor and therefore doesn't use the state. As a first step

[Qemu-block] [PATCH v3 04/15] monitor: Create MonitorHMP with readline state

2019-06-13 Thread Kevin Wolf
The ReadLineState in Monitor is only used for HMP monitors. Create MonitorHMP and move it there. Signed-off-by: Kevin Wolf Reviewed-by: Dr. David Alan Gilbert --- include/monitor/monitor.h | 5 +- hmp.c | 4 +- monitor.c | 129

[Qemu-block] [PATCH v3 11/15] monitor: Split out monitor/hmp.c

2019-06-13 Thread Kevin Wolf
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 way no non-trivial code

[Qemu-block] [PATCH v3 06/15] monitor: Rename HMP command type and tables

2019-06-13 Thread Kevin Wolf
This renames the type for HMP monitor commands and the tables holding the commands to make clear that they are related to HMP and to allow making them public later: * mon_cmd_t -> HMPCommand (fixing use of a reserved name, too) * mon_cmds -> hmp_cmds * info_cmds -> hmp_info_cmds Signed-off-by:

[Qemu-block] [PATCH v3 10/15] monitor: Split out monitor/qmp.c

2019-06-13 Thread Kevin Wolf
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. The amount of function and particularly extern variables in monitor_int.h is probably a bit larger than it needs to be, but this way no non-trivial code

[Qemu-block] [PATCH v3 00/15] monitor: Split monitor.c in core/HMP/QMP/misc

2019-06-13 Thread Kevin Wolf
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 shared between all monitors.

[Qemu-block] [PATCH v3 08/15] monitor: Move {hmp, qmp}.c to monitor/{hmp, qmp}-cmds.c

2019-06-13 Thread Kevin Wolf
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: Kevin Wolf Reviewed-by: Dr.

[Qemu-block] testsuite spurious failure due to leftover files

2019-06-13 Thread Eric Blake
iotests ./check -qcow2 failed for me today: 191 fail [10:46:04] [10:46:13] 0s (last: 7s)output mismatch (see 191.out.bad) --- /home/eblake/qemu/tests/qemu-iotests/191.out2019-05-24 09:27:46.449348997 -0500 +++ /home/eblake/qemu/tests/qemu-iotests/191.out.bad2019-06-13

[Qemu-block] [PULL 8/9] block/nbd: merge nbd-client.* to nbd.c

2019-06-13 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy No reason for keeping driver handlers realization separate from driver structure. We can get rid of extra header file. While being here, fix comments style, restore forgotten comments for NBD_FOREACH_REPLY_CHUNK and nbd_reply_chunk_iter_receive, remove extra

[Qemu-block] [PULL 9/9] block/nbd: merge NBDClientSession struct back to BDRVNBDState

2019-06-13 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy No reason to keep it separate, it differs from others block driver behavior and therefore confuses. Instead of generic 'state = (State*)bs->opaque' we have to use special helper. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id:

[Qemu-block] [PATCH v3 05/15] monitor: Remove Monitor.cmd_table indirection

2019-06-13 Thread Kevin Wolf
Monitor.cmd_table is initialised to point to mon_cmds and never changed afterwards. We can remove the indirection and just reference mon_cmds directly instead. Signed-off-by: Kevin Wolf --- monitor.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/monitor.c

[Qemu-block] [PATCH v3 07/15] Move monitor.c to monitor/misc.c

2019-06-13 Thread Kevin Wolf
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. Signed-off-by: Kevin Wolf Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Markus Armbruster --- docs/devel/writing-qmp-commands.txt

[Qemu-block] [PATCH v3 02/15] monitor: Split monitor_init in HMP and QMP function

2019-06-13 Thread Kevin Wolf
Instead of mixing HMP and QMP monitors in the same function, separate the monitor creation function for both. While in theory, one could pass both MONITOR_USE_CONTROL and MONITOR_USE_READLINE before this patch and both flags would do something, readline support is tightly coupled with HMP: QMP

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

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
13.06.2019 1:09, Max Reitz wrote: > 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

[Qemu-block] [PATCH v3 01/15] monitor: Remove unused password prompting fields

2019-06-13 Thread Kevin Wolf
Commit 788cf9f8c removed the code for password prompting from the monitor. Since then, the Monitor fields password_completion_cb and password_opaque have been unused. Remove them. Signed-off-by: Kevin Wolf Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Markus Armbruster --- monitor.c | 2 --

Re: [Qemu-block] [PATCH 2/3] block/nbd: merge nbd-client.* to nbd.c

2019-06-13 Thread Eric Blake
On 6/11/19 5:27 AM, Vladimir Sementsov-Ogievskiy wrote: > No reason of keeping driver handlers realization in separate of driver > structure. We can get rid of extra header file. > > While being here, fix comments style, restore forgotten comments for > NBD_FOREACH_REPLY_CHUNK and

Re: [Qemu-block] [PATCH 3/3] block/nbd: merge NBDClientSession struct back to BDRVNBDState

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
13.06.2019 18:16, Eric Blake wrote: > On 6/11/19 5:27 AM, Vladimir Sementsov-Ogievskiy wrote: >> No reason to keep it separate, it differs from others block driver >> behavior and therefor confuses. Instead of generic > > s/therefor/therefore/ (both spellings are valid, but the former looks >

Re: [Qemu-block] [PATCH 3/3] block/nbd: merge NBDClientSession struct back to BDRVNBDState

2019-06-13 Thread Eric Blake
On 6/11/19 5:27 AM, Vladimir Sementsov-Ogievskiy wrote: > No reason to keep it separate, it differs from others block driver > behavior and therefor confuses. Instead of generic s/therefor/therefore/ (both spellings are valid, but the former looks archaic) > 'state = (State*)bs->opaque' we

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

2019-06-13 Thread Max Reitz
On 13.06.19 15:16, Vladimir Sementsov-Ogievskiy wrote: > 13.06.2019 1:09, Max Reitz wrote: >> 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

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

2019-06-13 Thread Max Reitz
On 13.06.19 15:29, Vladimir Sementsov-Ogievskiy wrote: > 13.06.2019 1:09, Max Reitz wrote: >> Filters cannot compress data themselves but they have to implement >> .bdrv_co_pwritev_compressed() still (or they cannot forward compressed >> writes). Therefore, checking whether >>

Re: [Qemu-block] [PATCH 1/3] block/nbd-client: drop stale logout

2019-06-13 Thread Eric Blake
On 6/11/19 5:27 AM, Vladimir Sementsov-Ogievskiy wrote: > Drop one on failure path (we have errp) and turn two others into trace > points. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/nbd-client.h | 9 - > block/nbd-client.c | 6 +++--- > block/trace-events | 2 ++ > 3

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

2019-06-13 Thread Max Reitz
On 13.06.19 15:04, Vladimir Sementsov-Ogievskiy wrote: > 13.06.2019 1:09, Max Reitz wrote: >> 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

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

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
13.06.2019 1:09, Max Reitz wrote: > 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

Re: [Qemu-block] [PATCH v8 2/7] block: swap operation order in bdrv_append

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
13.06.2019 16:45, Max Reitz wrote: > On 29.05.19 17:46, Vladimir Sementsov-Ogievskiy wrote: >> bs_top parents may conflict with bs_new backing child permissions, so >> let's do bdrv_replace_node first, it covers more possible cases. >> >> It is needed for further implementation of backup-top

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

2019-06-13 Thread Kevin Wolf
Am 13.06.2019 um 07:38 hat Markus Armbruster geschrieben: > Kevin Wolf writes: > > > Am 12.06.2019 um 15:11 hat Markus Armbruster geschrieben: > >> Kevin Wolf writes: > >> > --- a/include/monitor/monitor.h > >> > +++ b/include/monitor/monitor.h > >> > @@ -21,6 +21,7 @@ bool

Re: [Qemu-block] [PATCH v8 3/7] block: allow not one child for implicit node

2019-06-13 Thread Max Reitz
On 29.05.19 17:46, Vladimir Sementsov-Ogievskiy wrote: > Upcoming backup-top filter wants to operate like usual implicit filter > node with fall-through to backing child. But also needs additional > target child, let's support that. > > On the other hand, after backup completion (before job

Re: [Qemu-block] [PATCH v8 2/7] block: swap operation order in bdrv_append

2019-06-13 Thread Max Reitz
On 29.05.19 17:46, Vladimir Sementsov-Ogievskiy wrote: > bs_top parents may conflict with bs_new backing child permissions, so > let's do bdrv_replace_node first, it covers more possible cases. > > It is needed for further implementation of backup-top filter, which > don't want to share write

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

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
13.06.2019 1:09, Max Reitz wrote: > 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

Re: [Qemu-block] [PATCH v8 1/7] block: teach bdrv_debug_breakpoint skip filters with backing

2019-06-13 Thread Max Reitz
On 29.05.19 17:46, Vladimir Sementsov-Ogievskiy wrote: > Teach bdrv_debug_breakpoint and bdrv_debug_remove_breakpoint skip > filters with backing. This is needed to implement and use in backup job > it's own backup_top filter driver (like mirror already has one), and > without this improvement,

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

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
13.06.2019 1:09, Max Reitz wrote: > 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

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

2019-06-13 Thread Philippe Mathieu-Daudé
On 6/13/19 3:20 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 handling > -

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

2019-06-13 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > 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

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

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
13.06.2019 1:09, Max Reitz wrote: > 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

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

2019-06-13 Thread Philippe Mathieu-Daudé
Hi Pino, Please Cc the different maintainers (doing that for you). On 6/13/19 8:11 AM, 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

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

2019-06-13 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 08/42] block: bdrv_set_backing_hd() is about bs->backing

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
13.06.2019 1:09, Max Reitz wrote: > 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 Reviewed-by: Vladimir

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

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
13.06.2019 1:09, Max Reitz wrote: > 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

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

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
13.06.2019 15:33, Max Reitz wrote: > On 13.06.19 14:26, Vladimir Sementsov-Ogievskiy wrote: >> 13.06.2019 1:09, Max Reitz wrote: >>> Add some helper functions for skipping filters in a chain of block >>> nodes. >>> >>> Signed-off-by: Max Reitz >>> --- >>>include/block/block_int.h | 3 +++ >>>

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

2019-06-13 Thread Max Reitz
On 13.06.19 14:26, Vladimir Sementsov-Ogievskiy wrote: > 13.06.2019 1:09, Max Reitz wrote: >> 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

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

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
13.06.2019 1:09, Max Reitz wrote: > Signed-off-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy > --- > 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 > +++

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

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
13.06.2019 1:09, Max Reitz wrote: > 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

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

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
13.06.2019 1:09, Max Reitz wrote: > 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

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

2019-06-13 Thread Sam Eiderman
> On 13 Jun 2019, at 12:38, Gerd Hoffmann wrote: > > Hi, > >> Yes they are pretty rare. >> Windows 2000 and Windows XP guests migrated from VMware to Qemu/KVM >> would not boot due to incorrect disk geometries (some had 32/56 spt instead >> of >> 56. Also number of heads was not entirely

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

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
13.06.2019 1:09, Max Reitz wrote: > Signed-off-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy > --- > 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 > ---

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

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
13.06.2019 1:09, Max Reitz wrote: > 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.) > >

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

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
13.06.2019 1:09, Max Reitz wrote: > Signed-off-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy > --- > block/throttle.c | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/block/throttle.c b/block/throttle.c > index f64dcc27b9..de1b6bd7e8 100644 > ---

Re: [Qemu-block] [PATCH v2 6/7] iotests: amend QEMU NBD process synchronization

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
11.06.2019 21:02, Andrey Shinkevich wrote: > Processes are dying harder under the Valgring. It results in counting > the dying process as a newborn one. Make it sure that old NBD job get > finished before starting a new one. > > Suggested-by: Roman Kagan > Signed-off-by: Andrey Shinkevich > ---

Re: [Qemu-block] [PATCH v2 7/7] iotests: new file to suppress Valgrind errors

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
11.06.2019 21:02, Andrey Shinkevich wrote: > The Valgrind tool reports about an uninitialised memory usage when the > initialization is actually not needed. For example, the buffer 'buf' > instantiated on a stack of the function guess_disk_lchs(). for convinience, you may add: "of the function

Re: [Qemu-block] [PATCH v2 5/7] iotests: extend sleeping time under Valgrind

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
11.06.2019 21:02, Andrey Shinkevich wrote: > To synchronize the time when QEMU is running longer under the Valgrind, > increase the sleeping time int the test 247. in the test > > Signed-off-by: Andrey Shinkevich Reviewed-by: Vladimir Sementsov-Ogievskiy > --- > tests/qemu-iotests/247 | 6

Re: [Qemu-block] [PATCH v2 4/7] iotests: extended timeout under Valgrind

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
11.06.2019 21:02, Andrey Shinkevich wrote: > As the iotests run longer under the Valgrind, the QEMU_COMM_TIMEOUT is > to be increased in the test cases 028, 183 and 192 when running under > the Valgrind. > > Suggested-by: Roman Kagan > Signed-off-by: Andrey Shinkevich Reviewed-by: Vladimir

Re: [Qemu-block] [PATCH v2 3/7] iotests: Valgrind fails to work with nonexistent directory

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
11.06.2019 21:02, Andrey Shinkevich wrote: > The Valgrind uses the exported variable TMPDIR and fails if the > directory does not exist. Let us exclude such a test case from > being run under the Valgrind. > > Signed-off-by: Andrey Shinkevich Hmm, isn't it preferable to skip unsupported by

Re: [Qemu-block] [PATCH v2 2/7] iotests: exclude killed processes from running under Valgrind

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
11.06.2019 21:02, Andrey Shinkevich wrote: > The Valgrind tool fails to manage its termination when QEMU raises the > signal SIGKILL. Lets exclude such test cases from running under the > Valgrind because there is no sense to check memory issues that way. > > Signed-off-by: Andrey Shinkevich >

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

2019-06-13 Thread Gerd Hoffmann
Hi, > Yes they are pretty rare. > Windows 2000 and Windows XP guests migrated from VMware to Qemu/KVM > would not boot due to incorrect disk geometries (some had 32/56 spt instead of > 56. Also number of heads was not entirely correct) Ok. > > Why? Asking the user to deal with the mess is

Re: [Qemu-block] [PATCH v2 1/7] iotests: allow Valgrind checking all QEMU processes

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
11.06.2019 21:02, Andrey Shinkevich wrote: > With the '-valgrind' option, let all the QEMU processes be run under > the Valgrind tool. The Valgrind own parameters may be set with its > environment variable VALGRIND_OPTS, e.g. > VALGRIND_OPTS="--leak-check=yes" ./check -qcow2 -valgrind > or they

Re: [Qemu-block] [PATCH v2 1/7] iotests: allow Valgrind checking all QEMU processes

2019-06-13 Thread Vladimir Sementsov-Ogievskiy
11.06.2019 21:02, Andrey Shinkevich wrote: > With the '-valgrind' option, let all the QEMU processes be run under > the Valgrind tool. The Valgrind own parameters may be set with its > environment variable VALGRIND_OPTS, e.g. > VALGRIND_OPTS="--leak-check=yes" ./check -qcow2 -valgrind > or they

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

2019-06-13 Thread Sam Eiderman
typo: ddb.geometry.biosCylinders = “83257” * Sam > On 13 Jun 2019, at 10:41, Sam Eiderman wrote: > > > >> On 12 Jun 2019, at 22:18, Gerd Hoffmann > > wrote: >> >> On Wed, Jun 12, 2019 at 04:30:03PM +0300, Sam Eiderman wrote: >>> >>> On 12 Jun 2019, at 16:06,

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

2019-06-13 Thread Sam Eiderman
> On 12 Jun 2019, at 22:18, Gerd Hoffmann wrote: > > 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

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

2019-06-13 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