Re: [PATCH for-5.0 v2 1/3] block-backend: Reorder flush/pdiscard function definitions

2020-04-06 Thread Vladimir Sementsov-Ogievskiy
06.04.2020 20:14, Kevin Wolf wrote: Move all variants of the flush/pdiscard functions to a single place and put the blk_co_*() version first because it is called by all other variants (and will become static in the next patch). Signed-off-by: Kevin Wolf Reviewed-by: Vladimir

Re: [PATCH for-5.0] xen-block: Fix uninitialized variable

2020-04-06 Thread Markus Armbruster
Anthony PERARD writes: > On Mon, Apr 06, 2020 at 06:50:41PM +0200, Philippe Mathieu-Daudé wrote: >> On 4/6/20 6:42 PM, Anthony PERARD wrote: >> > Since 7f5d9b206d1e ("object-add: don't create return value if >> > failed"), qmp_object_add() don't write any value in 'ret_data', thus >> > has

Re: qcow2: Zero-initialization of external data files

2020-04-06 Thread Eric Blake
On 2/17/20 10:56 AM, Max Reitz wrote: Hi, AFAIU, external data files with data_file_raw=on are supposed to return the same data as the qcow2 file when read. But we still use the qcow2 metadata structures (which are by default initialized to “everything unallocated”), even though we never

Re: [PATCH v4 0/3] Fix some AIO context locking in jobs

2020-04-06 Thread John Snow
On 4/2/20 8:48 AM, Kevin Wolf wrote: > Am 01.04.2020 um 10:15 hat Stefan Reiter geschrieben: >> Contains three seperate but related patches cleaning up and fixing some >> issues regarding aio_context_acquire/aio_context_release for jobs. Mostly >> affects blockjobs running for devices that have

Re: [PATCH for-5.0? v2] qcow2: Explicit mention of padding bytes

2020-04-06 Thread Vladimir Sementsov-Ogievskiy
06.04.2020 16:32, Eric Blake wrote: On 4/6/20 3:50 AM, Vladimir Sementsov-Ogievskiy wrote: 03.04.2020 21:19, Eric Blake wrote: Although we already covered the need for padding bytes with our changes in commit 3ae3fcfa, commit 66fcbca5 just added one byte and relied on the rest of the text for

Re: [PATCH-for-5.1 v2 49/54] various: Use _abort in instance_init()

2020-04-06 Thread Philippe Mathieu-Daudé
On 4/6/20 7:47 PM, Philippe Mathieu-Daudé wrote: Patch created mechanically by running: $ spatch \ --macro-file scripts/cocci-macro-file.h \ --include-headers --keep-comments --in-place \ --sp-file \ scripts/coccinelle/use-error_abort-in-instance_init.cocci

[PATCH-for-5.1 v2 36/54] hw/block/onenand: Add missing error-propagation code

2020-04-06 Thread Philippe Mathieu-Daudé
Patch created mechanically by running: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/use-error_propagate-in-realize.cocci \ --keep-comments --smpl-spacing --in-place --dir hw Signed-off-by: Philippe Mathieu-Daudé ---

[PATCH-for-5.1 v2 49/54] various: Use _abort in instance_init()

2020-04-06 Thread Philippe Mathieu-Daudé
Patch created mechanically by running: $ spatch \ --macro-file scripts/cocci-macro-file.h \ --include-headers --keep-comments --in-place \ --sp-file \ scripts/coccinelle/use-error_abort-in-instance_init.cocci Signed-off-by: Philippe Mathieu-Daudé ---

Re: [PATCH-for-5.1 v2 01/54] various: Remove suspicious '\' character outside of #define in C code

2020-04-06 Thread Marc-André Lureau
Hi On Mon, Apr 6, 2020 at 7:48 PM Philippe Mathieu-Daudé wrote: > > Fixes the following coccinelle warnings: > > $ spatch --sp-file --verbose-parsing ... \ > scripts/coccinelle/remove_local_err.cocci > ... > SUSPICIOUS: a \ character appears outside of a #define at >

[PATCH-for-5.1 v2 01/54] various: Remove suspicious '\' character outside of #define in C code

