[Qemu-block] [PATCH v2 1/1] iotests: fix test case 185

2018-03-22 Thread QingFeng Hao
Test case 185 failed since commit 4486e89c219 --- "vl: introduce vm_shutdown()". It's because of the newly introduced function vm_shutdown calls bdrv_drain_all, which is called later by bdrv_close_all. bdrv_drain_all resumes the jobs that doubles the speed and offset is doubled. Some jobs' status

[Qemu-block] [PATCH v2 0/1] iotests: fix test case 185

2018-03-22 Thread QingFeng Hao
Hi, This patch is to fix iotest case 185 and based on the latest commit d522e0bd18364 --- "gitmodules: Use the QEMU mirror of qemu-palcode". Thanks! Change Log (v2): * Recover the change on the call to bdrv_drain_all but don't resume the yielded jobs according to Stefan Hajnoczi's comment. *

Re: [Qemu-block] [PATCH 4/4] Remove unnecessary variables for function return value

2018-03-22 Thread David Gibson
On Thu, Mar 22, 2018 at 05:12:26PM +0100, Laurent Vivier wrote: > Re-run Coccinelle script scripts/coccinelle/return_directly.cocci > > Signed-off-by: Laurent Vivier > --- > accel/tcg/translate-all.c | 5 +- > block/quorum.c

Re: [Qemu-block] [Qemu-arm] [PATCH 4/4] Remove unnecessary variables for function return value

2018-03-22 Thread Philippe Mathieu-Daudé
Hi Laurent, On 03/22/2018 01:12 PM, Laurent Vivier wrote: > Re-run Coccinelle script scripts/coccinelle/return_directly.cocci > > Signed-off-by: Laurent Vivier > --- > accel/tcg/translate-all.c | 5 +- > block/quorum.c

Re: [Qemu-block] [PATCH v2] qemu: replace "" with <> in headers

2018-03-22 Thread Paolo Bonzini
On 22/03/2018 20:29, Michael S. Tsirkin wrote: > On Wed, Mar 21, 2018 at 05:22:03PM +0100, Kevin Wolf wrote: >>> It's all still very much a non-standard convention and so less robust >>> than prefixing file name with a project-specifix prefix. >> I've always had the impression that it's by far the

Re: [Qemu-block] [PATCH 1/1] block/file-posix.c: fix not reopened lock file descriptor

2018-03-22 Thread Dion Bosschieter
Yeah I have a use case, before a last sync on a storage migration we suspend a VM -> send the last diffs -> mount the new storage server and after that we change a symlink -> call reopen -> check if all file descriptors are changed before resuming the VM. Dion > Op 22 mrt. 2018 om 18:39 heeft

Re: [Qemu-block] [PATCH 4/4] Remove unnecessary variables for function return value

2018-03-22 Thread Max Filippov
On Thu, Mar 22, 2018 at 9:12 AM, Laurent Vivier wrote: > Re-run Coccinelle script scripts/coccinelle/return_directly.cocci > > Signed-off-by: Laurent Vivier > --- > target/xtensa/core-dc232b/xtensa-modules.c | 56 > ++ >

Re: [Qemu-block] [PATCH 4/4] Remove unnecessary variables for function return value

2018-03-22 Thread Max Filippov
On Thu, Mar 22, 2018 at 10:23 AM, Peter Maydell wrote: > On 22 March 2018 at 17:19, Max Filippov wrote: >> Ok, I can add a fixup that changes #include to #include >> "xtensa-isa.h". >> Adding #include "qemu/osdep.h" there seems pointless to me. > >

Re: [Qemu-block] [PATCH 4/4] Remove unnecessary variables for function return value

2018-03-22 Thread Max Filippov
On Thu, Mar 22, 2018 at 9:59 AM, Eric Blake wrote: > On 03/22/2018 11:51 AM, Max Filippov wrote: >> >> On Thu, Mar 22, 2018 at 9:12 AM, Laurent Vivier >> wrote: >>> >>> Re-run Coccinelle script scripts/coccinelle/return_directly.cocci >>> >>> Signed-off-by:

Re: [Qemu-block] [PATCH 4/4] Remove unnecessary variables for function return value

