Re: [Qemu-block] [PATCH v2 0/3] qcow2: Do not mark inactive images corrupt

2018-06-09 Thread Max Reitz
On 2018-06-06 21:36, Max Reitz wrote: > The non-public logs in > https://bugzilla.redhat.com/show_bug.cgi?id=1583346 (sorry...) reveal > this problem: > > $ (Create a qcow2 file "foo.qcow2" with a corrupted first L1 entry) > $ echo 'qemu-io none0 "read 0 512"' \ > |

Re: [Qemu-block] [PATCH] throttle: Fix crash on reopen

2018-06-09 Thread Max Reitz
On 2018-06-08 17:15, Alberto Garcia wrote: > The throttle block filter can be reopened, and with this it is > possible to change the throttle group that the filter belongs to. > > The way the code does that is the following: > > - On throttle_reopen_prepare(): create a new ThrottleGroupMember

Re: [Qemu-block] [PATCH] block/qcow2-bitmap: fix free_bitmap_clusters

2018-06-09 Thread Max Reitz
On 2018-06-08 12:12, Vladimir Sementsov-Ogievskiy wrote: > This assert may fail, because bitmap_table is not initialized. Just > drop it, as it's obvious, that bitmap_table_load sets bitmap_table > parameter only when returning zero. > > Reported-by: Pavel Butsykin > Signed-off-by: Vladimir

Re: [Qemu-block] [Qemu-devel] storing machine data in qcow images?

2018-06-09 Thread Max Reitz
On 2018-06-07 23:43, Michael S. Tsirkin wrote: > On Wed, Jun 06, 2018 at 07:06:27PM +0200, Max Reitz wrote: [...] >> Er, yeah, OK. But it was my understanding that we decided that we have >> a management layer on top of qemu to make things simple. > > Who's we? Everyone I'm usually talking to

Re: [Qemu-block] [Qemu-devel] [RFC 12/13] dp8393x: put DMA temp buffer in the state, not in the stack

2018-06-09 Thread Thomas Huth
On 08.06.2018 22:05, Laurent Vivier wrote: > It's only 32 bytes, and this simplifies the dp8393x_get()/ > dp8393x_put() interface. Maybe not worth the effort ... or do you need this in a later patch, too? If so, please mention it in the patch description here. > Signed-off-by: Laurent Vivier >

Re: [Qemu-block] [Qemu-devel] [RFC 11/13] dp8393x: manage big endian bus

2018-06-09 Thread Thomas Huth
On 08.06.2018 22:05, Laurent Vivier wrote: > This is needed by Quadra 800, this card can run on little-endian > or big-endian bus. > > Signed-off-by: Laurent Vivier > --- > hw/net/dp8393x.c | 101 > ++- > 1 file changed, 70 insertions(+), 31

Re: [Qemu-block] [Qemu-devel] [RFC 00/13] hw/m68k: add Apple Machintosh Quadra 800 machine

2018-06-09 Thread Thomas Huth
On 09.06.2018 16:25, Philippe Mathieu-Daudé wrote: > Hi Laurent, > > On 06/08/2018 05:05 PM, Laurent Vivier wrote: >> if you want to test the machine, I'm sorry, it doesn't boot >> a MacROM, but you can boot a linux kernel from the command line. >> >> You can install your own disk using

[Qemu-block] [PATCH v3 06/11] block/nbd-client: move from quit to state

2018-06-09 Thread Vladimir Sementsov-Ogievskiy
To implement reconnect we need several states for the client: CONNECTED, QUIT and several CONNECTING states. CONNECTING states will be realized in the following patches. This patch implements CONNECTED and QUIT. QUIT means, that we should close the connection and fail all current and further

[Qemu-block] [PATCH v5 3/6] nbd/server: add nbd_meta_empty_or_pattern helper

2018-06-09 Thread Vladimir Sementsov-Ogievskiy
Add nbd_meta_pattern() and nbd_meta_empty_or_pattern() helpers for metadata query parsing. nbd_meta_pattern() will be reused for "qemu" namespace in following patches. Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/server.c | 86 +---

[Qemu-block] [PATCH v3 03/11] block/nbd-client: split connection from initialization

