Re: [Xen-devel] [RFC v2 6/9] scripts: add coccinelle script to use auto propagated errp

2019-09-23 Thread Eric Blake
On 9/23/19 3:05 PM, Eric Blake wrote: > Does running this Coccinelle script 2 times in a row add a second > ERRP_FUNCTION_BEGIN() line? We want it to be idempotent (no changes on > a second run). (Admittedly, I did not actually test that yet). Also, I > don't know if this

Re: [Xen-devel] [RFC v2 7/9] Use auto-propagated errp

2019-09-23 Thread Eric Blake
ype_uint64(v, name, &value, errp); > +if (*errp) { > } else if (value > max) { > error_setg(errp, QERR_INVALID_PARAMETER_VALUE, > name ? name : "null", type); Results in an empty if which looks funny. This one could be a manual

Re: [Xen-devel] [RFC v2 1/9] error: auto propagated local_err

2019-09-23 Thread Eric Blake
ration, so we're already on fuzzy ground). We could make this macro expansion one line shorter and still be correct, but I'm not going to insist (we'll see what consensus is, and/or what Markus says). > + > + > /* > * Special error destination to abort on error. &g

Re: [Xen-devel] [RFC v2 6/9] scripts: add coccinelle script to use auto propagated errp

2019-09-23 Thread Eric Blake
rrp); > +| > +-error_propagate(errp, local_err); > +) > + ...> > + } > + > +@@ > +identifier rule1.fn; > +identifier rule1.local_err; > +@@ > + > + fn(...) > + { > + <... > +( > +-&local_err > ++errp > +| > +-local_err

Re: [Xen-devel] [RFC v2 3/9] errp: rename errp to errp_in where it is IN-argument

2019-09-23 Thread Eric Blake
h | 8 > ui/vnc.h | 2 +- > monitor/hmp-cmds.c| 8 > ui/vnc.c | 10 +- > util/error.c | 2 +- > 6 files changed, 16 insertions(+), 16 deletions(-) This is worthwhile, regardless of the fate of the rest of the series.

Re: [Xen-devel] [RFC v2 4/9] hw/core/loader-fit: fix freeing errp in fit_load_fdt

2019-09-23 Thread Eric Blake
e the (fixed) 2-3 (to rely on the new error_free_errp), or you could open-code the assignment of errp=NULL to take this on its own, regardless of the hfate of the rest of the series. Reviewed-by: Eric Blake > diff --git a/hw/core/loader-fit.c b/hw/core/loader-fit.c > index 953b16bc82..fe5bcc

Re: [Xen-devel] [RFC v2 2/9] qapi/error: add (Error **errp) cleaning APIs

2019-09-23 Thread Eric Blake
b/util/error.c > @@ -273,9 +273,9 @@ void error_free(Error *err) > > void error_free_or_abort(Error **errp) > { > -assert(errp && *errp); > -error_free(*errp); > -*errp = NULL; > +assert(errp_in && *errp_in); > +error_free(*errp_in); > +

Re: [Xen-devel] [RFC v2 5/9] net/net: fix local variable shadowing in net_client_init

2019-09-23 Thread Eric Blake
p;& qemus_strtoul(...)) { > error_setg(errp, QERR_INVALID_PARAMETER_VALUE, > "ipv6-prefixlen", "a number"); > goto out; > Either way, Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engine

Re: [Xen-devel] [RFC v2 0/9] error: auto propagated local_err

2019-09-23 Thread Eric Blake
.h | 61 - > target/ppc/kvm_ppc.h | 3 + > target/s390x/cpu_models.h | 3 + > ui/vnc.h | 2 +- > vl.c | 13 +- > scripts/co

Re: [Xen-devel] [RFC v2 0/9] error: auto propagated local_err

2019-09-24 Thread Eric Blake
rrp.cocci | 82 +++ >>> 319 files changed, 2729 insertions(+), 4245 deletions(-) >>> create mode 100644 scripts/coccinelle/auto-propagated-errp.cocci >> >> The diffstat is huge, but promising. We also learned in reviews of 7/9 that the diffstat here is mislead

Re: [Xen-devel] [Qemu-devel] [PATCH] configure: Don't add Xen's libs to LDFLAGS

2019-01-24 Thread Eric Blake
On 1/24/19 2:45 AM, Markus Armbruster wrote: >> Signed-off-by: Michael Tokarev >> Revieved-by: Michael Tokarev > > Typo in Reviewed-by. Should we tighten checkpatch.pl to flag suspicious-looking 'xxx-by:' tags, to catch instances of typos? -- Eric Blake, Princip

Re: [Xen-devel] [Qemu-devel] [PATCH] configure: Don't add Xen's libs to LDFLAGS

2019-02-04 Thread Eric Blake
On 1/24/19 12:29 PM, Peter Maydell wrote: > On Thu, 24 Jan 2019 at 17:40, Eric Blake wrote: >> >> On 1/24/19 2:45 AM, Markus Armbruster wrote: >> >>>> Signed-off-by: Michael Tokarev >>>> Revieved-by: Michael Tokarev >>> >>> Typ

Re: [Xen-devel] [Qemu-devel] [PATCH v3 00/25] chardev: Convert qemu_chr_write() to take a size_t argument

2019-02-20 Thread Eric Blake
gence to check callers I think its a win to be consistent > with libc APIs in size_t usage for read/write. And hopefully this exercise of making the conversion serves as a good audit to help us gain confidence in our code and/or fix bugs it uncovers. -- Eric Blake, Principal Software E

Re: [Xen-devel] [Qemu-devel] [PATCH] xen-block: Replace qdict_put_obj() by qdict_put() where appropriate

2019-03-13 Thread Eric Blake
by: Markus Armbruster > --- > hw/block/xen-block.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > Reviewed-by: Eric Blake Safe for 4.0 softfreeze in my opinion, but also harmless if it slips to 4.1. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-3

Re: [Xen-devel] [RFC v5 000/126] error: auto propagated local_err

2019-11-20 Thread Eric Blake
less rebasing needed if we can apply the entire cleanup right as 5.0 development opens in a couple of weeks. If no objections during a week, I'll start that plan, hope someone will support it. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virt

Re: [Xen-devel] [RFC v5 024/126] error: auto propagated local_err

2019-12-05 Thread Eric Blake
a propagations (in fact, error_propagate is called, but returns immediately on first if (!local_err)) -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org __

Re: [Xen-devel] [RFC v5 025/126] scripts: add coccinelle script to use auto propagated errp

2019-10-11 Thread Eric Blake
On 10/11/19 12:12 PM, Eric Blake wrote: On 10/11/19 11:04 AM, Vladimir Sementsov-Ogievskiy wrote: Signed-off-by: Vladimir Sementsov-Ogievskiy --- +@@ +identifier rule1.fn; +identifier rule1.local_err; +@@ + + fn(...) + { + <... +( +-    error_free(local_err); +-    local_err = N

Re: [Xen-devel] [RFC v5 025/126] scripts: add coccinelle script to use auto propagated errp

2019-10-11 Thread Eric Blake
clients will reappear later)? +@@ +identifier rule1.fn; +identifier rule1.local_err; +@@ + + fn(...) + { + <... +( +-&local_err ++errp +| +-local_err ++*errp +) + ...> + } + +@@ +symbol errp; +@@ + +- *errp != NULL ++ *errp Seems to make sense. -- Eric Blak

Re: [Xen-devel] [RFC v5 000/126] error: auto propagated local_err

2019-10-11 Thread Eric Blake
e commit-per-subsystem.py, the overall series appears to be a nice reduction in lines of code. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org ___ Xen-devel mailing list Xen-de

Re: [Xen-devel] [RFC v5 025/126] scripts: add coccinelle script to use auto propagated errp

2019-10-14 Thread Eric Blake
.h), so we'll just have to see what is possible. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproje

Re: [Xen-devel] [RFC v5 024/126] error: auto propagated local_err

2019-11-08 Thread Eric Blake
altogether for &error_abort). You are correct that any exit() will now happen during cleanup, but that is an undetectable change (there is no stack trace present for &error_fatal, so calling error_propagate at a later point in time does not affect the observable end behavior). -- Eric Bl

Re: [Xen-devel] [Qemu-devel] [Qemu-block] [PATCH 02/18] xen: introduce new 'XenBus' and 'XenDevice' object hierarchy

2018-11-28 Thread Eric Blake
several existing files: $ git grep -il 'all rights reserved' |wc 138 1383557 but we should be striving to clean those up, not adding to the mess. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org _

Re: [Xen-devel] [PATCH 2/2] avoid TABs in files that only contain a few

2018-12-14 Thread Eric Blake
| 2 +- NBD part: Acked-by: Eric Blake but I have patches that remove the line in question entirely as part of adding 'qemu-nbd --list'. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.or

Re: [Xen-devel] [Qemu-devel] [PATCH 16/16] configure: do_compiler: Dump some extra info under bash

2018-04-23 Thread Eric Blake
ary because syntax errors are not like set -e errors: > they cause the shell process to exit. See above - a well-quoted eval is sufficient to avoid a subshell. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org signatu

Re: [Xen-devel] [Qemu-devel] [PATCH 15/16] os-posix: cleanup: Replace perror with error_report

2018-04-24 Thread Eric Blake
s to many other useful extensions). It's rather telling that 'git grep strerror_r' currently comes up empty. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org signature.asc Description: OpenPGP digital sig

Re: [Xen-devel] [Qemu-devel] [PATCH 15/16] os-posix: cleanup: Replace perror with error_report

2018-04-24 Thread Eric Blake
On 04/24/2018 10:40 AM, Eric Blake wrote: > On 04/24/2018 10:18 AM, Daniel P. Berrangé wrote: > >>> - static void vreport(report_type type, const char *fmt, va_list ap) >>> + static void vreport(report_type type, int errnoval, const char *fmt, >>> va_list ap

Re: [Xen-devel] [PATCH 01/16] checkpatch: Add xendevicemodel_handle to the list of types

2018-04-26 Thread Eric Blake
positives from checkpatch (although documenting it in the commit message and/or cover letter never hurts, when you are intentionally ignoring a false positive). But, as there has also been a recent patch to teach checkpatch about glib types [1], your patch makes sense (any merge conflict between

Re: [Xen-devel] [Qemu-devel] [PATCH 0/2] xen-hvm: use new resource mapping API

2018-05-09 Thread Eric Blake
_handle doesn't follow our usual conventions for a type name. See commit 5ac067a if you want to add it to the list of whitelisted exception type names, to silence messages like this. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qe

Re: [Xen-devel] [PATCH v2 2/3] checkpatch: generalize xen handle matching in the list of types

2018-05-10 Thread Eric Blake
A previous patch (5ac067a24a8) added xendevicemodel_handle to the list of types. This patch changes that to xen\w+_handle such that it will match all Xen stable API handles of the forms detailed above. Nice use of a regex. Signed-off-by: Paul Durrant --- Cc: Eric Blake Cc: Paolo Bonzini Cc

Re: [Xen-devel] [Qemu-devel] [PATCH v2 3/3] xen-hvm: try to use xenforeignmemory_map_resource() to map ioreq pages

2018-05-15 Thread Eric Blake
ss any of these would work. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH] qemu: include generated files with <> and not ""

2018-03-20 Thread Eric Blake
other alternatives that solve the real issue of stale generated files breaking incremental builds. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org ___ Xen-devel mailing list Xen-de

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

2018-03-22 Thread Eric Blake
not 100% sold on it (as you say, it's now slightly more work for writers), but I'm not coming up with any solid reasons why it should not be applied (at least, for 2.13 - doing it during freeze for 2.12 is a bit harder to justify). -- Eric Blake, Principal Software Engineer Red

Re: [Xen-devel] [libvirt] Likely build race, "/usr/bin/ld: cannot find -lvirt"

2018-06-12 Thread Eric Blake
because it thinks you are overriding its defaults? I know that getting automake to add a dependency is not always trivial, but that it should be possible (my strengths lie more on autoconf than on automake). -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266

Re: [Xen-devel] [Qemu-devel] [PATCH v4 11/40] hw/xen: Use the IEC binary prefix definitions

2018-06-12 Thread Eric Blake
the value: use of 64-bit math is explicit based on the type of what else is being multiplied by the macro. Potential downside: 32*32 assigned to a 64-bit result may be botched (but hopefully Coverity will flag it). So there's tradeoffs either way, and you at least need to document in

Re: [Xen-devel] [Qemu-devel] [PATCH v4 11/40] hw/xen: Use the IEC binary prefix definitions

2018-06-13 Thread Eric Blake
signed vs unsigned changes than I am about width. But if we're going to force a 64-bit type, use (int64_t)1 not 1LL. That way the type will match the existing PRId64 printf markup. Or spell it UINT64_C(1) if you don't want a cast. -- Eric Blake, Principal Software Engineer Red Hat, Inc.

Re: [Xen-devel] [Qemu-devel] [PATCH] RFC: chardev: mark the calls that allow an implicit mux monitor

2018-08-22 Thread Eric Blake
} #endif -chr = qemu_chr_new_noreplay("gdb", device); +/* + * FIXME: it's a bit weird to allow using a mux chardev here + * and setup implicitely a monitor. We may want to break this. s/setup implicitely/implicitly set up/ -- Eric Blake, Principal Software

[Xen-devel] [PULL 29/30] Fix up dangling references to qmp-commands.* in comment and doc

2018-03-01 Thread Eric Blake
arm...@redhat.com> Reviewed-by: Eric Blake Reviewed-by: Marc-André Lureau Reviewed-by: Michael Roth Signed-off-by: Eric Blake --- docs/xen-save-devices-state.txt | 3 +-- qmp.c | 14 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/docs/xe

Re: [PATCH] qemu/atomic.h: prefix qemu_ to solve collisions

2020-09-21 Thread Eric Blake
644 GIT binary patch delta 102 zcmeBpue$8LYC{WS3sVbo3(FSPMGsgDQ*%q>w*wh6LJ;=!eV! e4L)`&8@K>*RVYvZ delta 66 zcmZ4XUbW-BYC{WS3sVbo3(FSPMGv+wf50juH2uUU)}nU%&#XYq2E^>!?LTwO&)NPs Up0kK)dsGtVajxxZxttAL0Np Does the result of sphinx still look good, as mentioned in this comment? -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org

Re: [Xen-devel] [PATCH v3 01/20] scripts/git.orderfile: Display Cocci scripts before code modifications

2020-02-20 Thread Eric Blake
(+) Reviewed-by: Eric Blake diff --git a/scripts/git.orderfile b/scripts/git.orderfile index 1f747b583a..7cf22e0bf5 100644 --- a/scripts/git.orderfile +++ b/scripts/git.orderfile @@ -22,6 +22,9 @@ Makefile* qapi/*.json qga/*.json +# semantic patches +*.cocci + # headers *.h -- Eric

Re: [Xen-devel] [PATCH v3 02/20] hw: Remove unnecessary cast when calling dma_memory_read()

2020-02-20 Thread Eric Blake
s->dma_as, entry_addr + 2, -(uint8_t *)(&dscr->length), 2); +dma_memory_read(s->dma_as, entry_addr, (&dscr->attr), 1); +dma_memory_read(s->dma_as, entry_addr + 2, (&dscr->length), 2); The () around &dscr->length are now pointless. -- Eric Bla

Re: [Xen-devel] [PATCH v7 01/11] qapi/error: add (Error **errp) cleaning APIs

2020-02-21 Thread Eric Blake
the coccinelle script across multiple patches is actually quite reviewable, and still easy to backport. Consider this series by Philippe: https://lists.gnu.org/archive/html/qemu-devel/2020-02/msg05554.html which makes multiple additions to scripts/coccinelle/exec_rw_const.cocci over the course of

Re: [Xen-devel] [PATCH v7 02/11] error: auto propagated local_err

2020-02-21 Thread Eric Blake
mpiler, so declaration after statement is supported by our compiler, even if our coding style currently avoids it where possible), so as long as we support statements, we might as well go with a legible statement instead of insisting on the compact ?: form. -- Eric Blake, Principa

Re: [Xen-devel] [PATCH v8 01/10] error: auto propagated local_err

2020-03-06 Thread Eric Blake
where the error happened, not to error_propagate. + */ +#define ERRP_AUTO_PROPAGATE() \ +g_auto(ErrorPropagator) _auto_errp_prop = {.errp = errp}; \ +do { \ +if (!errp || errp == &error_fatal) { \ +errp = &_auto_errp_prop.local_err; \ +} \ +} while (0) + /* *

Re: [Xen-devel] [PATCH v8 02/10] scripts: add coccinelle script to use auto propagated errp

2020-03-06 Thread Eric Blake
ed by using this script are reasonable, then this script was good enough. +// Always use the same patter for checking error pattern +@@ +identifier rule1.fn; +symbol errp; +@@ + + fn(...) + { + <... +-*errp != NULL ++*errp + ...> + } -- Eric Blake, Principal Software E

Re: [Xen-devel] [PATCH v9 02/10] scripts: Coccinelle script to use ERRP_AUTO_PROPAGATE()

2020-03-13 Thread Eric Blake
errp , ...) { ... } Ultimately, the proof is in the pudding - if we are happy with the conversion and the warnings produced by this script, and the amount of manual touchup to address those warnings, then I'm happy to accept the scr

Re: [Xen-devel] [PATCH v6 01/11] qapi/error: add (Error **errp) cleaning APIs

2020-01-17 Thread Eric Blake
errp: call corresponding Error *err cleaning + * function an set pointer to NULL s/ an/, then/ Missing a '.' at the end of the sentence. Otherwise, Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qe

Re: [Xen-devel] [PATCH v6 02/11] error: auto propagated local_err

2020-01-17 Thread Eric Blake
rop.local_err : errp) + /* * Special error destination to abort on error. * See error_setg() and error_propagate() for details. The macro itself is fine, my comments are solely on the commit message and comments. Depending on how much cleanup Markus is willing to do rather than require a respi

Re: [Xen-devel] [PATCH v6 03/11] scripts: add coccinelle script to use auto propagated errp

2020-01-17 Thread Eric Blake
not inherit from the first rule. Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [PATCH v2 0/4] nbd/server: Quiesce coroutines on context switch

2021-01-20 Thread Eric Blake
blk: Acquire context while switching them on > dataplane start" with "block: Honor blk_set_aio_context() context > requirements" (Kevin Wolf) > - Add "block: Avoid processing BDS twice in > bdrv_set_aio_context_ignore()" > - Add "block: Close block expo

[PULL 03/13] block: Honor blk_set_aio_context() context requirements

2021-01-20 Thread Eric Blake
blk_set_aio_context() makes use of this function, this rule also applies to it. Fix all occurrences where this rule wasn't honored. Suggested-by: Kevin Wolf Signed-off-by: Sergio Lopez Message-Id: <20201214170519.223781-2-...@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Eric Blake --

Re: [PATCH v6 2/5] block: consolidate blocksize properties consistency checks

2020-05-27 Thread Eric Blake
Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org

Re: [PATCH v6 3/5] qdev-properties: blocksize: use same limits in code and description

2020-05-27 Thread Eric Blake
On 5/27/20 7:45 AM, Roman Kagan wrote: Make it easier (more visible) to maintain the limits on the blocksize properties in sync with the respective description, by using macros both in the code and in the description. Signed-off-by: Roman Kagan --- Reviewed-by: Eric Blake -- Eric Blake

Re: [PATCH v6 4/5] block: make size-related BlockConf properties accept size suffixes

2020-05-27 Thread Eric Blake
Although 4 GiB is not quite the same as 4294967295, the exact byte value next to the approximate size is not too bad. The mechanical fallout from the change from int to size is fine to me. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org

Re: [PATCH v6 5/5] block: lift blocksize property limit to 2 MiB

2020-05-27 Thread Eric Blake
tches the qcow2 cluster size limit. Signed-off-by: Roman Kagan --- Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org

Re: [PATCH v6 4/5] block: make size-related BlockConf properties accept size suffixes

2020-05-27 Thread Eric Blake
split too far, so the real tradeoff is whether it will cost you more time to split than what you will save the next reviewer (including the maintainer that will merge your patches, depending on whether the maintainer also reviews it or just trusts my review), if you decide to go with a v7.

Re: [PATCH v7 4/8] qdev-properties: add size32 property type

2020-05-28 Thread Eric Blake
commit message is tweaked, Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org

Re: [PATCH v7 5/8] qdev-properties: make blocksize accept size suffixes

2020-05-28 Thread Eric Blake
: Roman Kagan --- Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org

Re: [PATCH v7 6/8] block: make BlockConf size props 32bit and accept size suffixes

2020-05-28 Thread Eric Blake
e, I could envision a platform where it prints something funky like: "exceed (2 * (32768) + 1) logical", based on however complex the definition of UINT16_MAX is. You're better off printing this one with %d than with stringify(). -- Eric Blake, Principal Software Engineer

Re: [PATCH v7 7/8] qdev-properties: add getter for size32 and blocksize

2020-05-28 Thread Eric Blake
-off-by: Roman Kagan --- v6 -> v7: - split out into separate patch [Eric] Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org

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

2020-07-07 Thread Eric Blake
t commit "error: Document Error API usage rules", and edited for clarity. Put ERRP_AUTO_PROPAGATE() before its helpers, and touch up style. 01-08: Commit messages tweaked -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org

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

2020-07-07 Thread Eric Blake
(solving 1) or which use local_err+error_propagate to check errors, switching those functions to use *errp instead (solving 2 and 3). Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Paul Durrant Reviewed-by: Greg Kurz Reviewed-by: Eric Blake [Comments merged properly with recent com

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

2020-07-07 Thread Eric Blake
umber of places we have already improved after applying this script as-is and with Markus' cleanups in place. While I won't call myself a Coccinelle expert, it at least looks sane enough that I'm comfortable if you add: Reviewed-by: Eric Blake -- Eric Blake, Principal Softwar

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

2020-07-07 Thread Eric Blake
--no-show-diff --max-width 80 Reported-by: Kevin Wolf Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Markus Armbruster [Commit message tweaked] Signed-off-by: Markus Armbruster --- Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, In

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

2022-03-15 Thread Eric Blake
-GIOChannel *c = g_malloc0(sizeof(GIOChannel)); > +GIOChannel *c = g_new0(GIOChannel, 1); > __coverity_escape__(fd); > return c; > } Our model has a definition of g_malloc0(), but I'm not sure whether Coverity picks up the macro g_new0() in the same manner. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org

Re: [PULL 04/20] migration/dirtyrate: introduce struct and adjust DirtyRateStat

2021-11-04 Thread Eric Blake
mention 6.2, to correctly match the release that will first have it. Such a followup is safe during freeze, since it is doc-only. > +# > +## > +{ 'struct': 'DirtyRateVcpu', > + 'data': { 'id': 'int', 'dirty-rate': 'int64' } } > + > ## > # @DirtyRateStatus: > # -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org

Re: [PATCH v3 28/28] docs: update Xen-on-KVM documentation

2023-10-25 Thread Eric Blake
le: > + > +.. parsed-literal:: > + > + |qemu_system| --accel kvm,xen-version=0x40011,kernel-irqchip=split \\ > + -chardev stdio,id=char0 -device xen-console,chardev=char0 \\ > + -display none -m 1G -kernel xen -initrd bzImage \\ > + -append "pv-shi

Re: [PATCH] block: get rid of blk->guest_block_size

2022-05-19 Thread Eric Blake
> The last time the value of buffer_alignment/guest_block_size was > actually used was before commit 339064d50639 ("block: Don't use guest > sector size for qemu_blockalign()"). > > This value has not been used since 2013. Get rid of it. > > Cc: Xie Yongji

Re: [PATCH 01/12] virtio-scsi: replace AioContext lock with tmf_bh_lock

2023-11-30 Thread Eric Blake
/virtio-scsi.h | 3 +- > hw/scsi/virtio-scsi.c | 62 ++--- > 2 files changed, 43 insertions(+), 22 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

Re: [PATCH 02/12] tests: remove aio_context_acquire() tests

2023-11-30 Thread Eric Blake
t; 1 file changed, 1 insertion(+), 66 deletions(-) The rest of this series should not hold up 8.2. Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

Re: [PATCH 03/12] aio: make aio_context_acquire()/aio_context_release() a no-op

2023-11-30 Thread Eric Blake
{ > -qemu_rec_mutex_unlock(&ctx->lock); > + /* TODO remove this function */ > } > > QEMU_DEFINE_STATIC_CO_TLS(AioContext *, my_aiocontext) > -- > 2.42.0 Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

Re: [PATCH 04/12] graph-lock: remove AioContext locking

2023-11-30 Thread Eric Blake
lock_ctx() becomes meaningless and they can be collapsed > into one function. > > Signed-off-by: Stefan Hajnoczi > --- Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

Re: [PATCH 05/12] block: remove AioContext locking

2023-11-30 Thread Eric Blake
ails in CI and otherwise: > - * don't run unless user opts in via environment variable. > - */ > - if (getenv("QEMU_TEST_FLAKY_TESTS")) { > -g_test_add_func("/blockjob/complete_in_standby", > test_complete_in_standby); > -} Looks like you ripped out this entire test, because it is no longer viable. I might have mentioned it in the commit message, or squashed the removal of this test into the earlier 02/12 patch. Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

Re: [PATCH 06/12] scsi: remove AioContext locking

2023-11-30 Thread Eric Blake
hw/scsi/scsi-disk.c | 28 > hw/scsi/virtio-scsi.c | 18 -- > 4 files changed, 4 insertions(+), 58 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

Re: [PATCH 07/12] aio-wait: draw equivalence between AIO_WAIT_WHILE() and AIO_WAIT_WHILE_UNLOCKED()

2023-11-30 Thread Eric Blake
> --- > include/block/aio-wait.h | 16 > 1 file changed, 4 insertions(+), 12 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

Re: [PATCH 08/12] aio: remove aio_context_acquire()/aio_context_release() API

2023-11-30 Thread Eric Blake
hat allow the compiler to > check whether the graph lock is being used correctly. > > And me, well, I'm just here to add some pizzazz to the QEMU multi-queue > block layer :). Thank you to everyone who helped with this effort, > including Eric Blake, code reviewer extraordinaire, and

Re: [PATCH 09/12] docs: remove AioContext lock from IOThread docs

2023-11-30 Thread Eric Blake
- > 1 file changed, 15 insertions(+), 30 deletions(-) > > diff --git a/docs/devel/multiple-iothreads.txt > b/docs/devel/multiple-iothreads.txt > index a3e949f6b3..4865196bde 100644 > --- a/docs/devel/multiple-iothreads.txt Reviewed-by: Eric Blake -- Eric Blake,

Re: [PATCH 10/12] scsi: remove outdated AioContext lock comment

2023-11-30 Thread Eric Blake
e the > lock is unnecessary. > > Signed-off-by: Stefan Hajnoczi > --- > hw/scsi/scsi-disk.c | 1 - > 1 file changed, 1 deletion(-) > Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

Re: [PATCH 11/12] job: remove outdated AioContext locking comments

2023-12-01 Thread Eric Blake
On Wed, Nov 29, 2023 at 02:55:52PM -0500, Stefan Hajnoczi wrote: > The AioContext lock no longer exists. > > Signed-off-by: Stefan Hajnoczi > --- > include/qemu/job.h | 20 > 1 file changed, 20 deletions(-) > Reviewed-by: Eric Blake -- Eric Blak

Re: [PATCH 12/12] block: remove outdated AioContext locking comments

2023-12-01 Thread Eric Blake
sion that could lead to a bug; so I'm okay with your action there. > > Signed-off-by: Stefan Hajnoczi > --- Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

Re: [RFC PATCH 01/10] sysemu: Introduce qemu_security_policy_taint() API

2021-09-09 Thread Eric Blake
SecurityPolicy: > +# > +# An enumeration of the actions taken when the security policy is tainted. > +# > +# @none: do nothing. > +# > +# @warn: display a warning. > +# > +# @strict: prohibit QEMU to start a VM. s/to start/from starting/ > +# > +# Since: 6.2 > +## > +{ 'enum': 'SecurityPolicy', > + 'data': [ 'none', 'warn', 'strict' ] } -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org

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

2021-09-09 Thread Eric Blake
//www.qemu.org/contribute/security-process/ > + */ > +bool secure_policy_supported; > /* > * Array of global properties that would be applied when specific > * accelerator is chosen. It works like MachineClass.compat_props -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org

Re: [RFC PATCH 03/10] block: Use qemu_security_policy_taint() API

2021-09-09 Thread Eric Blake
if the driver is withing QEMU security policy boundary, within > + * %false otherwise. See: > https://www.qemu.org/contribute/security-process/ > + */ > +bool (*bdrv_taints_security_policy)(BlockDriverState *bs); > > int coroutine_fn (*bdrv_co_create)(BlockdevCreateOption

Re: [PATCH v2 3/4] virtio: use defer_call() in virtio_irqfd_notify()

2023-08-18 Thread Eric Blake
it. > > Signed-off-by: Stefan Hajnoczi > --- > block/io_uring.c | 6 ++ > block/linux-aio.c | 4 > hw/virtio/virtio.c | 11 ++- > util/thread-pool.c | 5 +++++ > 4 files changed, 25 insertions(+), 1 deletion(-) Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

Re: [PATCH v2 4/4] virtio-blk: remove batch notification BH

2023-08-18 Thread Eric Blake
47 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

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

2023-08-31 Thread Eric Blake
and breaking SHA references is worse. > Signed-off-by: Markus Armbruster > --- > migration/rdma.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

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

2023-08-31 Thread Eric Blake
reachable") > * have to open-code it. Sadly, Coverity is severely confused by the > * constant variants, so we have to dumb things down there. > */ > +#define PASTE(a, b) a##b > +#define MIN_INTERNAL(a, b, l) \ > +({

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

2023-09-01 Thread Eric Blake
you realize that you are passing in the unique variable name(s) to be used as the temporary identifier(s), rather than an integer that still needs to be glued, then separating the task of generating name(s) (which is done once per name, instead of repeated 3 times) makes sense to me. I also lik

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

2023-09-20 Thread Eric Blake
, "name", qobject_ref(...)) > > qdict_put() wraps its last argument in QOBJECT(), and the last > argument here contains another QOBJECT(). > > Use dark preprocessor sorcery to make the macros that give us this > problem use different variable names on every call. > > Sign

Re: [PATCH v6 1/5] qapi: net: Add query-netdev command

2021-03-02 Thread Eric Blake
;next); \ > +} while (0) Please use QAPI_LIST_APPEND instead of re-coding it. > +++ b/qapi/net.json > @@ -714,3 +714,83 @@ > ## > { 'event': 'FAILOVER_NEGOTIATED', >'data': {'device-id': 'str'} } > + > +## >

Re: [PATCH v2 16/16] virtio: make it possible to detach host notifier from any thread

2023-04-19 Thread Eric Blake
s of > virtio_queue_aio_detach_host_notifier() so that the function can be > called from any thread. This is in preparation for the next patch. > This mentions a next patch, but is 16/16 in the series. Am I missing something? -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org

Re: [PATCH 1/6] block: add blk_io_plug_call() API

2023-05-18 Thread Eric Blake
* @fn/@opaque pair has already been deferred, it will only be called once > upon > + * blk_io_unplug() so that accumulated calls are batched into a single call. > + * > + * The caller must ensure that @opaque is not be freed before @fn() is > invoked. s/be // > + */ > +void b

Re: [PATCH 2/6] block/nvme: convert to blk_io_plug_call() API

2023-05-18 Thread Eric Blake
t; block/nvme.c | 44 > 1 file changed, 12 insertions(+), 32 deletions(-) Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org

Re: [PATCH 3/6] block/blkio: convert to blk_io_plug_call() API

2023-05-18 Thread Eric Blake
; block/blkio.c | 40 +--- > 1 file changed, 21 insertions(+), 19 deletions(-) Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org

Re: [PATCH 4/6] block/io_uring: convert to blk_io_plug_call() API

2023-05-18 Thread Eric Blake
0,14 +357,16 @@ static int luring_do_submit(int fd, LuringAIOCB > *luringcb, LuringState *s, Looks a bit like a stray hunk, but you are touching the function, so it's okay. Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org

Re: [PATCH 5/6] block/linux-aio: convert to blk_io_plug_call() API

2023-05-18 Thread Eric Blake
ue, it's also fewer lines of code. Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org

Re: [PATCH 6/6] block: remove bdrv_co_io_plug() API

2023-05-18 Thread Eric Blake
ock_int-common.h | 11 -- > block/io.c | 37 > 3 files changed, 51 deletions(-) Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org