2018-03-22 Thread Max Filippov
On Thu, Mar 22, 2018 at 9:58 AM, Laurent Vivier wrote: > On 22/03/2018 17:51, Max Filippov wrote: >> On Thu, Mar 22, 2018 at 9:12 AM, Laurent Vivier wrote: >>> Re-run Coccinelle script scripts/coccinelle/return_directly.cocci >>> >>> Signed-off-by: Laurent

Re: [Qemu-block] [PATCH v2 1/2] make: move generated headers to qemu-build/

2018-03-22 Thread Michael S. Tsirkin
On Thu, Mar 22, 2018 at 02:42:55PM -0500, Eric Blake wrote: > On 03/22/2018 02:27 PM, Michael S. Tsirkin wrote: > > Make sure all generated files go into qemu-build subdirectory. > > We can then include them like this: > > #include "qemu-build/trace.h" > > > > This serves two purposes: > > -

Re: [Qemu-block] [PATCH v2 1/2] make: move generated headers to qemu-build/

2018-03-22 Thread Eric Blake
On 03/22/2018 02:27 PM, Michael S. Tsirkin wrote: Make sure all generated files go into qemu-build subdirectory. We can then include them like this: #include "qemu-build/trace.h" This serves two purposes: - make it easy to detect which files are in the source directory (a bit more work for

Re: [Qemu-block] [PATCH v2] qemu: replace "" with <> in headers

2018-03-22 Thread Michael S. Tsirkin
On Wed, Mar 21, 2018 at 05:22:03PM +0100, Kevin Wolf wrote: > > It's all still very much a non-standard convention and so less robust > > than prefixing file name with a project-specifix prefix. > > I've always had the impression that it's by far the most common > convention, to the point that

[Qemu-block] [PATCH v2 1/2] make: move generated headers to qemu-build/

2018-03-22 Thread Michael S. Tsirkin
Make sure all generated files go into qemu-build subdirectory. We can then include them like this: #include "qemu-build/trace.h" This serves two purposes: - make it easy to detect which files are in the source directory (a bit more work for writers, easier for readers) - reduce chances of

Re: [Qemu-block] [Qemu-devel] [PATCH 0/4] coccinelle: re-run scripts from scripts/coccinelle

2018-03-22 Thread Peter Maydell
On 22 March 2018 at 19:12, Eric Blake wrote: > Or if we don't patch the false negative, you can bypass checkpatch with an > ugly hack: > > return 0 + (...) | (...); > > (I'm NOT going to do that bypass - it's too ugly for my taste) Yeah, that's definitely not something we

Re: [Qemu-block] [Qemu-devel] [PATCH 0/4] coccinelle: re-run scripts from scripts/coccinelle

2018-03-22 Thread Eric Blake
On 03/22/2018 01:00 PM, Peter Maydell wrote: On 22 March 2018 at 17:57, wrote: Checking PATCH 4/4: Remove unnecessary variables for function return value... ERROR: return is not a function, parentheses are not required #251: FILE: target/mips/dsp_helper.c:3281: +

Re: [Qemu-block] [Qemu-devel] [PATCH 0/4] coccinelle: re-run scripts from scripts/coccinelle

2018-03-22 Thread Peter Maydell
On 22 March 2018 at 17:57, wrote: > Checking PATCH 4/4: Remove unnecessary variables for function return value... > ERROR: return is not a function, parentheses are not required > #251: FILE: target/mips/dsp_helper.c:3281: > +return (temp[1] << 63) | (temp[0] >> 1);

Re: [Qemu-block] [Qemu-devel] [PATCH 0/4] coccinelle: re-run scripts from scripts/coccinelle

2018-03-22 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20180322161226.29796-1-lviv...@redhat.com Subject: [Qemu-devel] [PATCH 0/4] coccinelle: re-run scripts from scripts/coccinelle === TEST SCRIPT BEGIN === #!/bin/bash

Re: [Qemu-block] [PATCH 4/4] Remove unnecessary variables for function return value

2018-03-22 Thread Peter Maydell
On 22 March 2018 at 17:30, Eric Blake wrote: > I'm less certain of whether our Coccinelle scripts have easy ways to exclude > specific files. We already have scripts/cocci-macro-file.h to help > Coccinelle not choke on some our existing files, but I'm not sure if > Coccinelle

Re: [Qemu-block] [PATCH 1/1] block/file-posix.c: fix not reopened lock file descriptor