2018-06-09 Thread Vladimir Sementsov-Ogievskiy
Split connection code to reuse it for reconnect. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 29 + 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/block/nbd-client.c b/block/nbd-client.c index 6ff505c4b8..14b42f31df 100644 ---

[Qemu-block] [PATCH v5 2/6] nbd/server: refactor NBDExportMetaContexts

2018-06-09 Thread Vladimir Sementsov-Ogievskiy
Use NBDExport pointer instead of just export name: there no needs to store duplicated name in the struct, moreover, NBDExport will be used further. Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/server.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff

[Qemu-block] [PATCH v3 01/11] block/nbd-client: split channel errors from export errors

2018-06-09 Thread Vladimir Sementsov-Ogievskiy
To implement nbd reconnect in further patches, we need to distinguish error codes, returned by nbd server, from channel errors, to reconnect only in the latter case. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 83 +++--- 1

[Qemu-block] [PATCH v5 1/6] nbd/server: fix trace

2018-06-09 Thread Vladimir Sementsov-Ogievskiy
Return code = 1 doesn't mean that we parsed base:allocation. Use correct traces in both -parsed and -skipped cases. Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/server.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index

[Qemu-block] [PATCH v3 07/11] block/nbd-client: rename read_reply_co to connection_co

2018-06-09 Thread Vladimir Sementsov-Ogievskiy
This coroutine will serve nbd reconnects, so, rename it to be something more generic. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.h | 4 ++-- block/nbd-client.c | 24 2 files changed, 14 insertions(+), 14 deletions(-) diff --git

[Qemu-block] [PATCH v3 05/11] block/nbd-client: don't check ioc

2018-06-09 Thread Vladimir Sementsov-Ogievskiy
We have several paranoiac checks for ioc != NULL. But ioc may become NULL only on close, which should not happen during requests handling. Also, we check ioc only sometimes, not after each yield, which is inconsistent. Let's drop these checks. However, for safety, lets leave asserts instead.

[Qemu-block] [PATCH v3 04/11] block/nbd-client: fix nbd_reply_chunk_iter_receive

2018-06-09 Thread Vladimir Sementsov-Ogievskiy
Use exported report, not the variable to be reused (should not really matter). Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/nbd-client.c b/block/nbd-client.c index 14b42f31df..dd712c59b3 100644 ---

[Qemu-block] [PATCH v3 10/11] block/nbd-client: nbd reconnect

2018-06-09 Thread Vladimir Sementsov-Ogievskiy
Implement reconnect. To achieve this: 1. Move from quit bool variable to state. 4 states are introduced: connecting-wait: means, that reconnecting is in progress, and there were small number of reconnect attempts, so all requests are waiting for the connection. connecting-nowait:

[Qemu-block] [PATCH v3 00/11] NBD reconnect

2018-06-09 Thread Vladimir Sementsov-Ogievskiy
Hi all. Here is NBD reconnect. The feature realized inside nbd-client driver and works as follows: There are two parameters: reconnect-attempts and reconnect-timeout. So, we will try to reconnect in case of initial connection failed or in case of connection lost. All current and new io

[Qemu-block] [PATCH v3 08/11] block/nbd-client: move connecting to connection_co

2018-06-09 Thread Vladimir Sementsov-Ogievskiy
As a first step to nbd reconnect, move connection to connection_co coroutine. The key point in this patch is nbd_client_attach_aio_context() change: We schedule to connection_co only if it is waiting for read from the channel. We should not schedule it if it is some other yield, and if it is

[Qemu-block] [PATCH v5 4/6] nbd/server: implement dirty bitmap export

2018-06-09 Thread Vladimir Sementsov-Ogievskiy
Handle new NBD meta namespace: "qemu", and corresponding queries: "qemu:dirty-bitmap:". With new metadata context negotiated, BLOCK_STATUS query will reply with dirty-bitmap data, converted to extents. New public function nbd_export_bitmap selects bitmap to export. For now, only one bitmap may be

[Qemu-block] [PATCH v3 02/11] block/nbd: move connection code from block/nbd to block/nbd-client

2018-06-09 Thread Vladimir Sementsov-Ogievskiy
Keep all connection code in one file, to be able to implement reconnect in further patches. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.h | 2 +- block/nbd-client.c | 37 +++-- block/nbd.c| 41

[Qemu-block] [PATCH v5 6/6] docs/interop: add nbd.txt

