From nobody Thu May 2 14:09:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1627556793; cv=none; d=zohomail.com; s=zohoarc; b=KT4kszLG8LooSvLZ4dzj36hRU3VDanwi4wMN/k1rjreAHEgAQchIh4XIhsmScF2g2EzqpInugkRo7FepLtVsQA7OmQ/v3duBuGQwXypRhc23LscIr8z0+IMaJCtLozAyj5SMkkIpgdYn+GOZ0jbiJMZ48ZK1LnTDhEt7jfyO0B4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1627556793; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=vKEQbEF5cQrLwWH1JPPMZRyXbyae15aLjwRBtJ1sUbo=; b=iJ5LxFRtbVEFKsSfTZaQb9FVJT5v5+y1yhSQ4dCM8ZvVzZVYCdyhM6Zd1aBBqVXjLsMthekEC/m+tntgB8eBSlqVYs7K0R/+j42QlUL26xiiSZny5+AxGRAmf9/l6wWe41A0Wl5RZH8BUXBbgV3HaJkocl25rXoGSKqlp6GaetM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1627556793347414.4141863520879; Thu, 29 Jul 2021 04:06:33 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.161896.297081 (Exim 4.92) (envelope-from ) id 1m93rc-0001aE-TK; Thu, 29 Jul 2021 11:06:08 +0000 Received: by outflank-mailman (output) from mailman id 161896.297081; Thu, 29 Jul 2021 11:06:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1m93rc-0001a7-Qb; Thu, 29 Jul 2021 11:06:08 +0000 Received: by outflank-mailman (input) for mailman id 161896; Thu, 29 Jul 2021 11:06:08 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1m93rc-0001a1-2n for xen-devel@lists.xenproject.org; Thu, 29 Jul 2021 11:06:08 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1m93ra-0004vC-Rn; Thu, 29 Jul 2021 11:06:06 +0000 Received: from 54-240-197-235.amazon.com ([54.240.197.235] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m93ra-0006L1-Hy; Thu, 29 Jul 2021 11:06:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Message-Id:Date:Subject:Cc:To:From; bh=vKEQbEF5cQrLwWH1JPPMZRyXbyae15aLjwRBtJ1sUbo=; b=HXBNouiWvG2SZ0EJi4i0Ms6fps fhDp/v2rL45Bf0EndbHT0gZKQMZMRTPH6IwZPyIIndvapzdowcmzAU46FXXuiCxVkeygCrgra3ef/ nj72W869BZNxXxvqDnFul/Tqq1Iq/8STGvMq+KsCgnR3mHb3uTgj/hKPUiFmdN2VDlAg=; From: Julien Grall To: xen-devel@lists.xenproject.org Cc: julien@xen.org, Julien Grall , Ian Jackson , Wei Liu , Juergen Gross Subject: [PATCH] tools/xenstored: Propagate correctly the error message from lu_start() Date: Thu, 29 Jul 2021 12:06:02 +0100 Message-Id: <20210729110602.24815-1-julien@xen.org> X-Mailer: git-send-email 2.17.1 X-ZohoMail-DKIM: pass (identity @xen.org) X-ZM-MESSAGEID: 1627556794542100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Julien Grall lu_start() will only set errno when it returns NULL. For all the other cases, the value is unknown. This means that when lu_start() returns an error message, it may not be propagated to the client. The check that errno is a non-zero value is now dropped and instead the value is returned when no error message is provided. This relies on errno to always be set when ret =3D=3D NULL. Fixes: af216a99fb ("tools/xenstore: add the basic framework for doing the l= ive update") Signed-off-by: Julien Grall Reviewed-by: Juergen Gross --- tools/xenstore/xenstored_control.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_= control.c index ff9863c17fa4..6b68b79faac7 100644 --- a/tools/xenstore/xenstored_control.c +++ b/tools/xenstore/xenstored_control.c @@ -795,10 +795,8 @@ static int do_control_lu(void *ctx, struct connection = *conn, return EINVAL; } ret =3D lu_start(ctx, conn, force, to); - if (errno) - return errno; if (!ret) - return 0; + return errno; } else { errno =3D 0; ret =3D lu_arch(ctx, conn, vec, num); --=20 2.17.1