Re: [PATCH 0/6] Fix more GCC9 -O3 warnings

2019-12-17 Thread Markus Armbruster
"Chubb, Peter (Data61, Kensington NSW)" writes: >> "Philippe" == Philippe Mathieu-Daudé writes: > > Philippe> Fix some trivial warnings when building with -O3. > > For compatibility with lint and other older checkers, it'd be good to keep > this as /* FALLTHROUGH */ (which gcc should accept

Re: [PATCH 6/6] qemu-io-cmds: Silent GCC9 format-overflow warning

2019-12-17 Thread Richard Henderson
On 12/17/19 7:34 AM, Philippe Mathieu-Daudé wrote: > GCC9 is confused when building with CFLAG -O3: > > In function ‘help_oneline’, > inlined from ‘help_all’ at qemu-io-cmds.c:2414:9, > inlined from ‘help_f’ at qemu-io-cmds.c:2424:9: > qemu-io-cmds.c:2389:9: error: ‘%s’ directive a

Re: [PATCH 5/6] hw/scsi/megasas: Silent GCC9 duplicated-cond warning

2019-12-17 Thread Richard Henderson
On 12/17/19 7:34 AM, Philippe Mathieu-Daudé wrote: > GCC9 is confused when building with CFLAG -O3: > > hw/scsi/megasas.c: In function ‘megasas_scsi_realize’: > hw/scsi/megasas.c:2387:26: error: duplicated ‘if’ condition > [-Werror=duplicated-cond] >2387 | } else if (s->fw_sge >= 128

[PATCH] qcow2: Move error check of local_err near its assignment

2019-12-17 Thread Tuguoyi
Signed-off-by: Guoyi Tu --- block/qcow2.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 7c18721..ce3db29 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1705,14 +1705,14 @@ static int coroutine_fn qcow2_do_open(BlockDriverSt

Re: [PATCH 0/6] Fix more GCC9 -O3 warnings

2019-12-17 Thread Chubb, Peter (Data61, Kensington NSW)
> "Philippe" == Philippe Mathieu-Daudé writes: Philippe> Fix some trivial warnings when building with -O3. For compatibility with lint and other older checkers, it'd be good to keep this as /* FALLTHROUGH */ (which gcc should accept according to its manual). Fixing the comments' placement i

Re: [PATCH 0/6] Fix more GCC9 -O3 warnings

2019-12-17 Thread Philippe Mathieu-Daudé
On 12/17/19 6:32 PM, Philippe Mathieu-Daudé wrote: Fix some trivial warnings when building with -O3. Philippe Mathieu-Daudé (6): audio/audio: Add missing fall through comment hw/display/tcx: Add missing fall through comments hw/net/imx_fec: Rewrite fall through comments hw/timer/aspe

[PATCH 5/6] hw/scsi/megasas: Silent GCC9 duplicated-cond warning

2019-12-17 Thread Philippe Mathieu-Daudé
GCC9 is confused when building with CFLAG -O3: hw/scsi/megasas.c: In function ‘megasas_scsi_realize’: hw/scsi/megasas.c:2387:26: error: duplicated ‘if’ condition [-Werror=duplicated-cond] 2387 | } else if (s->fw_sge >= 128 - MFI_PASS_FRAME_SIZE) { hw/scsi/megasas.c:2385:19: note: pre

[PATCH 6/6] qemu-io-cmds: Silent GCC9 format-overflow warning

2019-12-17 Thread Philippe Mathieu-Daudé
GCC9 is confused when building with CFLAG -O3: In function ‘help_oneline’, inlined from ‘help_all’ at qemu-io-cmds.c:2414:9, inlined from ‘help_f’ at qemu-io-cmds.c:2424:9: qemu-io-cmds.c:2389:9: error: ‘%s’ directive argument is null [-Werror=format-overflow=] 2389 | p

[PATCH 0/6] Fix more GCC9 -O3 warnings

2019-12-17 Thread Philippe Mathieu-Daudé
Fix some trivial warnings when building with -O3. Philippe Mathieu-Daudé (6): audio/audio: Add missing fall through comment hw/display/tcx: Add missing fall through comments hw/net/imx_fec: Rewrite fall through comments hw/timer/aspeed_timer: Add a fall through comment hw/scsi/megasas: S

[PATCH 0/6] Fix more GCC9 -O3 warnings

2019-12-17 Thread Philippe Mathieu-Daudé
Fix some trivial warnings when building with -O3. Philippe Mathieu-Daudé (6): audio/audio: Add missing fall through comment hw/display/tcx: Add missing fall through comments hw/net/imx_fec: Rewrite fall through comments hw/timer/aspeed_timer: Add a fall through comment hw/scsi/megasas: S

Re: [PATCH 00/14] chardev: Use QEMUChrEvent enum in IOEventHandler typedef

2019-12-17 Thread Philippe Mathieu-Daudé
On 12/17/19 5:37 PM, Philippe Mathieu-Daudé wrote: Hi, After this chat on #qemu IRC: 13:20 so what is the difference between a IOReadHandler and IOEventHandler? 13:25 stsquad: one is in-band and the other out-of-band? 13:26 f4bug: ahh yes it seems so - connect/disconnect etc... 13:27 see QE

[RFC PATCH 13/14] hw/char/terminal3270: Explicit ignored QEMUChrEvent in IOEventHandler

2019-12-17 Thread Philippe Mathieu-Daudé
The Chardev events are listed in the QEMUChrEvent enum. To be able to use this enum in the IOEventHandler typedef, we need to explicit when frontends ignore some events, to silent GCC the following warnings: CC s390x-softmmu/hw/char/terminal3270.o hw/char/terminal3270.c: In function ‘ch

[RFC PATCH 11/14] net/vhost-user: Explicit we ignore few QEMUChrEvent in IOEventHandler

2019-12-17 Thread Philippe Mathieu-Daudé
The Chardev events are listed in the QEMUChrEvent enum. To be able to use this enum in the IOEventHandler typedef, we need to explicit when frontends ignore some events, to silent GCC the following warnings: CC net/vhost-user.o net/vhost-user.c: In function ‘net_vhost_user_event’: net

[RFC PATCH 12/14] vhost-user-blk: Explicit we ignore few QEMUChrEvent in IOEventHandler

2019-12-17 Thread Philippe Mathieu-Daudé
The Chardev events are listed in the QEMUChrEvent enum. To be able to use this enum in the IOEventHandler typedef, we need to explicit when frontends ignore some events, to silent GCC the following warnings: CC s390x-softmmu/hw/block/vhost-user-blk.o hw/block/vhost-user-blk.c: In functi

[RFC PATCH 08/14] hw/usb/redirect: Explicit we ignore few QEMUChrEvent in IOEventHandler

2019-12-17 Thread Philippe Mathieu-Daudé
The Chardev events are listed in the QEMUChrEvent enum. To be able to use this enum in the IOEventHandler typedef, we need to explicit when frontends ignore some events, to silent GCC the following warnings: CC hw/usb/redirect.o hw/usb/redirect.c: In function ‘usbredir_chardev_event’:

[RFC PATCH 09/14] monitor/qmp: Explicit we ignore few QEMUChrEvent in IOEventHandler

2019-12-17 Thread Philippe Mathieu-Daudé
The Chardev events are listed in the QEMUChrEvent enum. To be able to use this enum in the IOEventHandler typedef, we need to explicit when frontends ignore some events, to silent GCC the following warnings: CC monitor/qmp.o monitor/qmp.c: In function ‘monitor_qmp_event’: monitor/qmp.

[RFC PATCH 06/14] hw/usb/dev-serial: Explicit we ignore few QEMUChrEvent in IOEventHandler

2019-12-17 Thread Philippe Mathieu-Daudé
The Chardev events are listed in the QEMUChrEvent enum. To be able to use this enum in the IOEventHandler typedef, we need to explicit when frontends ignore some events, to silent GCC the following warnings: hw/usb/dev-serial.c: In function ‘usb_serial_event’: hw/usb/dev-serial.c:468:5: error:

[RFC PATCH 07/14] ccid-card-passthru: Explicit we ignore QEMUChrEvent in IOEventHandler

2019-12-17 Thread Philippe Mathieu-Daudé
The Chardev events are listed in the QEMUChrEvent enum. To be able to use this enum in the IOEventHandler typedef, we need to explicit when frontends ignore some events, to silent GCC the following warnings: hw/usb/ccid-card-passthru.c: In function ‘ccid_card_vscard_event’: hw/usb/ccid-card-pa

[PATCH 14/14] chardev: Use QEMUChrEvent enum in IOEventHandler typedef

2019-12-17 Thread Philippe Mathieu-Daudé
The Chardev events are listed in the QEMUChrEvent enum. By using the enum in the IOEventHandler typedef we: - make the IOEventHandler type more explicit (this handler process out-of-band information, while the IOReadHandler is in-band), - help static code analyzers. This patch was produced w

[RFC PATCH 10/14] monitor/hmp: Explicit we ignore a QEMUChrEvent in IOEventHandler

2019-12-17 Thread Philippe Mathieu-Daudé
The Chardev events are listed in the QEMUChrEvent enum. To be able to use this enum in the IOEventHandler typedef, we need to explicit when frontends ignore some events, to silent GCC the following warnings: CC monitor/hmp.o monitor/hmp.c: In function ‘monitor_event’: monitor/hmp.c:13

[RFC PATCH 05/14] hw/ipmi: Explicit we ignore some QEMUChrEvent in IOEventHandler

2019-12-17 Thread Philippe Mathieu-Daudé
The Chardev events are listed in the QEMUChrEvent enum. To be able to use this enum in the IOEventHandler typedef, we need to explicit when frontends ignore some events, to silent GCC the following warnings: hw/ipmi/ipmi_bmc_extern.c: In function ‘chr_event’: hw/ipmi/ipmi_bmc_extern.c:389:5: e

[PATCH 00/14] chardev: Use QEMUChrEvent enum in IOEventHandler typedef

2019-12-17 Thread Philippe Mathieu-Daudé
Hi, After this chat on #qemu IRC: 13:20 so what is the difference between a IOReadHandler and IOEventHandler? 13:25 stsquad: one is in-band and the other out-of-band? 13:26 f4bug: ahh yes it seems so - connect/disconnect etc... 13:27 see QEMUChrEvent for IOEventHandler I thought it might be

[RFC PATCH 02/14] chardev/char: Explicit we ignore some QEMUChrEvent in IOEventHandler

2019-12-17 Thread Philippe Mathieu-Daudé
The Chardev events are listed in the QEMUChrEvent enum. To be able to use this enum in the IOEventHandler typedef, we need to explicit when frontends ignore some events, to silent GCC the following warnings: chardev/char.c: In function ‘qemu_chr_be_event’: chardev/char.c:65:5: error: enumerati

[RFC PATCH 04/14] virtio-console: Explicit we ignore some QEMUChrEvent in IOEventHandler

2019-12-17 Thread Philippe Mathieu-Daudé
The Chardev events are listed in the QEMUChrEvent enum. To be able to use this enum in the IOEventHandler typedef, we need to explicit when frontends ignore some events, to silent GCC the following warnings: CC hw/char/virtio-console.o hw/char/virtio-console.c: In function ‘chr_event’:

[RFC PATCH 03/14] vhost-user: Explicit we ignore some QEMUChrEvent in IOEventHandler

2019-12-17 Thread Philippe Mathieu-Daudé
The Chardev events are listed in the QEMUChrEvent enum. To be able to use this enum in the IOEventHandler typedef, we need to explicit when frontends ignore some events, to silent GCC the following warnings: CC backends/cryptodev-vhost-user.o backends/cryptodev-vhost-user.c: In function

[PATCH 01/14] hw/ipmi: Remove unnecessary declarations

2019-12-17 Thread Philippe Mathieu-Daudé
Since we don't use these methods before defining them, no need to forward-declare them. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Corey Minyard --- Cc: Corey Minyard In case the other patches are rejected: Cc: qemu-triv...@nongnu.org --- hw/ipmi/ipmi_bmc_extern.c | 4 1 file changed

Re: bdrv_co_pwritev: Assertion `!waited || !use_local_qiov' failed.

2019-12-17 Thread Peter Lieven
Am 17.12.19 um 16:52 schrieb Kevin Wolf: Am 17.12.2019 um 15:14 hat Peter Lieven geschrieben: I have a vserver running Qemu 4.0 that seems to reproducibly hit the following assertion:  bdrv_co_pwritev: Assertion `!waited || !use_local_qiov' failed. I noticed that the padding code was recently

Re: bdrv_co_pwritev: Assertion `!waited || !use_local_qiov' failed.

2019-12-17 Thread Kevin Wolf
Am 17.12.2019 um 15:14 hat Peter Lieven geschrieben: > I have a vserver running Qemu 4.0 that seems to reproducibly hit the > following assertion: > >  bdrv_co_pwritev: Assertion `!waited || !use_local_qiov' failed. > > I noticed that the padding code was recently reworked in commit > 2e2ad02f2c.

Re: [PATCH RFC] qapi: Allow getting flat output from 'query-named-block-nodes'

2019-12-17 Thread Markus Armbruster
Eric Blake writes: > On 12/17/19 1:36 AM, Markus Armbruster wrote: > >> Un-snipping the QAPI schema change: > > Sorry about that... > >> diff --git a/qapi/block-core.json b/qapi/block-core.json index 0cf68fea14..bd651106bd 100644 --- a/qapi/block-core.json +++ b/qapi/block-cor

[PATCH v2] blockjob: Fix error message for negative speed

2019-12-17 Thread Kevin Wolf
The error message for a negative speed uses QERR_INVALID_PARAMETER, which implies that the 'speed' option doesn't even exist: {"error": {"class": "GenericError", "desc": "Invalid parameter 'speed'"}} Make it use QERR_INVALID_PARAMETER_VALUE instead: {"error": {"class": "GenericError", "d

[PATCH 3/3] iotests: Test external snapshot with VM state

2019-12-17 Thread Kevin Wolf
This tests creating an external snapshot with VM state (which results in an active overlay over an inactive backing file, which is also the root node of an inactive BlockBackend), re-activating the images and performing some operations to test that the re-activation worked as intended. Signed-off-

[PATCH 0/3] block: Fix external snapshot with VM state

2019-12-17 Thread Kevin Wolf
This fixes bdrv_invalidate_cache_all() for some kinds of graphs where part of the nodes are active and others are inactive. This is a scenario that happens when libvirt takes an external snapshot with VM state. This was reported in: https://bugzilla.redhat.com/show_bug.cgi?id=1781637 ('qemu crashe

[PATCH 1/3] block: Activate recursively even for already active nodes

2019-12-17 Thread Kevin Wolf
bdrv_invalidate_cache_all() assumes that all nodes in a given subtree are either active or inactive when it starts. Therefore, as soon as it arrives at an already active node, it stops. However, this assumption is wrong. For example, it's possible to take a snapshot of an inactive node, which resu

[PATCH 2/3] hmp: Allow using qdev ID for qemu-io command

2019-12-17 Thread Kevin Wolf
In order to issue requests on an existing BlockBackend with the 'qemu-io' HMP command, allow specifying the BlockBackend not only with a BlockBackend name, but also with a qdev ID/QOM path for a device that owns the (possibly anonymous) BlockBackend. Because qdev names could be conflicting with Bl

Re: [PATCH v3 00/22] iotests: Allow ./check -o data_file

2019-12-17 Thread Max Reitz
On 07.11.19 17:36, Max Reitz wrote: > Hi, > > The cover letter from v1 (explaining the motivation behind this series > and the general structure) is here: > > https://lists.nongnu.org/archive/html/qemu-block/2019-09/msg01323.html > > > For v2, I’ve addressed more of Maxim’s comments: > - Patch

bdrv_co_pwritev: Assertion `!waited || !use_local_qiov' failed.

2019-12-17 Thread Peter Lieven
Hi all, I have a vserver running Qemu 4.0 that seems to reproducibly hit the following assertion:  bdrv_co_pwritev: Assertion `!waited || !use_local_qiov' failed. I noticed that the padding code was recently reworked in commit 2e2ad02f2c. In the new code I cannot find a similar assertion. W

Re: [PATCH] blockjob: Fix error message for negative speed

2019-12-17 Thread Max Reitz
On 26.11.19 14:42, Kevin Wolf wrote: > The error message for a negative speed uses QERR_INVALID_PARAMETER, > which implies that the 'speed' option doesn't even exist: > > {"error": {"class": "GenericError", "desc": "Invalid parameter 'speed'"}} > > Make it use QERR_INVALID_PARAMETER_VALUE ins

Re: [PATCH RFC] qapi: Allow getting flat output from 'query-named-block-nodes'

2019-12-17 Thread Eric Blake
On 12/17/19 1:36 AM, Markus Armbruster wrote: Un-snipping the QAPI schema change: Sorry about that... diff --git a/qapi/block-core.json b/qapi/block-core.json index 0cf68fea14..bd651106bd 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1752,6 +1752,8 @@ # # Get the nam

Re: [PATCH] virtio-blk: deprecate SCSI passthrough

2019-12-17 Thread Stefan Hajnoczi
On Fri, Dec 13, 2019 at 02:46:26PM +, Stefan Hajnoczi wrote: > The Linux virtio_blk.ko guest driver is removing legacy SCSI passthrough > support. Deprecate this feature in QEMU too. > > Signed-off-by: Stefan Hajnoczi > --- > qemu-deprecated.texi | 11 +++ > 1 file changed, 11 inser