2018-06-09 Thread Vladimir Sementsov-Ogievskiy
Describe new metadata namespace: "qemu". Signed-off-by: Vladimir Sementsov-Ogievskiy --- docs/interop/nbd.txt | 37 + MAINTAINERS | 1 + 2 files changed, 38 insertions(+) create mode 100644 docs/interop/nbd.txt diff --git a/docs/interop/nbd.txt

[Qemu-block] [PATCH v5 5/6] qapi: new qmp command nbd-server-add-bitmap

2018-06-09 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/block.json | 23 +++ blockdev-nbd.c | 23 +++ 2 files changed, 46 insertions(+) diff --git a/qapi/block.json b/qapi/block.json index c694524002..ddbca2e286 100644 --- a/qapi/block.json +++

[Qemu-block] [PATCH v3 09/11] block/nbd: add cmdline and qapi parameters for nbd reconnect

2018-06-09 Thread Vladimir Sementsov-Ogievskiy
Add two parameters: reconnect-attempts, which defines maximum number of reconnects, after which: - open will fail - block operations will fail Note: on open, we actually have reconnect-attempts+1 connection attempts, the first one is not REconnect. reconnect-timeout, timeout in

[Qemu-block] [PATCH v3 11/11] iotests: test nbd reconnect

2018-06-09 Thread Vladimir Sementsov-Ogievskiy
Add test, which starts backup to nbd target and restarts nbd server during backup. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/220| 68 +++ tests/qemu-iotests/220.out| 7 + tests/qemu-iotests/group | 1 +

[Qemu-block] [PATCH v5 0/6] NBD export bitmaps

2018-06-09 Thread Vladimir Sementsov-Ogievskiy
Hi all. This is a proposal and realization of new NBD meta context: qemu. New possible queries will look like: qemu:dirty-bitmap: Mapping from export-bitmap-name to BdrvDirtyBitmap is done through qmp command nbd-server-add-bitmap. For now, only one bitmap export is allowed per NBD export,

Re: [Qemu-block] [Qemu-devel] [RFC 01/13] hw/m68k: add via support

2018-06-09 Thread Mark Cave-Ayland
On 09/06/18 11:01, Mark Cave-Ayland wrote: Yeah, we can certainly remove a huge chunk of this by converting over to the mos6522 device. My last set of updates to CUDA a couple of days ago are probably the best reference, but I can probably find some time to do the basic conversion for you at

Re: [Qemu-block] [Qemu-devel] [RFC 00/13] hw/m68k: add Apple Machintosh Quadra 800 machine

2018-06-09 Thread Philippe Mathieu-Daudé
Hi Laurent, On 06/08/2018 05:05 PM, Laurent Vivier wrote: > if you want to test the machine, I'm sorry, it doesn't boot > a MacROM, but you can boot a linux kernel from the command line. > > You can install your own disk using debian-installer, with: > > ... > -M q800 \ > -serial

Re: [Qemu-block] [Qemu-devel] [RFC 09/13] hw/m68k: define Macintosh Quadra 800

2018-06-09 Thread Mark Cave-Ayland
On 08/06/18 21:05, Laurent Vivier wrote: From: Laurent Vivier Signed-off-by: Laurent Vivier --- default-configs/m68k-softmmu.mak | 12 ++ hw/display/macfb.c | 31 ++-- hw/m68k/Makefile.objs| 6 +- hw/m68k/bootinfo.h | 99 ++

Re: [Qemu-block] [Qemu-devel] [RFC 06/13] ESP: add pseudo-DMA as used by Macintosh

2018-06-09 Thread Mark Cave-Ayland
On 08/06/18 21:05, Laurent Vivier wrote: From: Laurent Vivier Signed-off-by: Laurent Vivier --- hw/mips/mips_jazz.c | 2 +- hw/scsi/esp.c | 330 +- include/hw/scsi/esp.h | 15 ++- 3 files changed, 313 insertions(+), 34

Re: [Qemu-block] [Qemu-devel] [RFC 04/13] hw/m68k: add video card

2018-06-09 Thread Mark Cave-Ayland
On 08/06/18 21:05, Laurent Vivier wrote: From: Laurent Vivier Signed-off-by: Laurent Vivier --- arch_init.c | 4 + hw/display/Makefile.objs| 1 + hw/display/macfb-template.h | 158 + hw/display/macfb.c | 283

