[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v8 10/10] xen: introduce ERRP_AUTO_PROPAGATE


  • To: Paul Durrant <paul@xxxxxxx>
  • From: Vladimir Sementsov-Ogievskiy <vsementsov@xxxxxxxxxxxxx>
  • Date: Fri, 6 Mar 2020 12:18:23 +0300
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=95jCxrGKzOtPnhruszenmv4/DYv3dPCtLMe3bX3oBmY=; b=i7PsQaKlcqYNfgBQvEBYPopS7DNB+Dtg1o9jGL4NmLloIxzJbuayG++YHsWxqNtr+acVpXeQuCrMARxr8cQ7oGfIkNTvYAnzWq5chXWr9hPPFnrWaeUttuSvcl5Wq8uZsTzRgZS8R2TKOrohK/42aOZELenoRqcSIahsu+8Oi2Yart+2xg5CD1ROkSqj/rIPUweqRc4PBhkXgqnJHgFkwVjdVstEeXWDUAImoeejprUIntn4cGkQGJ/OiPF6mgOz3zJD3SpK7JrDwPWVTiJwq0C7KE/JKuVNugBEonw5oFpkYViyIZmDTeybLCAx7aBGuxg7CkJOBwu7I9Gz1aOpEA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AvGpG+d52L8loygRotQdeAIErqcXn/FGN/40eTCFei6RyuMnHXIysxtLREbU0Ge4jzNP6f4uPnLilJnPiRvrtJ8CtFeYCd+I+3Ieo5I8Yg8dpD/AYidx1WvgpRLiQNBF3uf+eWi0RWnGEQLh80VLRaU/X8D8Hix0kSJKLHusRVbcN1HwwjL5nsxHYiNS8R4wxC/QvFlnykN0oL+BP+DPzM7d8GI1a3LCP++bn7AfeEhe4hR5BrSUuP8qZtV0nvmdknbvLSHSWBg6Fd7zdhVjwsYkEm5X45zq6Jpb2vwWH7OGWiIqCl0ibtJOcemIFHKnWyDAcoZ8SHmofWjXjF8vCw==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=vsementsov@xxxxxxxxxxxxx;
  • Cc: Kevin Wolf <kwolf@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, qemu-block@xxxxxxxxxx, Markus Armbruster <armbru@xxxxxxxxxx>, Greg Kurz <groug@xxxxxxxx>, "open list:All patches CC here" <qemu-devel@xxxxxxxxxx>, Stefan Hajnoczi <stefanha@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Max Reitz <mreitz@xxxxxxxxxx>
  • Delivery-date: Fri, 06 Mar 2020 09:18:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

06.03.2020 12:12, Paul Durrant wrote:
On Fri, 6 Mar 2020 at 05:16, Vladimir Sementsov-Ogievskiy
<vsementsov@xxxxxxxxxxxxx> 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 program will exit prior to the error_append_hint() or
error_prepend() call).  Fix such cases.

If we want to check error after errp-function call, we need to
introduce local_err and then propagate it to errp. Instead, use
ERRP_AUTO_PROPAGATE macro, benefits are:
1. No need of explicit error_propagate call
2. No need of explicit local_err variable: use errp directly
3. ERRP_AUTO_PROPAGATE leaves errp as is if it's not NULL or
    &error_fatal, this means that we don't break error_abort
    (we'll abort on error_set, not on error_propagate)

This commit is generated by command

     sed -n '/^X86 Xen CPUs$/,/^$/{s/^F: //p}' MAINTAINERS | \
     xargs git ls-files | grep '\.[hc]$' | \
     xargs spatch \
         --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
         --macro-file scripts/cocci-macro-file.h \
         --in-place --no-show-diff --max-width 80

Reported-by: Kevin Wolf <kwolf@xxxxxxxxxx>
Reported-by: Greg Kurz <groug@xxxxxxxx>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@xxxxxxxxxxxxx>

Reviewed-by: Paul Durrant <paul@xxxxxxx>



Thanks for reviewing!

--
Best regards,
Vladimir

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.