2020-04-06 Thread Philippe Mathieu-Daudé
Fixes the following coccinelle warnings: $ spatch --sp-file --verbose-parsing ... \ scripts/coccinelle/remove_local_err.cocci ... SUSPICIOUS: a \ character appears outside of a #define at ./target/ppc/translate_init.inc.c:5213 SUSPICIOUS: a \ character appears outside of a #define

Re: [PATCH for-5.0] xen-block: Fix uninitialized variable

2020-04-06 Thread Anthony PERARD
On Mon, Apr 06, 2020 at 06:50:41PM +0200, Philippe Mathieu-Daudé wrote: > On 4/6/20 6:42 PM, Anthony PERARD wrote: > > Since 7f5d9b206d1e ("object-add: don't create return value if > > failed"), qmp_object_add() don't write any value in 'ret_data', thus > > has random data. Then qobject_unref()

[PATCH for-5.0 v2 1/3] block-backend: Reorder flush/pdiscard function definitions

2020-04-06 Thread Kevin Wolf
Move all variants of the flush/pdiscard functions to a single place and put the blk_co_*() version first because it is called by all other variants (and will become static in the next patch). Signed-off-by: Kevin Wolf --- block/block-backend.c | 92 +-- 1

[PATCH for-5.0 v2 3/3] block: Fix blk->in_flight during blk_wait_while_drained()

2020-04-06 Thread Kevin Wolf
Waiting in blk_wait_while_drained() while blk->in_flight is increased for the current request is wrong because it will cause the drain operation to deadlock. This patch makes sure that blk_wait_while_drained() is called with blk->in_flight increased exactly once for the current request, and that

[PATCH for-5.0 v2 2/3] block: Increase BB.in_flight for coroutine interfaces

2020-04-06 Thread Kevin Wolf
External callers of blk_co_*() don't currently increase the BlockBackend.in_flight counter, but calls from blk_aio_*() do, so there is an inconsistency whether the counter has been increased or not. This patch moves the actual operations to static functions that can later know they will always be

[PATCH for-5.0 v2 0/3] block: Fix blk->in_flight during blk_wait_while_drained()

2020-04-06 Thread Kevin Wolf
This fixes deadlocks when draining a BlockBackend in an iothread that receives new requests at the same time. v2: - Rework the whole thing so that direct callers of blk_co_*() aren't broken after the series [Max] Kevin Wolf (3): block-backend: Reorder flush/pdiscard function definitions

Re: [PATCH for-5.0] xen-block: Fix uninitialized variable

2020-04-06 Thread Philippe Mathieu-Daudé
On 4/6/20 6:42 PM, Anthony PERARD wrote: Since 7f5d9b206d1e ("object-add: don't create return value if failed"), qmp_object_add() don't write any value in 'ret_data', thus has random data. Then qobject_unref() fails and abort(). Fix by initialising 'ret_data' properly. Or move qobject_unref()

[PATCH for-5.0] xen-block: Fix uninitialized variable

2020-04-06 Thread Anthony PERARD
Since 7f5d9b206d1e ("object-add: don't create return value if failed"), qmp_object_add() don't write any value in 'ret_data', thus has random data. Then qobject_unref() fails and abort(). Fix by initialising 'ret_data' properly. Fixes: 5f07c4d60d09 ("qapi: Flatten object-add") Signed-off-by:

Re: [PATCH v2] qcow2: Check request size in qcow2_co_pwritev_compressed_part()

2020-04-06 Thread Alberto Garcia
I forgot to add the "for-5.0" tag in the subject, do I need to resend the patch? Berto

Re: [PATCH v2] qcow2: Check request size in qcow2_co_pwritev_compressed_part()

2020-04-06 Thread Andrey Shinkevich
Reviewed-by: Andrey Shinkevich From: Alberto Garcia Sent: Monday, April 6, 2020 5:34 PM To: qemu-de...@nongnu.org Cc: Alberto Garcia ; qemu-block@nongnu.org ; Andrey Shinkevich ; Max Reitz ; Kevin Wolf ; Vladimir Sementsov-Ogievskiy ; Pavel Butsykin

RE: [PATCH v2 for-5.0] xen-block: Fix double qlist remove and request leak