2018-03-22 Thread Kevin Wolf
[ Cc: qemu-block ] Am 22.03.2018 um 18:20 hat Dion Bosschieter geschrieben: > In commit 244a5668106297378391b768e7288eb157616f64 another > file descriptor to BDRVRawState is added. When we try to issue the > reopen command only s->fd is reopened; lock_fd could still hold an old > file descriptor

Re: [Qemu-block] [PATCH 4/4] Remove unnecessary variables for function return value

2018-03-22 Thread Eric Blake
On 03/22/2018 12:19 PM, Max Filippov wrote: These files were autogenerated, fixing them doesn't make much sense. Good to know. They have been already updated by a couple of patches: 8f0a3716e4 Clean up includes d8e39b7062 Use #include "..." for our own headers, <...> for others Perhaps

Re: [Qemu-block] [PATCH 4/4] Remove unnecessary variables for function return value

2018-03-22 Thread Peter Maydell
On 22 March 2018 at 17:19, Max Filippov wrote: > Ok, I can add a fixup that changes #include to #include > "xtensa-isa.h". > Adding #include "qemu/osdep.h" there seems pointless to me. Every top level .c file must start with including osdep.h. Other headers that it might

Re: [Qemu-block] [PATCH 4/4] Remove unnecessary variables for function return value

2018-03-22 Thread Eric Blake
On 03/22/2018 11:51 AM, Max Filippov wrote: On Thu, Mar 22, 2018 at 9:12 AM, Laurent Vivier wrote: Re-run Coccinelle script scripts/coccinelle/return_directly.cocci Signed-off-by: Laurent Vivier --- target/xtensa/core-dc232b/xtensa-modules.c

Re: [Qemu-block] [PATCH 4/4] Remove unnecessary variables for function return value

2018-03-22 Thread Laurent Vivier
On 22/03/2018 17:51, Max Filippov wrote: > On Thu, Mar 22, 2018 at 9:12 AM, Laurent Vivier wrote: >> Re-run Coccinelle script scripts/coccinelle/return_directly.cocci >> >> Signed-off-by: Laurent Vivier >> --- >> target/xtensa/core-dc232b/xtensa-modules.c

Re: [Qemu-block] [PATCH 0/4] coccinelle: re-run scripts from scripts/coccinelle

2018-03-22 Thread Eric Blake
On 03/22/2018 11:12 AM, Laurent Vivier wrote: I've re-run some scripts from the coccinelle directory, and they have found some problems. This series fixes them. Laurent Vivier (4): error: Strip trailing '\n' from error string arguments (again again) error: Remove NULL checks on

Re: [Qemu-block] [PATCH 4/4] Remove unnecessary variables for function return value

