Re: [PATCH 6/6] Rename "QEMU global mutex" to "BQL" in comments and docs

2023-11-29 Thread Markus Armbruster
Stefan Hajnoczi writes: > The term "QEMU global mutex" is identical to the more widely used Big > QEMU Lock ("BQL"). Update the code comments and documentation to use > "BQL" instead of "QEMU global mutex". > > Signed-off-by: Stefan Hajnoczi For QAPI Acked-by: Markus Armbruster

Re: [PATCH v3 0/7] Steps towards enabling -Wshadow=local

2023-09-28 Thread Markus Armbruster
Markus Armbruster writes: > Local variables shadowing other local variables or parameters make the > code needlessly hard to understand. Bugs love to hide in such code. > Evidence: PATCH 1. > > Enabling -Wshadow would prevent bugs like this one. But we'd have to > cle

[PATCH v3 4/7] block/dirty-bitmap: Clean up local variable shadowing

2023-09-21 Thread Markus Armbruster
Wolf Signed-off-by: Markus Armbruster Reviewed-by: Kevin Wolf --- block/monitor/bitmap-qmp-cmds.c | 19 ++- block/qcow2-bitmap.c| 3 +-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/block/monitor/bitmap-qmp-cmds.c b/block/monitor/bitmap-qmp

[PATCH v3 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-09-21 Thread Markus Armbruster
o make the macros that give us this problem use different variable names on every call. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- include/qapi/qmp/qobject.h | 10 -- include/qemu/atomic.h | 17 - include/qemu/compiler.h| 3 +++ include/qemu/osde

[PATCH v3 0/7] Steps towards enabling -Wshadow=local

2023-09-21 Thread Markus Armbruster
TCH 6: Rename local @tran instead of the parameter [Kevin] * PATCH 7: Drop PASTE(), use glue() instead [Richard]; pass identifiers instead of __COUNTER__ for readability [Eric]; add comments Markus Armbruster (7): migration/rdma: Fix save_page method to fail on polling error migration: C

[PATCH v3 1/7] migration/rdma: Fix save_page method to fail on polling error

2023-09-21 Thread Markus Armbruster
: core logic) Fixes: b390afd8c50b (migration/rdma: Fix out of order wrid) Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Peter Xu Reviewed-by: Li Zhijian --- migration/rdma.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/migration/rdma.c b

[PATCH v3 2/7] migration: Clean up local variable shadowing

2023-09-21 Thread Markus Armbruster
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=local. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster Reviewed-by: Peter Xu

[PATCH v3 3/7] ui: Clean up local variable shadowing

2023-09-21 Thread Markus Armbruster
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=local. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster Reviewed-by: Peter Maydell

[PATCH v3 6/7] block: Clean up local variable shadowing

2023-09-21 Thread Markus Armbruster
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=local. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster Reviewed-by: Stefan Hajnoczi

[PATCH v3 5/7] block/vdi: Clean up local variable shadowing

2023-09-21 Thread Markus Armbruster
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=local. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster Reviewed-by: Stefan Hajnoczi