2020-04-06 Thread Paul Durrant
> -Original Message- > From: Anthony PERARD > Sent: 06 April 2020 15:02 > To: qemu-de...@nongnu.org > Cc: qemu-sta...@nongnu.org; Anthony PERARD ; > Stefano Stabellini > ; Paul Durrant ; Stefan Hajnoczi > ; Kevin > Wolf ; Max Reitz ; > xen-de...@lists.xenproject.org; qemu- >

[PATCH v2] qcow2: Check request size in qcow2_co_pwritev_compressed_part()

2020-04-06 Thread Alberto Garcia
When issuing a compressed write request the number of bytes must be a multiple of the cluster size or reach the end of the last cluster. With the current code such requests are allowed and we hit an assertion: $ qemu-img create -f qcow2 img.qcow2 1M $ qemu-io -c 'write -c 0 32k' img.qcow2

[PATCH v2 for-5.0] xen-block: Fix double qlist remove and request leak

2020-04-06 Thread Anthony PERARD
Commit a31ca6801c02 ("qemu/queue.h: clear linked list pointers on remove") revealed that a request was removed twice from a list, once in xen_block_finish_request() and a second time in xen_block_release_request() when both function are called from xen_block_complete_aio(). But also, the

Re: [PATCH for-5.0? v2] qcow2: Explicit mention of padding bytes

2020-04-06 Thread Eric Blake
On 4/6/20 3:50 AM, Vladimir Sementsov-Ogievskiy wrote: 03.04.2020 21:19, Eric Blake wrote: Although we already covered the need for padding bytes with our changes in commit 3ae3fcfa, commit 66fcbca5 just added one byte and relied on the rest of the text for implicitly covering 7 padding bytes. 

Re: [PATCH v2 2/2] iotests: rework test finding