2018-03-22 Thread Eric Blake
On 03/22/2018 11:12 AM, Laurent Vivier wrote: Re-run Coccinelle script scripts/coccinelle/return_directly.cocci Signed-off-by: Laurent Vivier --- +++ b/hw/arm/exynos4210.c @@ -156,12 +156,7 @@ void exynos4210_write_secondary(ARMCPU *cpu, static uint64_t

Re: [Qemu-block] [PATCH 4/4] qapi: new qmp command nbd-server-add-bitmap

2018-03-22 Thread Vladimir Sementsov-Ogievskiy
22.03.2018 19:19, Eric Blake wrote: On 03/22/2018 10:43 AM, Vladimir Sementsov-Ogievskiy wrote: +# Returns: error on one of the following conditions: +#   - the server is not running +#   - export is not found +#   - bitmap is not found +#   - bitmap is disabled

Re: [Qemu-block] [PATCH 0/3] coroutine: avoid co_queue_wakeup recursion

2018-03-22 Thread Paolo Bonzini
On 22/03/2018 16:28, Stefan Hajnoczi wrote: > co_queue_wakeup is currently implemented in a recursive fashion. Pathological > patterns of aio_co_enter() between coroutines can cause stack exhaustion. > > This patch series implements co_queue_wakeup iteratively and avoids stack > exhaustion. > >

Re: [Qemu-block] [PATCH 0/4] coccinelle: re-run scripts from scripts/coccinelle

2018-03-22 Thread Eric Blake
On 03/22/2018 11:12 AM, Laurent Vivier wrote: I've re-run some scripts from the coccinelle directory, and they have found some problems. This series fixes them. Laurent Vivier (4): error: Strip trailing '\n' from error string arguments (again again) This is user-visible, so appropriate

Re: [Qemu-block] [PATCH 3/4] qdict: remove useless cast

2018-03-22 Thread Dr. David Alan Gilbert
* Laurent Vivier (lviv...@redhat.com) wrote: > Re-run Coccinelle script scripts/coccinelle/qobject.cocci > > Signed-off-by: Laurent Vivier > --- > block/nvme.c | 11 +-- > monitor.c| 2 +- > 2 files changed, 6 insertions(+), 7 deletions(-) > > diff --git

Re: [Qemu-block] [PATCH 4/4] qapi: new qmp command nbd-server-add-bitmap

2018-03-22 Thread Eric Blake
On 03/22/2018 10:43 AM, Vladimir Sementsov-Ogievskiy wrote: +# Returns: error on one of the following conditions: +#   - the server is not running +#   - export is not found +#   - bitmap is not found +#   - bitmap is disabled +#   - bitmap is locked Do

[Qemu-block] [PATCH 3/4] qdict: remove useless cast

2018-03-22 Thread Laurent Vivier
Re-run Coccinelle script scripts/coccinelle/qobject.cocci Signed-off-by: Laurent Vivier --- block/nvme.c | 11 +-- monitor.c| 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/block/nvme.c b/block/nvme.c index 8bca57aae6..c4f3a7bc94 100644 ---

[Qemu-block] [PATCH 4/4] Remove unnecessary variables for function return value

2018-03-22 Thread Laurent Vivier
Re-run Coccinelle script scripts/coccinelle/return_directly.cocci Signed-off-by: Laurent Vivier --- accel/tcg/translate-all.c | 5 +- block/quorum.c | 6 +-- hw/arm/exynos4210.c|

[Qemu-block] [PATCH 2/4] error: Remove NULL checks on error_propagate() calls

2018-03-22 Thread Laurent Vivier
Re-run Coccinelle patch scripts/coccinelle/error_propagate_null.cocci Signed-off-by: Laurent Vivier --- io/channel-websock.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/io/channel-websock.c b/io/channel-websock.c index ec48a305f0..e6608b969d 100644

[Qemu-block] [PATCH 1/4] error: Strip trailing '\n' from error string arguments (again again)

2018-03-22 Thread Laurent Vivier
Re-run Coccinelle script scripts/coccinelle/err-bad-newline.cocci, and found new error_report() occurences with '\n'. Signed-off-by: Laurent Vivier --- target/i386/hvf/hvf.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git

[Qemu-block] [PATCH 0/4] coccinelle: re-run scripts from scripts/coccinelle

2018-03-22 Thread Laurent Vivier
I've re-run some scripts from the coccinelle directory, and they have found some problems. This series fixes them. Laurent Vivier (4): error: Strip trailing '\n' from error string arguments (again again) error: Remove NULL checks on error_propagate() calls qdict: remove useless cast

Re: [Qemu-block] [PATCH 4/4] qapi: new qmp command nbd-server-add-bitmap

2018-03-22 Thread Vladimir Sementsov-Ogievskiy
21.03.2018 20:33, Eric Blake wrote: On 03/21/2018 07:19 AM, Vladimir Sementsov-Ogievskiy wrote: Signed-off-by: Vladimir Sementsov-Ogievskiy ---   qapi/block.json | 27 +++   blockdev-nbd.c  | 23 +++   2 files changed, 50

Re: [Qemu-block] [PATCH 3/4] nbd/server: implement dirty bitmap export

2018-03-22 Thread Vladimir Sementsov-Ogievskiy
21.03.2018 19:57, Eric Blake wrote: On 03/21/2018 07:19 AM, Vladimir Sementsov-Ogievskiy wrote: Signed-off-by: Vladimir Sementsov-Ogievskiy [...] + +#define NBD_STATE_DIRTY 1 Does this belong better in nbd.h, alongside NBD_STATE_HOLE?  (And defining it as

[Qemu-block] [PATCH 2/3] coroutine: avoid co_queue_wakeup recursion

2018-03-22 Thread Stefan Hajnoczi
qemu_aio_coroutine_enter() is (indirectly) called recursively when processing co_queue_wakeup. This can lead to stack exhaustion. This patch rewrites co_queue_wakeup in an iterative fashion (instead of recursive) with bounded memory usage to prevent stack exhaustion. qemu_co_queue_run_restart()

[Qemu-block] [PATCH 1/3] queue: add QSIMPLEQ_PREPEND()

2018-03-22 Thread Stefan Hajnoczi
QSIMPLEQ_CONCAT(a, b) joins a = a + b. The new QSIMPLEQ_PREPEND(a, b) API joins a = b + a. Signed-off-by: Stefan Hajnoczi --- include/qemu/queue.h | 8 1 file changed, 8 insertions(+) diff --git a/include/qemu/queue.h b/include/qemu/queue.h index

[Qemu-block] [PATCH 3/3] coroutine: add test-aio coroutine queue chaining test case

2018-03-22 Thread Stefan Hajnoczi
Check that two coroutines can queue each other repeatedly without hitting stack exhaustion. Switch to qemu_init_main_loop() in main() because coroutines use qemu_get_aio_context() - they don't know about test-aio's ctx variable. Signed-off-by: Stefan Hajnoczi ---

[Qemu-block] [PATCH 0/3] coroutine: avoid co_queue_wakeup recursion

2018-03-22 Thread Stefan Hajnoczi
co_queue_wakeup is currently implemented in a recursive fashion. Pathological patterns of aio_co_enter() between coroutines can cause stack exhaustion. This patch series implements co_queue_wakeup iteratively and avoids stack exhaustion. This issue was originally reported with qemu-img convert

Re: [Qemu-block] [PATCH 3/4] nbd/server: implement dirty bitmap export

2018-03-22 Thread Vladimir Sementsov-Ogievskiy
21.03.2018 19:57, Eric Blake wrote: On 03/21/2018 07:19 AM, Vladimir Sementsov-Ogievskiy wrote: Signed-off-by: Vladimir Sementsov-Ogievskiy Rather sparse on the details in the commit message; I had to read the patch to even learn what the new namespace is. oh,

Re: [Qemu-block] [PATCH 1/4] nbd/server: refactor nbd_negotiate_meta_query for several namespaces

2018-03-22 Thread Vladimir Sementsov-Ogievskiy
21.03.2018 17:56, Eric Blake wrote: [adding NBD list] On 03/21/2018 07:19 AM, Vladimir Sementsov-Ogievskiy wrote: Signed-off-by: Vladimir Sementsov-Ogievskiy ---   nbd/server.c | 60 +++-   1 file changed, 43

[Qemu-block] [PATCH v3] vmdk: return ERROR when cluster sector is larger than vmdk limitation

2018-03-22 Thread yuchenlin
From: yuchenlin VMDK has a hard limitation of extent size, which is due to the size of grain table entry is 32 bits. It means it can only point to a grain located at offset = 2^32. To avoid writing the user data beyond limitation and record a useless offset in grain

Re: [Qemu-block] raw iotest regressions in 2.12.0-rc0

2018-03-22 Thread Peter Xu
On Wed, Mar 21, 2018 at 05:58:48PM -0400, John Snow wrote: > ./check -v -raw > Failures: 109 132 136 148 152 183 > > 3fd2457d18edf5736f713dfe1ada9c87a9badab1 is the first bad commit > commit 3fd2457d18edf5736f713dfe1ada9c87a9badab1 > Author: Peter Xu > Date: Fri Mar 9

Re: [Qemu-block] [Qemu-devel] [PATCH v2] vmdk: return ERROR when cluster sector is larger than vmdk limitation

2018-03-22 Thread Eric Blake
On 03/22/2018 02:41 AM, Fam Zheng wrote: On Thu, 03/22 14:24, yuchen...@synology.com wrote: From: yuchenlin VMDK has a hard limitation of extent size, which is due to the size of grain table entry is 32 bits. It means it can only point to a grain located at offset =

[Qemu-block] [PATCH for-2.12 v4] iotests: Test abnormally large size in compressed cluster descriptor

2018-03-22 Thread Alberto Garcia
L2 entries for compressed clusters have a field that indicates the number of sectors used to store the data in the image. That's however not the size of the compressed data itself, just the number of sectors where that data is located. The actual data size is usually not a multiple of the sector