Re: [PATCH v2 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-09-21 Thread Markus Armbruster
Kevin Wolf writes: > Am 20.09.2023 um 20:31 hat Markus Armbruster geschrieben: [...] >> diff --git a/include/qapi/qmp/qobject.h b/include/qapi/qmp/qobject.h >> index 9003b71fd3..d36cc97805 100644 >> --- a/include/qapi/qmp/qobject.h >> +++ b/include/qapi/qmp/qo

Re: [PATCH v2 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-09-20 Thread Markus Armbruster
Eric Blake writes: > On Wed, Sep 20, 2023 at 08:31:49PM +0200, Markus Armbruster wrote: > ... >> The only reliable way to prevent unintended variable name capture is >> -Wshadow. >> >> One blocker for enabling it is shadowing hiding in function-like >> ma

[PATCH v2 3/7] ui: Clean up local variable shadowing

2023-09-20 Thread Markus Armbruster
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=local. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster Reviewed-by: Peter Maydell

[PATCH v2 0/7] Steps towards enabling -Wshadow=local

2023-09-20 Thread Markus Armbruster
pass identifiers instead of __COUNTER__ for readability [Eric]; add comments Markus Armbruster (7): migration/rdma: Fix save_page method to fail on polling error migration: Clean up local variable shadowing ui: Clean up local variable shadowing block/dirty-bitmap: Clean up local variable

[PATCH v2 4/7] block/dirty-bitmap: Clean up local variable shadowing

2023-09-20 Thread Markus Armbruster
Wolf Signed-off-by: Markus Armbruster --- block/monitor/bitmap-qmp-cmds.c | 19 ++- block/qcow2-bitmap.c| 3 +-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/block/monitor/bitmap-qmp-cmds.c b/block/monitor/bitmap-qmp-cmds.c index 55f778f5af

[PATCH v2 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-09-20 Thread Markus Armbruster
o make the macros that give us this problem use different variable names on every call. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- include/qapi/qmp/qobject.h | 11 +-- include/qemu/atomic.h | 17 - include/qemu/compiler.h| 3 +++ include/qemu/o

[PATCH v2 2/7] migration: Clean up local variable shadowing

2023-09-20 Thread Markus Armbruster
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=local. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster Reviewed-by: Peter Xu

[PATCH v2 5/7] block/vdi: Clean up local variable shadowing

2023-09-20 Thread Markus Armbruster
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=local. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster Reviewed-by: Stefan Hajnoczi

[PATCH v2 1/7] migration/rdma: Fix save_page method to fail on polling error

2023-09-20 Thread Markus Armbruster
: core logic) Fixes: b390afd8c50b (migration/rdma: Fix out of order wrid) Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Peter Xu Reviewed-by: Li Zhijian --- migration/rdma.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/migration/rdma.c b

[PATCH v2 6/7] block: Clean up local variable shadowing

2023-09-20 Thread Markus Armbruster
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=local. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster Reviewed-by: Stefan Hajnoczi

Re: [PATCH 4/7] block/dirty-bitmap: Clean up local variable shadowing

2023-09-20 Thread Markus Armbruster
Kevin Wolf writes: > Am 19.09.2023 um 07:48 hat Markus Armbruster geschrieben: >> Kevin Wolf writes: >> >> > Am 31.08.2023 um 15:25 hat Markus Armbruster geschrieben: >> >> Local variables shadowing other local variables or parameters make the >> >&

Re: [PATCH 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-09-18 Thread Markus Armbruster
Eric Blake writes: > On Fri, Sep 01, 2023 at 10:48:26AM +0200, Markus Armbruster wrote: >> > Indeed, not fully understanding the preprocessor makes for some >> > interesting death traps. >> >> We use ALL_CAPS for macros to signal "watch out for tr

Re: [PATCH 4/7] block/dirty-bitmap: Clean up local variable shadowing

2023-09-18 Thread Markus Armbruster
Kevin Wolf writes: > Am 31.08.2023 um 15:25 hat Markus Armbruster geschrieben: >> Local variables shadowing other local variables or parameters make the >> code needlessly hard to understand. Tracked down with -Wshadow=local. >> Clean up: delete inner declarations w

Re: [PATCH 1/7] migration/rdma: Fix save_page method to fail on polling error

2023-09-18 Thread Markus Armbruster
Eric Blake writes: > On Thu, Aug 31, 2023 at 03:25:40PM +0200, Markus Armbruster wrote: >> qemu_rdma_save_page() reports polling error with error_report(), then >> succeeds anyway. This is because the variable holding the polling >> status *shadows* the variable the f

Re: [PATCH 6/7] block: Clean up local variable shadowing

2023-09-18 Thread Markus Armbruster
Kevin Wolf writes: > Am 31.08.2023 um 15:25 hat Markus Armbruster geschrieben: >> Local variables shadowing other local variables or parameters make the >> code needlessly hard to understand. Tracked down with -Wshadow=local. >> Clean up: delete inner declarations w

Re: [PATCH 5/7] block/vdi: Clean up local variable shadowing

2023-09-18 Thread Markus Armbruster
Kevin Wolf writes: > Am 31.08.2023 um 15:25 hat Markus Armbruster geschrieben: >> Local variables shadowing other local variables or parameters make the >> code needlessly hard to understand. Tracked down with -Wshadow=local. >> Clean up: delete inner declarations w

Re: [PATCH 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-09-01 Thread Markus Armbruster
Cédric Le Goater writes: > On 8/31/23 16:30, Eric Blake wrote: >> On Thu, Aug 31, 2023 at 03:25:46PM +0200, Markus Armbruster wrote: >> [This paragraph written last: Bear with my stream of consciousness >> review below, where I end up duplicating some of the conslusions you

Re: [PATCH 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-09-01 Thread Markus Armbruster
Eric Blake writes: > On Thu, Aug 31, 2023 at 03:25:46PM +0200, Markus Armbruster wrote: > > [This paragraph written last: Bear with my stream of consciousness > review below, where I end up duplicating some of the conslusions you > reached before the point where I saw where the p

Re: [PATCH 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-09-01 Thread Markus Armbruster
Richard Henderson writes: > On 8/31/23 06:25, Markus Armbruster wrote: >> +#define PASTE(a, b) a##b > > We already have glue() in qemu/compiler.h. Missed it, will fix. > The rest of it looks quite sensible. Thanks!

Re: [PATCH 3/7] ui: Clean up local variable shadowing

2023-09-01 Thread Markus Armbruster
Peter Maydell writes: > On Thu, 31 Aug 2023 at 14:25, Markus Armbruster wrote: >> >> Local variables shadowing other local variables or parameters make the >> code needlessly hard to understand. Tracked down with -Wshadow=local. >> Clean up: delete inner declarat

Re: [PATCH 0/7] Steps towards enabling -Wshadow=local

2023-09-01 Thread Markus Armbruster
Markus Armbruster writes: > Local variables shadowing other local variables or parameters make the > code needlessly hard to understand. Bugs love to hide in such code. > Evidence: PATCH 1. > > Enabling -Wshadow would prevent bugs like this one. But we'd have to > cle

[PATCH 6/7] block: Clean up local variable shadowing

2023-08-31 Thread Markus Armbruster
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=local. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster --- block.c

[PATCH 4/7] block/dirty-bitmap: Clean up local variable shadowing

2023-08-31 Thread Markus Armbruster
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=local. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster --- block/monitor/bitmap

[PATCH 5/7] block/vdi: Clean up local variable shadowing

2023-08-31 Thread Markus Armbruster
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=local. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster --- block/vdi.c | 7

[PATCH 0/7] Steps towards enabling -Wshadow=local

2023-08-31 Thread Markus Armbruster
.c target/riscv/vector_helper.c target/tricore/translate.c tcg/tcg.c tests/qtest/m48t59-test.c tests/qtest/pflash-cfi02-test.c tests/unit/test-throttle.c util/vhost-user-server.c Markus Armbruster (7): migration/rdma: Fix save_page method to fail on polling error migr

[PATCH 1/7] migration/rdma: Fix save_page method to fail on polling error

2023-08-31 Thread Markus Armbruster
: core logic) Fixes: b390afd8c50b (migration/rdma: Fix out of order wrid) Signed-off-by: Markus Armbruster --- migration/rdma.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index ca430d319d..b2e869aced 100644 --- a/migration/rdma.c +++ b

[PATCH 3/7] ui: Clean up local variable shadowing

2023-08-31 Thread Markus Armbruster
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=local. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster --- ui/gtk.c

[PATCH 2/7] migration: Clean up local variable shadowing

2023-08-31 Thread Markus Armbruster
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=local. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster --- migration/block.c | 4

[PATCH 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-08-31 Thread Markus Armbruster
o make the macros that give us this problem use different variable names on every call. Signed-off-by: Markus Armbruster --- include/qapi/qmp/qobject.h | 8 +--- include/qemu/atomic.h | 11 ++- include/qemu/osdep.h | 34 +++--- 3 files changed, 30

Re: [PATCH 0/2] Deprecate support for 32-bit x86 and arm hosts

2023-02-28 Thread Markus Armbruster
"Michael S. Tsirkin" writes: > On Tue, Feb 28, 2023 at 09:05:16PM +0100, Thomas Huth wrote: >> Well, without CI, I assume that the code will bitrot quite fast (considering >> that there are continuous improvements to TCG, for example). > > We have lots of hosts which we don't test with CI. They

Re: [PATCH 1/2] docs/about: Deprecate 32-bit x86 hosts and qemu-system-i386

2023-02-28 Thread Markus Armbruster
"Michael S. Tsirkin" writes: > On Tue, Feb 28, 2023 at 11:39:39AM +0100, Markus Armbruster wrote: >> The question to answer: Is 32 bit x86 worth its upkeep? Two >> sub-questions: 1. Is it worth the human attention? 2. Is it worth >> (scarce!) CI minutes? > &

Re: [PATCH 1/2] docs/about: Deprecate 32-bit x86 hosts and qemu-system-i386

2023-02-28 Thread Markus Armbruster
"Michael S. Tsirkin" writes: > On Tue, Feb 28, 2023 at 09:40:49AM +, Daniel P. Berrangé wrote: >> On Tue, Feb 28, 2023 at 10:14:52AM +0100, Thomas Huth wrote: >> > On 28/02/2023 10.03, Michael S. Tsirkin wrote: >> > > On Tue, Feb 28, 2023 at 08:59:52AM +, Daniel P. Berrangé wrote: >> > >

Re: [QEMU][PATCH v2 07/11] hw/xen/xen-hvm-common: Use g_new and error_setg_errno

2022-12-02 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 2/12/22 03:59, Vikram Garhwal wrote: >> Replace g_malloc with g_new and perror with error_setg_errno. >> >> Signed-off-by: Vikram Garhwal >> --- >> hw/xen/xen-hvm-common.c | 15 --- >> 1 file changed, 8 insertions(+), 7 deletions(-) > > >> @@ -

Re: [PATCH v13 17/17] net: stream: add QAPI events to report connection state

2022-10-24 Thread Markus Armbruster
Stefano Brivio writes: > On Mon, 24 Oct 2022 13:00:09 +0200 > Markus Armbruster wrote: > >> Markus Armbruster writes: >> >> > Cc: Stefano Brivio >> > >> > Laurent Vivier writes: >> > >> >> On 10/21/22 07:48, Markus Arm

Re: [PATCH v14 17/17] net: stream: add QAPI events to report connection state

2022-10-24 Thread Markus Armbruster
;: { "seconds": 1666341430, "microseconds": 968694 }, > "event": "NETDEV_STREAM_DISCONNECTED", > "data": { "netdev-id": "netdev0" } } > > Signed-off-by: Laurent Vivier > Acked-by: Michael S. Tsirkin QAPI schema Acked-by: Markus Armbruster

Re: [PATCH v13 17/17] net: stream: add QAPI events to report connection state

2022-10-24 Thread Markus Armbruster
Markus Armbruster writes: > Cc: Stefano Brivio > > Laurent Vivier writes: > >> On 10/21/22 07:48, Markus Armbruster wrote: >>> Laurent Vivier writes: >>> >>>> The netdev reports NETDEV_STREAM_CONNECTED event when the backend >>>

Re: [PATCH v14 15/17] net: stream: move to QIO to enable additional parameters

2022-10-21 Thread Markus Armbruster
Laurent Vivier writes: > On 10/21/22 12:35, Markus Armbruster wrote: >> Philippe Mathieu-Daudé writes: >> >>> On 21/10/22 11:09, Laurent Vivier wrote: >>>> Use QIOChannel, QIOChannelSocket and QIONetListener. >>>> This allows net/stream

Re: [PATCH v13 17/17] net: stream: add QAPI events to report connection state

2022-10-21 Thread Markus Armbruster
Stefano Brivio writes: > [Cc: Laine, full quote] > > On Fri, 21 Oct 2022 11:12:20 +0200 > Markus Armbruster wrote: > >> Cc: Stefano Brivio >> >> Laurent Vivier writes: >> >> > On 10/21/22 07:48, Markus Armbruster wrote: >> >>

Re: [PATCH v14 15/17] net: stream: move to QIO to enable additional parameters

2022-10-21 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 21/10/22 11:09, Laurent Vivier wrote: >> Use QIOChannel, QIOChannelSocket and QIONetListener. >> This allows net/stream to use all the available parameters provided by >> SocketAddress. >> Signed-off-by: Laurent Vivier >> Acked-by: Michael S. Tsirkin >> --- >

Re: [PATCH v13 17/17] net: stream: add QAPI events to report connection state

2022-10-21 Thread Markus Armbruster
Laurent Vivier writes: > On 10/21/22 11:12, Markus Armbruster wrote: >> Cc: Stefano Brivio >> >> Laurent Vivier writes: >> >>> On 10/21/22 07:48, Markus Armbruster wrote: >>>> Laurent Vivier writes: >>>> >>>>>

Re: [PATCH v13 17/17] net: stream: add QAPI events to report connection state

2022-10-21 Thread Markus Armbruster
Cc: Stefano Brivio Laurent Vivier writes: > On 10/21/22 07:48, Markus Armbruster wrote: >> Laurent Vivier writes: >> >>> The netdev reports NETDEV_STREAM_CONNECTED event when the backend >>> is connected, and NETDEV_STREAM_DISCONNECTED when it is disconnec

Re: [PATCH v13 00/17] qapi: net: add unix socket type support to netdev backend

2022-10-20 Thread Markus Armbruster
Jason Wang writes: > I've queued this version and will send pull requests shortly. > > Any future comment we can do patches on top. Please give Laurent and me a few hours to try to improve PATCH 17's commit message. Which you could then integrate without a respin.

Re: [PATCH v13 17/17] net: stream: add QAPI events to report connection state

2022-10-20 Thread Markus Armbruster
Laurent Vivier writes: > The netdev reports NETDEV_STREAM_CONNECTED event when the backend > is connected, and NETDEV_STREAM_DISCONNECTED when it is disconnected. Use cases? Could similar event signalling be useful for other kinds of netdev backends? > The NETDEV_STREAM_CONNECTED event include

Re: [PATCH v11 17/17] net: stream: add QAPI events to report connection state

2022-10-20 Thread Markus Armbruster
Sorry for the slow replay, too many distractions... Laurent Vivier writes: > On 10/17/22 15:23, Markus Armbruster wrote: >> Laurent Vivier writes: >> >>> The netdev reports NETDEV_STREAM_CONNECTED event when the backend >>> is connected, and NETDEV_S

Re: [PATCH v11 17/17] net: stream: add QAPI events to report connection state

2022-10-17 Thread Markus Armbruster
Laurent Vivier writes: > The netdev reports NETDEV_STREAM_CONNECTED event when the backend > is connected, and NETDEV_STREAM_EOC when it is disconnected. > > The NETDEV_STREAM_CONNECTED event includes the URI of the destination > address. > > Signed-off-by: Laurent Vivier > Acked-by: Michael S.

Re: [PATCH v11 12/17] net: dgram: add unix socket

2022-10-17 Thread Markus Armbruster
Laurent Vivier writes: > Signed-off-by: Laurent Vivier > Reviewed-by: Stefano Brivio > Reviewed-by: David Gibson > Acked-by: Michael S. Tsirkin QAPI schema Acked-by: Markus Armbruster

Re: [PATCH v11 09/17] net: stream: add unix socket

2022-10-17 Thread Markus Armbruster
Laurent Vivier writes: > Signed-off-by: Laurent Vivier > Reviewed-by: Stefano Brivio > Acked-by: Michael S. Tsirkin QAPI schema Acked-by: Markus Armbruster

Re: [PATCH 1/9] hw/riscv/sifive_e: Fix inheritance of SiFiveEState

2022-09-20 Thread Markus Armbruster
Bernhard Beschow writes: > Am 20. September 2022 11:36:47 UTC schrieb Markus Armbruster > : >>Alistair Francis writes: >> >>> On Tue, Sep 20, 2022 at 9:18 AM Bernhard Beschow wrote: >>>> >>>> SiFiveEState inherits from SysBusDevice

Re: [PATCH 1/9] hw/riscv/sifive_e: Fix inheritance of SiFiveEState

2022-09-20 Thread Markus Armbruster
Alistair Francis writes: > On Tue, Sep 20, 2022 at 9:18 AM Bernhard Beschow wrote: >> >> SiFiveEState inherits from SysBusDevice while it's TypeInfo claims it to >> inherit from TYPE_MACHINE. This is an inconsistency which can cause >> undefined behavior such as memory corruption. >> >> Change S

Re: [PATCH 3/3] Use g_new() & friends where that makes obvious sense

2022-03-15 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 15/3/22 14:59, Markus Armbruster wrote: >> Alex Bennée writes: >> >>> Markus Armbruster writes: >>> >>>> g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, >>>> for two reasons

[PATCH v2 3/3] Use g_new() & friends where that makes obvious sense

2022-03-15 Thread Markus Armbruster
form sizeof(T). Patch created mechanically with: $ spatch --in-place --sp-file scripts/coccinelle/use-g_new-etc.cocci \ --macro-file scripts/cocci-macro-file.h FILES... Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Review

[PATCH v2 0/3] Use g_new() & friends where that makes obvious sense

2022-03-15 Thread Markus Armbruster
ATCH 3: Change to scripts/coverity-scan/model.c dropped [Eric] * PATCH 3: Change to semihosting/config.c dropped [Alex] * Commit messages tweaked Markus Armbruster (3): scripts/coccinelle: New use-g_new-etc.cocci 9pfs: Use g_new() & friends where that makes obvious sense U

[PATCH v2 2/3] 9pfs: Use g_new() & friends where that makes obvious sense

2022-03-15 Thread Markus Armbruster
. Cc: Greg Kurz Cc: Christian Schoenebeck Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Christian Schoenebeck Reviewed-by: Alex Bennée Reviewed-by: Greg Kurz --- hw/9pfs/9p-proxy.c | 2 +- hw/9pfs/9p-synth.c | 4 ++-- hw/9pfs

[PATCH v2 1/3] scripts/coccinelle: New use-g_new-etc.cocci

2022-03-15 Thread Markus Armbruster
This is the semantic patch from commit b45c03f585 "arm: Use g_new() & friends where that makes obvious sense". Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée --- scripts/coccinelle/use-g_new-

Re: [PATCH 3/3] Use g_new() & friends where that makes obvious sense

2022-03-15 Thread Markus Armbruster
Eric Blake writes: > On Mon, Mar 14, 2022 at 05:01:08PM +0100, Markus Armbruster wrote: >> g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, >> for two reasons. One, it catches multiplication overflowing size_t. >> Two, it returns T * rather t

Re: [PATCH 3/3] Use g_new() & friends where that makes obvious sense

2022-03-15 Thread Markus Armbruster
Alex Bennée writes: > Markus Armbruster writes: > >> g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, >> for two reasons. One, it catches multiplication overflowing size_t. >> Two, it returns T * rather than void *, which lets the compi

Re: [PATCH 3/3] Use g_new() & friends where that makes obvious sense

2022-03-15 Thread Markus Armbruster
Alex Bennée writes: > Markus Armbruster writes: > >> g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, >> for two reasons. One, it catches multiplication overflowing size_t. >> Two, it returns T * rather than void *, which lets the compi

Re: [PATCH 3/3] Use g_new() & friends where that makes obvious sense

2022-03-14 Thread Markus Armbruster
Peter Maydell writes: > On Mon, 14 Mar 2022 at 16:01, Markus Armbruster wrote: >> >> g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, >> for two reasons. One, it catches multiplication overflowing size_t. >> Two, it returns T * rather than

[PATCH 1/3] scripts/coccinelle: New use-g_new-etc.cocci

2022-03-14 Thread Markus Armbruster
This is the semantic patch from commit b45c03f585 "arm: Use g_new() & friends where that makes obvious sense". Signed-off-by: Markus Armbruster --- scripts/coccinelle/use-g_new-etc.cocci | 75 ++ 1 file changed, 75 insertions(+) create mode 100644 scripts/

[PATCH 2/3] 9pfs: Use g_new() & friends where that makes obvious sense

2022-03-14 Thread Markus Armbruster
Cc: Christian Schoenebeck Signed-off-by: Markus Armbruster --- hw/9pfs/9p-proxy.c | 2 +- hw/9pfs/9p-synth.c | 4 ++-- hw/9pfs/9p.c | 8 hw/9pfs/codir.c | 6 +++--- tests/qtest/virtio-9p-test.c | 4 ++-- 5 files changed, 12 insertions(+), 12 d

[PATCH 3/3] Use g_new() & friends where that makes obvious sense

2022-03-14 Thread Markus Armbruster
form sizeof(T). Patch created mechanically with: $ spatch --in-place --sp-file scripts/coccinelle/use-g_new-etc.cocci \ --macro-file scripts/cocci-macro-file.h FILES... Signed-off-by: Markus Armbruster --- include/qemu/timer.h | 2 +- accel/kvm/kvm-

[PATCH 0/3] Use g_new() & friends where that makes obvious

2022-03-14 Thread Markus Armbruster
can deal with conflicts by dropping conflicting hunks, with "git-pull -s recursive -X ours". Or drop entire files with conflicts. If you want me to split off certain parts, please tell me exactly what you want split off, and I'll gladly do the splitting. I don't mind the splitt

Re: [RFC PATCH 02/10] accel: Use qemu_security_policy_taint(), mark KVM and Xen as safe

2021-10-21 Thread Markus Armbruster
It's been a while... Daniel P. Berrangé writes: > On Thu, Sep 09, 2021 at 01:20:16AM +0200, Philippe Mathieu-Daudé wrote: >> Add the AccelClass::secure_policy_supported field to classify >> safe (within security boundary) vs unsafe accelerators. >> >> Signed-off-by: Philippe Mathieu-Daudé >> -

Re: [PATCH 0/5] qapi: Restrict machine (and migration) specific commands

2020-10-05 Thread Markus Armbruster
Paolo Bonzini writes: > On 05/10/20 10:01, Markus Armbruster wrote: >> Philippe Mathieu-Daudé writes: >> >>> Reduce the machine code pulled into qemu-storage-daemon. >> I'm leaving review to Eduardo and Marcel for PATCH 1-4, and to David and >&g

Re: [PATCH 0/5] qapi: Restrict machine (and migration) specific commands

2020-10-05 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > Reduce the machine code pulled into qemu-storage-daemon. I'm leaving review to Eduardo and Marcel for PATCH 1-4, and to David and Juan for PATCH 5. David already ACKed. Can do the pull request.

Re: [PATCH 2/2] qdev: Let BusRealize() return a boolean value to indicate error

2020-09-21 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 9/21/20 10:19 AM, Markus Armbruster wrote: >> Philippe Mathieu-Daudé writes: >> >>> Commit 9940b2cfbc0 introduced qdev_realize() and qbus_realize() >>> with the ability to return a boolean value if an error occured, >>&

Re: [PATCH 2/2] qdev: Let BusRealize() return a boolean value to indicate error

2020-09-21 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > Commit 9940b2cfbc0 introduced qdev_realize() and qbus_realize() > with the ability to return a boolean value if an error occured, > thus the caller does not need to check if the Error* pointer is > set. > Provide the same ability to the BusRealize type. > > Signed

Re: [RFC PATCH-for-5.2 v2 2/2] block/block-backend: Let blk_attach_dev() provide helpful error

2020-07-16 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Thu, Jul 16, 2020 at 02:37:04PM +0200, Philippe Mathieu-Daudé wrote: >> Let blk_attach_dev() take an Error* object to return helpful >> information. Adapt the callers. >> >> $ qemu-system-arm -M n800 >> qemu-system-arm: sd_init failed: cannot attach blk 'sd0'

Re: [PATCH] trivial: Remove trailing whitespaces

2020-07-07 Thread Markus Armbruster
obably better to > split the patch approx into subsystems. That will make it much easier > to cherry-pick for people doing backports. I doubt that's worth the trouble. Acked-by: Markus Armbruster

Re: [PATCH v12 1/8] error: New macro ERRP_AUTO_PROPAGATE()

2020-07-07 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > 07.07.2020 19:50, Markus Armbruster wrote: >> From: Vladimir Sementsov-Ogievskiy >> >> Introduce a new ERRP_AUTO_PROPAGATE macro, to be used at start of >> functions with an errp OUT parameter. >> >> It has three goa

Re: [PATCH v12 2/8] scripts: Coccinelle script to use ERRP_AUTO_PROPAGATE()

2020-07-07 Thread Markus Armbruster
Eric Blake writes: > On 7/7/20 11:50 AM, Markus Armbruster wrote: >> From: Vladimir Sementsov-Ogievskiy >> >> Script adds ERRP_AUTO_PROPAGATE macro invocation where appropriate and >> does corresponding changes in code (look for details in >> include/qapi/error.

Re: [PATCH v12 1/8] error: New macro ERRP_AUTO_PROPAGATE()

2020-07-07 Thread Markus Armbruster
Eric Blake writes: > On 7/7/20 11:50 AM, Markus Armbruster wrote: >> From: Vladimir Sementsov-Ogievskiy >> >> Introduce a new ERRP_AUTO_PROPAGATE macro, to be used at start of >> functions with an errp OUT parameter. >> >> It has three goals:

[PATCH v12 7/8] nbd: Use ERRP_AUTO_PROPAGATE()

2020-07-07 Thread Markus Armbruster
Wolf Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Markus Armbruster [Commit message tweaked] Signed-off-by: Markus Armbruster --- include/block/nbd.h | 1 + block/nbd.c | 7 +++ nbd/client.c| 5 + nbd/server.c| 5 + 4 files chan

[PATCH v12 4/8] pflash: Use ERRP_AUTO_PROPAGATE()

2020-07-07 Thread Markus Armbruster
Wolf Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Philippe Mathieu-Daudé [Commit message tweaked] Signed-off-by: Markus Armbruster --- hw/block/pflash_cfi01.c | 7 +++ hw/block/pflash_cfi02.c | 7 +++ 2 files changed, 6 insertions(+), 8 deletions(-) diff

[PATCH v12 8/8] xen: Use ERRP_AUTO_PROPAGATE()

2020-07-07 Thread Markus Armbruster
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Philippe Mathieu-Daudé [Commit message tweaked] Signed-off-by: Markus Armbruster --- hw/block/dataplane/xen-block.c | 17 +++--- hw/block/xen-block.c | 102 ++--- hw/pci-host/xen_igd_pt.c |

[PATCH v12 2/8] scripts: Coccinelle script to use ERRP_AUTO_PROPAGATE()

2020-07-07 Thread Markus Armbruster
-macro-file.h --in-place --no-show-diff \ --max-width 80 FILES... Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/coccinelle/auto-propagated-errp.cocci | 337 ++ include/qapi/error.h

[PATCH v12 3/8] sd: Use ERRP_AUTO_PROPAGATE()

2020-07-07 Thread Markus Armbruster
rted-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Philippe Mathieu-Daudé [Commit message tweaked] Signed-off-by: Markus Armbruster --- hw/sd/sdhci-pci.c | 7 +++ hw/sd/sdhci.c | 21 + hw/sd/ssi-sd.c| 10 +- 3 files changed, 17 inserti

[PATCH v12 1/8] error: New macro ERRP_AUTO_PROPAGATE()

2020-07-07 Thread Markus Armbruster
ed for clarity. Put ERRP_AUTO_PROPAGATE() before its helpers, and touch up style. Commit message tweaked.] Signed-off-by: Markus Armbruster --- include/qapi/error.h | 160 ++- 1 file changed, 141 insertions(+), 19 deletions(-) diff --git a/include/qapi/er

[PATCH v12 6/8] virtio-9p: Use ERRP_AUTO_PROPAGATE()

2020-07-07 Thread Markus Armbruster
Signed-off-by: Vladimir Sementsov-Ogievskiy Acked-by: Greg Kurz Reviewed-by: Christian Schoenebeck [Commit message tweaked] Signed-off-by: Markus Armbruster --- hw/9pfs/9p-local.c | 12 +--- hw/9pfs/9p.c | 1 + 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/hw

[PATCH v12 0/8] error: auto propagated local_err part I

2020-07-07 Thread Markus Armbruster
To speed things up, I'm taking the liberty to respin Vladimir's series with my documentation amendments. After my documentation work, I'm very much inclined to rename ERRP_AUTO_PROPAGATE() to ERRP_GUARD(). The fact that it propagates below the hood is detail. What matters to its users is that it

[PATCH v12 5/8] fw_cfg: Use ERRP_AUTO_PROPAGATE()

2020-07-07 Thread Markus Armbruster
Wolf Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Philippe Mathieu-Daudé [Commit message tweaked] Signed-off-by: Markus Armbruster --- hw/nvram/fw_cfg.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/hw/nvram/fw_cfg.c b/hw/

Re: [PATCH v11 8/8] xen: introduce ERRP_AUTO_PROPAGATE

2020-07-06 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 7/3/20 11:08 AM, Vladimir Sementsov-Ogievskiy wrote: >> If we want to add some info to errp (by error_prepend() or >> error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. >> Otherwise, this info will not be added when errp == &error_fatal >> (the pr

Re: [PATCH v11 1/8] error: auto propagated local_err

2020-07-05 Thread Markus Armbruster
ewed-by: Greg Kurz > Reviewed-by: Eric Blake > --- > > Cc: Eric Blake > Cc: Kevin Wolf > Cc: Max Reitz > Cc: Greg Kurz > Cc: Christian Schoenebeck > Cc: Stefan Hajnoczi > Cc: Stefano Stabellini > Cc: Anthony Perard > Cc: Paul Durrant > Cc: "Phili

Re: [PATCH 2/2] xen: cleanup unrealized flash devices

2020-07-01 Thread Markus Armbruster
Jason Andryuk writes: > On Wed, Jul 1, 2020 at 3:03 AM Paul Durrant wrote: >> >> > -Original Message- >> > From: Philippe Mathieu-Daudé >> > Sent: 30 June 2020 18:27 >> > To: p...@xen.org; xen-devel@lists.xenproject.org; qemu-de...@nongnu.org >> > Cc: 'Eduardo Habkost' ; 'Michael S. Tsi

Re: [PATCH 2/2] xen: cleanup unrealized flash devices

2020-06-30 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 6/30/20 5:44 PM, Paul Durrant wrote: >>> -Original Message- >>> From: Philippe Mathieu-Daudé >>> Sent: 30 June 2020 16:26 >>> To: Paul Durrant ; xen-devel@lists.xenproject.org; >>> qemu-de...@nongnu.org >>> Cc: Eduardo Habkost ; Michael S. Tsirkin >>

Re: [PATCH 2/2] xen: cleanup unrealized flash devices

2020-06-30 Thread Markus Armbruster
Anthony PERARD writes: > On Wed, Jun 24, 2020 at 01:18:41PM +0100, Paul Durrant wrote: >> From: Paul Durrant >> >> The generic pc_machine_initfn() calls pc_system_flash_create() which creates >> 'system.flash0' and 'system.flash1' devices. These devices are then realized >> by pc_system_flash_m

Re: [PATCH v10 1/9] error: auto propagated local_err

2020-06-24 Thread Markus Armbruster
Greg Kurz writes: > On Mon, 15 Jun 2020 07:21:03 +0200 > Markus Armbruster wrote: > >> Greg Kurz writes: >> >> > On Tue, 17 Mar 2020 18:16:17 +0300 >> > Vladimir Sementsov-Ogievskiy wrote: >> > >> >> Introduce a new ERRP_AUTO_PRO

Re: sysbus failed assert for xen_sysdev

2020-06-23 Thread Markus Armbruster
Jason Andryuk writes: > On Mon, Jun 22, 2020 at 5:17 PM Mark Cave-Ayland > wrote: >> >> On 22/06/2020 21:33, Jason Andryuk wrote: >> >> > Hi, >> > >> > Running qemu devel for a Xen VM is failing an assert after the recent >> > "qdev: Rework how we plug into the parent bus" sysbus changes. >> > >

Re: [PATCH v10 1/9] error: auto propagated local_err

2020-06-14 Thread Markus Armbruster
Greg Kurz writes: > On Tue, 17 Mar 2020 18:16:17 +0300 > Vladimir Sementsov-Ogievskiy wrote: > >> Introduce a new ERRP_AUTO_PROPAGATE macro, to be used at start of >> functions with an errp OUT parameter. >> >> It has three goals: >> >> 1. Fix issue with error_fatal and error_prepend/error_app

Re: [PATCH v8 2/8] block: consolidate blocksize properties consistency checks

2020-05-29 Thread Markus Armbruster
Roman Kagan writes: > Several block device properties related to blocksize configuration must > be in certain relationship WRT each other: physical block must be no > smaller than logical block; min_io_size, opt_io_size, and > discard_granularity must be a multiple of a logical block. > > To ensu

  1   2   >