2020-04-06 Thread Max Reitz
On 25.03.20 11:21, Vladimir Sementsov-Ogievskiy wrote: > Add python script with new logic of searching for tests: > > Old behavior: > - tests are named [0-9][0-9][0-9] > - tests must be registered in group file (even if test doesn't belong >to any group, like 142) > > New behavior: > -

Re: [PATCH v2 07/12] acpi: move aml builder code for rtc device

2020-04-06 Thread Igor Mammedov
On Mon, 6 Apr 2020 10:25:17 +0200 Gerd Hoffmann wrote: > On Fri, Apr 03, 2020 at 12:09:21PM +0200, Igor Mammedov wrote: > > On Fri, 3 Apr 2020 10:04:57 +0200 > > Gerd Hoffmann wrote: > > > > > Signed-off-by: Gerd Hoffmann > > > --- > > [...] > > > +static void rtc_build_aml(ISADevice

Re: [PATCH v2 09/12] acpi: move aml builder code for parallel device

2020-04-06 Thread Igor Mammedov
On Mon, 6 Apr 2020 12:26:52 +0200 Gerd Hoffmann wrote: > On Fri, Apr 03, 2020 at 12:16:01PM +0200, Igor Mammedov wrote: > > On Fri, 3 Apr 2020 12:12:10 +0200 > > Igor Mammedov wrote: > > > > > On Fri, 3 Apr 2020 10:04:59 +0200 > > > Gerd Hoffmann wrote: > > > > > [...] > > > > +static

Re: [PATCH v2 09/12] acpi: move aml builder code for parallel device

2020-04-06 Thread Paolo Bonzini
On 06/04/20 12:26, Gerd Hoffmann wrote: > -if (isa->iobase != 0x0378) { > +for (i = 0; i < ARRAY_SIZE(isa_parallel_io); i++) { > +if (isa->iobase == isa_parallel_io[i]) { > +uid = i + 1; > +} > +} > +if (!uid) { > return; > } > > @@

Re: [PATCH for-5.0] xen-block: Fix double qlist remove

2020-04-06 Thread Anthony PERARD
On Thu, Apr 02, 2020 at 03:27:22PM +0100, Paul Durrant wrote: > > -Original Message- > > From: Anthony PERARD > > Sent: 02 April 2020 14:08 > > To: qemu-de...@nongnu.org > > Cc: qemu-sta...@nongnu.org; Anthony PERARD ; > > Stefano Stabellini > > ; Paul Durrant ; Stefan Hajnoczi > > ;

Re: [PATCH v2 09/12] acpi: move aml builder code for parallel device

2020-04-06 Thread Gerd Hoffmann
On Fri, Apr 03, 2020 at 12:16:01PM +0200, Igor Mammedov wrote: > On Fri, 3 Apr 2020 12:12:10 +0200 > Igor Mammedov wrote: > > > On Fri, 3 Apr 2020 10:04:59 +0200 > > Gerd Hoffmann wrote: > > > [...] > > > +static void parallel_isa_build_aml(ISADevice *isadev, Aml *scope) > > > +{ > > > +

Re: [PATCH v2 06/12] acpi: add ISADeviceClass->build_aml()

2020-04-06 Thread Igor Mammedov
On Fri, 3 Apr 2020 10:04:56 +0200 Gerd Hoffmann wrote: > Also add isa_aml_build() function which walks all isa devices. > This allows to move aml builder code to isa devices. > > Signed-off-by: Gerd Hoffmann > --- > include/hw/isa/isa.h | 2 ++ > hw/i386/acpi-build.c | 1 + >

Re: [PATCH v2 04/12] acpi: serial: don't use _STA method

2020-04-06 Thread Gerd Hoffmann
> > Signed-off-by: Gerd Hoffmann > I'd drop this patch and squash commit message into 8/12, > but I don't insist since get_system_io() added here is removed by 8/12, > so either way They are logically separate changes (even though the first enables the second), so I'd prefer to keep them

Re: [PATCH for-5.0 2/2] block: Fix blk->in_flight during blk_wait_while_drained()

2020-04-06 Thread Max Reitz
On 03.04.20 16:50, Kevin Wolf wrote: > Am 03.04.2020 um 14:42 hat Max Reitz geschrieben: >> On 03.04.20 12:44, Kevin Wolf wrote: >>> Calling blk_wait_while_drained() while blk->in_flight is increased for >>> the current request is wrong because it will cause the drain operation >>> to deadlock.

Re: [PATCH for-5.0? v2] qcow2: Explicit mention of padding bytes

2020-04-06 Thread Vladimir Sementsov-Ogievskiy
03.04.2020 21:19, Eric Blake wrote: Although we already covered the need for padding bytes with our changes in commit 3ae3fcfa, commit 66fcbca5 just added one byte and relied on the rest of the text for implicitly covering 7 padding bytes. For consistency with other parts of the header (such as

Re: bdrv_drained_begin deadlock with io-threads

2020-04-06 Thread Kevin Wolf
Am 03.04.2020 um 18:31 hat Dietmar Maurer geschrieben: > > > On April 3, 2020 10:47 AM Kevin Wolf wrote: > > > > > > Am 03.04.2020 um 10:26 hat Dietmar Maurer geschrieben: > > > > With the following patch, it seems to survive for now. I'll give it some > > > > more testing tomorrow (also

Re: [PATCH v2 07/12] acpi: move aml builder code for rtc device

2020-04-06 Thread Gerd Hoffmann
On Fri, Apr 03, 2020 at 12:09:21PM +0200, Igor Mammedov wrote: > On Fri, 3 Apr 2020 10:04:57 +0200 > Gerd Hoffmann wrote: > > > Signed-off-by: Gerd Hoffmann > > --- > [...] > > +static void rtc_build_aml(ISADevice *isadev, Aml *scope) > > +{ > > +Aml *dev; > > +Aml *crs; > > + > > +

Re: [PATCH v5 2/2] lockable: replaced locks with lock guard macros where appropriate

2020-04-06 Thread Juan Quintela
dnbrd...@gmail.com wrote: > From: Daniel Brodsky > > - ran regexp "qemu_mutex_lock\(.*\).*\n.*if" to find targets > - replaced result with QEMU_LOCK_GUARD if all unlocks at function end > - replaced result with WITH_QEMU_LOCK_GUARD if unlock not at end > > Signed-off-by: Daniel Brodsky

Re: [PATCH for-5.0] qcow2: Check request size in qcow2_co_pwritev_compressed_part()

2020-04-06 Thread Vladimir Sementsov-Ogievskiy
03.04.2020 20:40, Eric Blake wrote: On 4/3/20 11:57 AM, Alberto Garcia wrote: When issuing a compressed write request the number of bytes must be a multiple of the cluster size. With the current code such requests are allowed and we hit an assertion:     $ qemu-img create -f qcow2 img.qcow2