Re: [Qemu-block] [Qemu-devel] [RFC 03/13] escc: introduce a selector for the register bit

2018-06-09 Thread Mark Cave-Ayland
On 08/06/18 21:05, Laurent Vivier wrote: From: Laurent Vivier On Sparc and PowerMac, the bit 0 of the address selects the register type (control or data) and bit 1 selects the channel (B or A). On m68k Macintosh, the bit 0 selects the channel and bit 1 the register type. This patch

Re: [Qemu-block] [Qemu-devel] [RFC 01/13] hw/m68k: add via support

2018-06-09 Thread Mark Cave-Ayland
On 08/06/18 21:05, Laurent Vivier wrote: Signed-off-by: Laurent Vivier --- hw/input/adb.c| 99 - hw/misc/Makefile.objs | 1 + hw/misc/mac_via.c | 940 ++ include/hw/input/adb.h| 8 +

Re: [Qemu-block] [RFC 06/13] ESP: add pseudo-DMA as used by Macintosh

2018-06-09 Thread Hervé Poussineau
Le 08/06/2018 à 22:05, Laurent Vivier a écrit : From: Laurent Vivier Signed-off-by: Laurent Vivier --- hw/mips/mips_jazz.c | 2 +- hw/scsi/esp.c | 330 +- include/hw/scsi/esp.h | 15 ++- 3 files changed, 313 insertions(+), 34

Re: [Qemu-block] [RFC 12/13] dp8393x: put DMA temp buffer in the state, not in the stack

2018-06-09 Thread Hervé Poussineau
Le 08/06/2018 à 22:05, Laurent Vivier a écrit : It's only 32 bytes, and this simplifies the dp8393x_get()/ dp8393x_put() interface. Signed-off-by: Laurent Vivier --- hw/net/dp8393x.c | 107 ++- 1 file changed, 51 insertions(+), 56

Re: [Qemu-block] [RFC 11/13] dp8393x: manage big endian bus

2018-06-09 Thread Hervé Poussineau
Le 08/06/2018 à 22:05, Laurent Vivier a écrit : This is needed by Quadra 800, this card can run on little-endian or big-endian bus. Signed-off-by: Laurent Vivier --- hw/net/dp8393x.c | 101 ++- 1 file changed, 70 insertions(+), 31

Re: [Qemu-block] [RFC 13/13] dp8393x: fix receiving buffer exhaustion

2018-06-09 Thread Hervé Poussineau
Le 08/06/2018 à 22:05, Laurent Vivier a écrit : The card is not able to exit from exhaustion state, because while the drive consumes the buffers, the RRP is incremented (when the driver clears the ISR RBE bit), so it stays equal to RWP, and while RRP == RWP, the card thinks it is always in

Re: [Qemu-block] [RFC 10/13] dp8393x: fix dp8393x_receive

2018-06-09 Thread Hervé Poussineau
Le 08/06/2018 à 22:05, Laurent Vivier a écrit : address_space_rw() access size must be multiplied by width. dp8393x_receive() must return the number of bytes read, not the length of the last memory access. Signed-off-by: Laurent Vivier --- hw/net/dp8393x.c | 8 +--- 1 file changed, 5

Re: [Qemu-block] [Qemu-devel] [RFC 00/13] hw/m68k: add Apple Machintosh Quadra 800 machine

2018-06-09 Thread Laurent Vivier
Le 09/06/2018 à 05:26, Philippe Mathieu-Daudé a écrit : > On 06/08/2018 05:05 PM, Laurent Vivier wrote: >> I'm rebasing some of these patches for seven years now, >> too many years... >> >> It's an RFC because things have changed in QEMU in seven years, >> for instance the VIA has a new

Re: [Qemu-block] [Qemu-devel] [PATCH v4 0/6] NBD export

2018-06-09 Thread no-reply
Hi, This series failed build test on s390x host. Please find the details below. Type: series Message-id: 20180608152353.98712-1-vsement...@virtuozzo.com Subject: [Qemu-devel] [PATCH v4 0/6] NBD export === TEST SCRIPT BEGIN === #!/bin/bash # Testing script will be invoked under the git checkout