Re: [Qemu-devel] [PULL 52/53] char: Remove unwanted crlf conversion

2018-06-09 Thread Greg Kurz
On Fri, 8 Jun 2018 14:56:20 -0300 Philippe Mathieu-Daudé wrote: > On 06/08/2018 02:39 PM, Greg Kurz wrote: > > On Thu, 31 May 2018 19:16:05 +0200 > > Paolo Bonzini wrote: > > > >> From: Patryk Olszewski > >> > >> This patch fixes a bug in serial that made it almost impossible for guest > >>

Re: [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: [email protected] Subject: [Qemu-devel] [PATCH v4 0/6] NBD export === TEST SCRIPT BEGIN === #!/bin/bash # Testing script will be invoked under the git checkout w

[Qemu-devel] [PATCH v1 0/3] misc fixes found by static analyzer

2018-06-09 Thread Dima Stepanov
During the development process we used scan-build as static analyzer to check the changes. There are some issues found. The patch set below is to resolve issues found. Dima Stepanov (3): memfd: fix possible usage of the uninitialized file descriptor qcow2: fix the uninitialized bitmap_table va

[Qemu-devel] [PATCH v1 1/3] memfd: fix possible usage of the uninitialized file descriptor

2018-06-09 Thread Dima Stepanov
The qemu_memfd_alloc_check() routine allocates the fd variable on stack. This variable is initialized inside the qemu_memfd_alloc() function. There are several cases when *fd will be left unintialized which can lead to the unexpected close() in the qemu_memfd_free() call. Set file descriptor to -1

[Qemu-devel] [PATCH v1 2/3] qcow2: fix the uninitialized bitmap_table variable

2018-06-09 Thread Dima Stepanov
The free_bitmap_clusters() routine is using the bitmap_table_load() call to initialize the local bitmap_table variable. bitmap_table_load() doesn't initialize variable to NULL in case of error. As a result a following assert will be hit: assert(bitmap_table == NULL); Remove this assert, since th

[Qemu-devel] [PATCH v1 3/3] memory: fix possible NULL pointer dereference

2018-06-09 Thread Dima Stepanov
In the memory_region_do_invalidate_mmio_ptr() routine the section variable is intialized by the memory_region_find() call. The section.mr field can be set to NULL. Add the check for NULL before trying to drop a section. Signed-off-by: Dima Stepanov --- memory.c | 2 +- 1 file changed, 1 inserti

Re: [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 implementat

Re: [Qemu-devel] [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 ins

Re: [Qemu-devel] [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 deletions

Re: [Qemu-devel] [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 exhaus

Re: [Qemu-devel] [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 de

Re: [Qemu-devel] [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 deletions

[Qemu-devel] question: a dead loop in qemu when do blockJobAbort and vm suspend coinstantaneously

2018-06-09 Thread l00284672
Hi, I found a dead loop in qemu when do blockJobAbort and vm suspend coinstantaneously. The qemu bt is below: #0  0x7ff58b53af1f in ppoll () from /lib64/libc.so.6 #1  0x007fdbd9 in ppoll (__ss=0x0, __timeout=0x7ffcf7055390, __nfds=, __fds=) at /usr/include/bits/poll2.h:77 #2  qemu

Re: [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 + include/hw/misc/mac_via.h

Re: [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 introduce

Re: [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-devel] [PATCH v1 1/3] memfd: fix possible usage of the uninitialized file descriptor

2018-06-09 Thread Marc-André Lureau
On Sat, Jun 9, 2018 at 9:52 AM, Dima Stepanov wrote: > The qemu_memfd_alloc_check() routine allocates the fd variable on stack. > This variable is initialized inside the qemu_memfd_alloc() function. > There are several cases when *fd will be left unintialized which can > lead to the unexpected clo

Re: [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 deletion

Re: [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 ++ hw/m68k/m

Re: [Qemu-devel] [PULL 00/31] acpi, vhost, misc: fixes, features

2018-06-09 Thread Peter Maydell
On 8 June 2018 at 19:47, Philippe Mathieu-Daudé wrote: > On 06/08/2018 02:52 PM, Philippe Mathieu-Daudé wrote: >> So 'rm ${srcdir}/qemu-version.h ${srcdir}/qemu-options.def' fixed my >> problems. >> >> Should we add a check for this kind of mistakes when running out-of-tree >> builds? I'll try som

Re: [Qemu-devel] [PATCH] Makefile: Remove qemu-version.h and qemu-options.def during 'make distclean'

2018-06-09 Thread Peter Maydell
On 8 June 2018 at 19:58, Philippe Mathieu-Daudé wrote: > qemu-version.h and qemu-options.def are generated files > that should be deleted during 'make distclean'. These are both in GENERATED_FILES, and 'make distclean' invokes 'make clean' which does an rm of all GENERATED_FILES. Why isn't that s

Re: [Qemu-devel] [Qemu-ppc] icbt on PPC440 after commit 01662f3e

2018-06-09 Thread BALATON Zoltan
On Sat, 2 Jun 2018, BALATON Zoltan wrote: I get an invalid instruction exception for the icbt instruction on the sam460ex machine (PPC440 core 460EX CPU) but I think this should not raise exception as it's valid on BookE that this CPU should support. Commit 01662f3e PPC: Implement e500 (FSL) MM

[Qemu-devel] [PATCH 0/2] ARM virt: Silence dtc warnings

2018-06-09 Thread Eric Auger
When running dtc on the guest /proc/device-tree, we get the following warnings: "Warning (unit_address_vs_reg): Node has a reg or ranges property, but no unit name", with name: /intc, /intc/its, /intc/v2m, /memory. This series removes those warnings by adding the unit address to the corresponding

[Qemu-devel] [PATCH 2/2] hw/arm/virt: Silence dtc /memory warning

2018-06-09 Thread Eric Auger
When running dtc on the guest /proc/device-tree we get the following warning: Warning (unit_address_vs_reg): Node /memory has a reg or ranges property, but no unit name". Let's fix that by adding the unit address to the node name. We also don't create the /memory node anymore in create_fdt(). We d

[Qemu-devel] [PATCH 1/2] hw/arm/virt: Silence dtc /intc warnings

2018-06-09 Thread Eric Auger
When running dtc on the guest /proc/device-tree we get the following warnings: "Warning (unit_address_vs_reg): Node has a reg or ranges property, but no unit name", with name: /intc, /intc/its, /intc/v2m. Nodes should have a name in the form [@] where unit-address is the primary address used to a

Re: [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 non

Re: [Qemu-devel] [Qemu-arm] [PATCH 2/2] hw/arm/virt: Silence dtc /memory warning

2018-06-09 Thread Philippe Mathieu-Daudé
Hi Eric, On 06/09/2018 11:23 AM, Eric Auger wrote: > When running dtc on the guest /proc/device-tree we get the > following warning: Warning (unit_address_vs_reg): Node /memory > has a reg or ranges property, but no unit name". > > Let's fix that by adding the unit address to the node name. We al

Re: [Qemu-devel] [PATCH v1 2/3] qcow2: fix the uninitialized bitmap_table variable

2018-06-09 Thread Philippe Mathieu-Daudé
Hi Dima, On 06/09/2018 04:52 AM, Dima Stepanov wrote: > The free_bitmap_clusters() routine is using the bitmap_table_load() call > to initialize the local bitmap_table variable. bitmap_table_load() > doesn't initialize variable to NULL in case of error. As a result a > following assert will be hit

Re: [Qemu-devel] [Qemu-ppc] icbt on PPC440 after commit 01662f3e

2018-06-09 Thread Philippe Mathieu-Daudé
Cc'ing Richard On 06/09/2018 09:07 AM, BALATON Zoltan wrote: > On Sat, 2 Jun 2018, BALATON Zoltan wrote: >> I get an invalid instruction exception for the icbt instruction on the >> sam460ex machine (PPC440 core 460EX CPU) but I think this should not >> raise exception as it's valid on BookE that

[Qemu-devel] [PATCH v2] Makefile: Check for more dangling scratch files in out-of-tree builds

2018-06-09 Thread Philippe Mathieu-Daudé
It is easy to catch the generated 'config-host.mak' in the source tree, however qemu-version.h and qemu-options.def are also generated files and are hidden by .gitignore rules. Improve the out-of-tree safety net rule added in d1bd2423a90, by also checking for these two files. This solves building

[Qemu-devel] [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 +++ b/qapi/block.

[Qemu-devel] [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 b/d

[Qemu-devel] [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-devel] [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-devel] [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 9e1f2271

[Qemu-devel] [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, howev

[Qemu-devel] [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-devel] [PATCH] migration: invalidate cache before source start

2018-06-09 Thread Vladimir Sementsov-Ogievskiy
Invalidate cache before source start in case of failed migration. Signed-off-by: Vladimir Sementsov-Ogievskiy --- migration/migration.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index 1e99ec9b7e..8f39e0dc02 100644 -

[Qemu-devel] [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-devel] [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 --- a/

[Qemu-devel] [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. Signe

[Qemu-devel] [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 reque

[Qemu-devel] [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 nanoseconds

[Qemu-devel] [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 operations

[Qemu-devel] [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 --- a

[Qemu-devel] [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-devel] [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 a/block/nbd-client.

[Qemu-devel] [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 curre

[Qemu-devel] [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 + tests

[Qemu-devel] [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: r

Re: [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 s

[Qemu-devel] [PATCH] loader: implement START_SEG_ADDR_RECORD

2018-06-09 Thread Stefan Hajnoczi
It turns out that GNU binutils emits START_SEG_ADDR_RECORD when the start address is within the first megabyte (< 0x10). Therefore we must handle this record type. Originally we thought this record type was x86-specific, but binutils also emits it on non-x86 architectures. Based-on: <1527161

Re: [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 debian-ins

Re: [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 d

Re: [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-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-devel] [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 Semen

Re: [Qemu-devel] [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-devel] [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"' \ > | x86_64-softmmu/qemu-system-

[Qemu-devel] [PATCH v2 000/108] linux-user: Split do_syscall

2018-06-09 Thread Richard Henderson
* Changed the table into a switch, for the reason documented. Use macros to actually enter the syscall into the switch. * Finish the split. * Fix some bugs along the way. I know it's a huge patch set, but I guess it was always going to be in order to finish -- it was a stupidly large function.

[Qemu-devel] [PATCH v2 007/108] linux-user: Propagate goto fail to return

2018-06-09 Thread Richard Henderson
Reviewed-by: Laurent Vivier Signed-off-by: Richard Henderson --- linux-user/syscall.c | 60 1 file changed, 22 insertions(+), 38 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 5a17803732..fd8d48b0da 100644 --- a/linux-use

[Qemu-devel] [PATCH v2 005/108] linux-user: Propagate goto unimplemented_nowarn to return

2018-06-09 Thread Richard Henderson
Reviewed-by: Laurent Vivier Signed-off-by: Richard Henderson --- linux-user/syscall.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index a6b8268332..06205d3d65 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscal

[Qemu-devel] [PATCH v2 001/108] linux-user: Remove DEBUG

2018-06-09 Thread Richard Henderson
This is redundant with both -strace and actual tracing. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 7b9ac3b408..c212149245 100644 --- a/linux-user/syscall.c +++ b/linux-

[Qemu-devel] [PATCH v2 002/108] linux-user: Split out do_syscall1

2018-06-09 Thread Richard Henderson
There was supposed to be a single point of return for do_syscall so that tracing works properly. However, there are a few bugs in that area. It is significantly simpler to simply split out an inner function to enforce this. Reviewed-by: Laurent Vivier Signed-off-by: Richard Henderson --- linu

[Qemu-devel] [PATCH v2 009/108] linux-user: Set up infrastructure for table-izing syscalls

2018-06-09 Thread Richard Henderson
At the same time, split out set_robust_list and get_robust_list. Put them together, along with their block comment, at the top of syscall_table. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 87 +--- 1 file changed, 66 insertions(+), 21 delet

[Qemu-devel] [PATCH v2 008/108] linux-user: Make syscall number unsigned

2018-06-09 Thread Richard Henderson
Reviewed-by: Laurent Vivier Signed-off-by: Richard Henderson --- linux-user/qemu.h| 2 +- linux-user/syscall.c | 16 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 6fa1e968db..c628a5a05c 100644 --- a/linux-user/qem

[Qemu-devel] [PATCH v2 006/108] linux-user: Propagate goto unimplemented to default

2018-06-09 Thread Richard Henderson
There is no point in listing a syscall if you want the same effect as not listing it. In one less trivial case, the goto was demonstrably not reachable. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 144 +-- 1 file changed, 1 insertion(+), 1

[Qemu-devel] [PATCH v2 010/108] linux-user: Split out brk, close, exit, read, write

2018-06-09 Thread Richard Henderson
These are relatively simple unconditionally defined syscalls. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 179 --- 1 file changed, 102 insertions(+), 77 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 8678e749ee

[Qemu-devel] [PATCH v2 004/108] linux-user: Propagate goto efault to return

2018-06-09 Thread Richard Henderson
Reviewed-by: Laurent Vivier Signed-off-by: Richard Henderson --- linux-user/syscall.c | 341 ++- 1 file changed, 175 insertions(+), 166 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index efe882612b..a6b8268332 100644 --- a/linux-u

[Qemu-devel] [PATCH v2 003/108] linux-user: Relax single exit from "break"

2018-06-09 Thread Richard Henderson
Transform outermost "break" to "return ret". If the immediately preceeding statement was an assignment to ret, return the value directly. Reviewed-by: Laurent Vivier Signed-off-by: Richard Henderson --- linux-user/syscall.c | 970 +-- 1 file changed, 390

[Qemu-devel] [PATCH v2 013/108] linux-user: Split out name_to_handle_at

2018-06-09 Thread Richard Henderson
At the same time, merge do_name_to_handle_at into the new function. All targets define this syscall; remove one of the two ifdefs. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 116 +-- 1 file changed, 58 insertions(+), 58 deletions(-) diff

[Qemu-devel] [PATCH v2 018/108] linux-user: Split out chdir, mknod, mknodat, time, chmod

2018-06-09 Thread Richard Henderson
All targets define mknodat; remove the ifdef. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 121 --- 1 file changed, 79 insertions(+), 42 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index e1b3c7e827..d32034ce38 1006

[Qemu-devel] [PATCH v2 014/108] linux-user: Split out open_to_handle_at

2018-06-09 Thread Richard Henderson
At the same time, merge do_open_to_handle_at into the new function. All targets define this syscall; remove one of the two ifdefs. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 79 ++-- 1 file changed, 39 insertions(+), 40 deletions(-) diff

[Qemu-devel] [PATCH v2 017/108] linux-user: Split out unlink, unlinkat

2018-06-09 Thread Richard Henderson
All targets define unlinkat; remove the ifdef. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 48 +--- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 936c7a7484..e1b3c7e827 100

[Qemu-devel] [PATCH v2 011/108] linux-user: Split out execve

2018-06-09 Thread Richard Henderson
At the same time, fix the repeated re-reading of the argv and env arrays from guest memory. Instead read into a unified array once. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 203 ++- 1 file changed, 106 insertions(+), 97 deletions(-) di

[Qemu-devel] [PATCH v2 015/108] linux-user: Split out creat, fork, waitid, waitpid

2018-06-09 Thread Richard Henderson
All targets define waitid; remove the ifdef. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 104 +++ 1 file changed, 65 insertions(+), 39 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f51cc7e937..a146b696fd 10064

[Qemu-devel] [PATCH v2 023/108] linux-user: Split out rename, renameat, renameat2

2018-06-09 Thread Richard Henderson
All targets define renameat2; remove the ifdefs. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 101 +++ 1 file changed, 53 insertions(+), 48 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 6729a960ea..e0a5d86956 1

[Qemu-devel] [PATCH v2 022/108] linux-user: Split out access, faccessat, futimesat, kill, nice, sync, syncfs

2018-06-09 Thread Richard Henderson
All targets define faccessat and syncfs; remove the ifdefs. Fix the missing flags parameter to faccessat. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 143 +++ 1 file changed, 91 insertions(+), 52 deletions(-) diff --git a/linux-user/syscal

[Qemu-devel] [PATCH v2 012/108] linux-user: Split out open, openat

2018-06-09 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/syscall.c | 58 +--- 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index aa6c4e1577..a4d0f2720f 100644 --- a/linux-user/syscall.c +++ b/linux-user/

[Qemu-devel] [PATCH v2 024/108] linux-user: Split out dup, mkdir, mkdirat, rmdir

2018-06-09 Thread Richard Henderson
All targets define mkdirat; remove the ifdef. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 90 +--- 1 file changed, 60 insertions(+), 30 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index e0a5d86956..f22d45d2cb 1006

[Qemu-devel] [PATCH v2 021/108] linux-user: Split out alarm, pause, stime, utime, utimes

2018-06-09 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/syscall.c | 155 ++- 1 file changed, 93 insertions(+), 62 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 844e771488..d5f7519e62 100644 --- a/linux-user/syscall.c +++ b/linux-user/

[Qemu-devel] [PATCH v2 025/108] linux-user: Split out acct, pipe, pipe2, times, umount2

2018-06-09 Thread Richard Henderson
All targets define pipe2 and umount2; remove the ifdefs. Merge do_pipe2 into its only user. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 148 +-- 1 file changed, 88 insertions(+), 60 deletions(-) diff --git a/linux-user/syscall.c b/linux-us

[Qemu-devel] [PATCH v2 016/108] linux-user: Split out link, linkat

2018-06-09 Thread Richard Henderson
All targets define linkat; remove the ifdef. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 66 +++- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index a146b696fd..936c7a7484 10064

[Qemu-devel] [PATCH v2 030/108] linux-user: Split out rt_sigprocmask, sgetmask, sigprocmask, ssetmask

2018-06-09 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/syscall.c | 294 +++ 1 file changed, 158 insertions(+), 136 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index cdb4dd5bb4..cc818ea65e 100644 --- a/linux-user/syscall.c +++ b/linux-use

[Qemu-devel] [PATCH v2 026/108] linux-user: Split out ioctl

2018-06-09 Thread Richard Henderson
At the same time, merge do_ioctl into the new function. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 184 ++- 1 file changed, 94 insertions(+), 90 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 81e142f091..ebe57

[Qemu-devel] [PATCH v2 027/108] linux-user: Split out chroot, dup2, dup3, fcntl, setpgid, umask

2018-06-09 Thread Richard Henderson
All targets define dup3; remove the ifdef. If !CONFIG_DUP3, fall back to dup2 when flags == 0. This will help emulation of new targets that do not define the dup2 syscall, using dup3 as the syscall backing the dup2 posix function. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 113

[Qemu-devel] [PATCH v2 019/108] linux-user: Split out getpid, getxpid, lseek

2018-06-09 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/syscall.c | 39 +++ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index d32034ce38..3d3983a504 100644 --- a/linux-user/syscall.c +++ b/linux-user/sysca

[Qemu-devel] [PATCH v2 033/108] linux-user: Split out rt_sigreturn, sethostname, setrlimit, sigreturn

2018-06-09 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/syscall.c | 85 +++- 1 file changed, 52 insertions(+), 33 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 94dc773b4c..ac3592d776 100644 --- a/linux-user/syscall.c +++ b/linux-user/

[Qemu-devel] [PATCH v2 037/108] linux-user: Split out readlink, readlinkat

2018-06-09 Thread Richard Henderson
All targets define readlinkat; remove the ifdef. Unify the two with do_readlinkat so that we do not replicate the /proc/self/exe handling. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 96 1 file changed, 43 insertions(+), 53 deletions(-

[Qemu-devel] [PATCH v2 036/108] linux-user: Split out symlink, symlinkat

2018-06-09 Thread Richard Henderson
All targets define symlinkat; remove the ifdef. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 64 +++- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 326323e377..39d8a70d7d 10

[Qemu-devel] [PATCH v2 020/108] linux-user: Split out mount, umount

2018-06-09 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/syscall.c | 118 --- 1 file changed, 55 insertions(+), 63 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 3d3983a504..844e771488 100644 --- a/linux-user/syscall.c +++ b/linux-user/

[Qemu-devel] [PATCH v2 038/108] linux-user: Split out mmap, mmap2, reboot, swapon

2018-06-09 Thread Richard Henderson
All targets define swapon; remove the ifdef. Add a comment noting the incorrect implementation of mmap2. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 142 --- 1 file changed, 81 insertions(+), 61 deletions(-) diff --git a/linux-user/syscall

[Qemu-devel] [PATCH v2 035/108] linux-user: Split out select, pselect6, newselect

2018-06-09 Thread Richard Henderson
All targets define pselect6; remove the ifdef. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 251 ++- 1 file changed, 130 insertions(+), 121 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 4c5292efed..326323e377 1

[Qemu-devel] [PATCH v2 034/108] linux-user: Split out getrlimit, getrusage, gettimeofday, settimeofday

2018-06-09 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/syscall.c | 117 ++- 1 file changed, 61 insertions(+), 56 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index ac3592d776..4c5292efed 100644 --- a/linux-user/syscall.c +++ b/linux-user/

[Qemu-devel] [PATCH v2 041/108] linux-user: Split out fchmod, fchmodat, ftruncate, truncate

2018-06-09 Thread Richard Henderson
All targets define fchmodat; remove the ifdef. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 58 ++-- 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f79aebe869..df8422cd3a 100

[Qemu-devel] [PATCH v2 028/108] linux-user: Split out getpgrp, getppid, setsid

2018-06-09 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/syscall.c | 36 ++-- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 8e13a16e91..d78288258a 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.

[Qemu-devel] [PATCH v2 039/108] linux-user: Split out mprotect, mremap, msync, munmap

2018-06-09 Thread Richard Henderson
All targets define all of these; remove the ifdefs. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 61 ++-- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index a3374955da..7504ad74b

[Qemu-devel] [PATCH v2 040/108] linux-user: Split out mlock, mlockall, munlock, munlockall

2018-06-09 Thread Richard Henderson
All targets define all of these; remove the ifdefs. Merge target_to_host_mlockall_arg into its only caller. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 62 ++-- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/linux-user/sysc

[Qemu-devel] [PATCH v2 029/108] linux-user: Split out rt_sigaction, sigaction

2018-06-09 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/syscall.c | 325 ++- 1 file changed, 165 insertions(+), 160 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index d78288258a..cdb4dd5bb4 100644 --- a/linux-user/syscall.c +++ b/linux-use

[Qemu-devel] [PATCH v2 043/108] linux-user: Split out getpriority, setpriority

2018-06-09 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/syscall.c | 46 +++- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 86583988c4..6d8d2eb780 100644 --- a/linux-user/syscall.c +++ b/linux-user/

  1   2   >