From nobody Sun Apr 28 13:26:10 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; 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; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1592307809; cv=none; d=zohomail.com; s=zohoarc; b=EUUPCsBRGQP5+xe6B0QvY5MnLQdUHbeirCXau1UV+v4XKLutaSa/q+BWSE2g2cd6wtLOavdlVs9/YaLaJcHTR2EaX/0j4T1OfUIkz/ZXr6y0zh3R7ETHqzKbf75pX9+hZ26KRidZp8GWSX063Y4ks2C3QeNbzqbC7azinIsXgdk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592307809; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=2RXd0HEf9wdmWCk2zNnPvFCCpiVbKiJgxnXRLSX0jg8=; b=MCLDDUihZU71UzT/Hzhk6MwGVv2G3rNblKCTyj9+Suhna/+7kTBTgCOi2ee+WIiMlJfYXm+tNrYUPW6ybUSfzpPDgqcAc+W5EBKaTIckGFoGYu/Nv3/OkY8ZRibLBQZOQLyTEjNwmmUwh4QgxRnv0h6PIVzlBPqGs2dI7ZaVZ5o= ARC-Authentication-Results: i=1; mx.zohomail.com; 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; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1592307809606376.0903863218738; Tue, 16 Jun 2020 04:43:29 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jl9zV-0006W9-DO; Tue, 16 Jun 2020 11:42:57 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jl9zU-0006W4-3J for xen-devel@lists.xenproject.org; Tue, 16 Jun 2020 11:42:56 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8432974a-afc6-11ea-bb8b-bc764e2007e4; Tue, 16 Jun 2020 11:42:55 +0000 (UTC) X-Inumbo-ID: 8432974a-afc6-11ea-bb8b-bc764e2007e4 Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: O2KA83HI7fUTm7TAwZ6nMx1C4u4oC9zA7xkOpFFh++cRCj61rv10i2lCjROsL+hssoDwx9bGyg 9hpE+YOuMmvHyb35yYj9UYKwxSUaeiYhTQ4PQc6J899hrXmlGN2oo+rpeB3EjVhPv1KtbZEeHy +scHh57n+F/1VQjS8DNjGo3jwwnjtXwIOSu8xdfNzaDbss9ap10r/iDBIqUGcwYuMy+HrT/hTY RcZfSdg9fAL52QSYQznj63qbFb+rTW85UxL6dy1AnfVp0gEwxlESAeZ0xfj6LiU/Vh9wLleSev czs= X-SBRS: 2.7 X-MesageID: 20164113 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.73,518,1583211600"; d="scan'208";a="20164113" From: Igor Druzhinin To: Subject: [PATCH for-4.14 v2] tools/xen-ucode: fix error code propagation of microcode load operation Date: Tue, 16 Jun 2020 12:42:34 +0100 Message-ID: <1592307754-8844-1-git-send-email-igor.druzhinin@citrix.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Igor Druzhinin , ian.jackson@eu.citrix.com, xadimgnik@gmail.com, wl@xen.org Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Otherwise it's impossible to know the reason for a fault or blob rejection inside the automation. While at it, also change return code of incorrect invokation to EINVAL. Signed-off-by: Igor Druzhinin --- Changes in v2: - simply call "return errno". On Linux that seems to be safe as values <=3D= 255 are correctly propagated, on non-Linux I couldn't find error codes >127. - return positive value on incorrect invokation --- tools/misc/xen-ucode.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/misc/xen-ucode.c b/tools/misc/xen-ucode.c index 0c257f4..409cace 100644 --- a/tools/misc/xen-ucode.c +++ b/tools/misc/xen-ucode.c @@ -25,7 +25,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "xen-ucode: Xen microcode updating tool\n" "Usage: %s \n", argv[0]); - return 0; + return EINVAL; } =20 filename =3D argv[1]; @@ -62,8 +62,11 @@ int main(int argc, char *argv[]) =20 ret =3D xc_microcode_update(xch, buf, len); if ( ret ) + { fprintf(stderr, "Failed to update microcode. (err: %s)\n", strerror(errno)); + return errno; + } =20 xc_interface_close(xch); =20 --=20 2.7.4