From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 871C021967BE1 for ; Thu, 8 Jun 2017 09:20:37 -0700 (PDT) Received: from G9W8456.americas.hpqcorp.net (g9w8456.houston.hp.com [16.216.161.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g2t2352.austin.hpe.com (Postfix) with ESMTPS id 3734663 for ; Thu, 8 Jun 2017 16:21:46 +0000 (UTC) Received: from G9W8454.americas.hpqcorp.net (2002:10d8:a104::10d8:a104) by G9W8456.americas.hpqcorp.net (2002:10d8:a15f::10d8:a15f) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Thu, 8 Jun 2017 16:21:46 +0000 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (15.241.52.10) by G9W8454.americas.hpqcorp.net (16.216.161.4) with Microsoft SMTP Server (TLS) id 15.0.1178.4 via Frontend Transport; Thu, 8 Jun 2017 16:21:46 +0000 Received: from CS1PR84MB0024.NAMPRD84.PROD.OUTLOOK.COM (10.162.189.142) by CS1PR84MB0024.NAMPRD84.PROD.OUTLOOK.COM (10.162.189.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Thu, 8 Jun 2017 16:21:43 +0000 Received: from CS1PR84MB0024.NAMPRD84.PROD.OUTLOOK.COM ([10.162.189.142]) by CS1PR84MB0024.NAMPRD84.PROD.OUTLOOK.COM ([10.162.189.142]) with mapi id 15.01.1157.012; Thu, 8 Jun 2017 16:21:43 +0000 From: "Shah, Tapan" To: "Carsey, Jaben" , "Ni, Ruiyu" CC: "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH] ShellPkg/alias: Return status for alias deletion Thread-Index: AQHS3p8FvY0wpi4uv0yFy8KbBoSum6IXhMCAgADVC4CAAAMFAIAABn9wgAEmdbCAAG/KgIABKNHQgAAD1ACAAAC9wIAAAPaAgAAAlKA= Date: Thu, 8 Jun 2017 16:21:43 +0000 Message-ID: References: <20170606082904.195040-1-ruiyu.ni@intel.com>, <734D49CCEBEEF84792F5B80ED585239D5B988FB6@SHSMSX104.ccr.corp.intel.com> <3DAAB008-D40F-48B1-B8AA-0F418CA19FE3@intel.com> , In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=hpe.com; x-originating-ip: [76.187.64.133] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CS1PR84MB0024; 7:Qn+CD7IPuH2ZOzFlFxE/sfplzfK3c0XlhjonjC/trlZaJjihLJoDAIuut1NG0ACLif8vEevK4jGjQ7RiKzyTaNZ7txMj5Wm+u6lTq9NyEVLp5XnNMydUMgyjtgfJjriYEiPlVGquCd3+sdMkaP4rm5YjYyAIl41X/XebJ2y/eMtcJtrrUZx8DEZN5d7+dVsr0WyqaJNQY674rDCFoGOxDMtJVerUxJsll9V7nduiJddQu9lsa15KNIInMRW4lqI4EZNaMod6ryTXBISC9YrdQfLw7Aq1Rl9qp3I2jSaQRngf1h+0Rg1y4z8r9Ya5tmws7TOhXIxCvsJfr6ID6Cl4qQ== x-ms-traffictypediagnostic: CS1PR84MB0024: x-ms-office365-filtering-correlation-id: 56fa1dfd-ad4d-42ec-f07d-08d4ae8a73d3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081)(201702281549075); SRVR:CS1PR84MB0024; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(227479698468861)(162533806227266)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041248)(20161123564025)(20161123560025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CS1PR84MB0024; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CS1PR84MB0024; x-forefront-prvs: 0332AACBC3 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(39410400002)(39400400002)(39850400002)(39450400003)(39840400002)(39860400002)(13464003)(377454003)(54356999)(4326008)(14454004)(50986999)(966005)(76176999)(189998001)(2900100001)(5660300001)(8936002)(81166006)(8676002)(33656002)(478600001)(38730400002)(55016002)(53936002)(9686003)(6306002)(102836003)(3660700001)(74316002)(93886004)(7696004)(122556002)(25786009)(3846002)(6246003)(6436002)(7736002)(305945005)(86362001)(77096006)(6506006)(2906002)(229853002)(66066001)(3280700002)(2950100002)(53546009); DIR:OUT; SFP:1102; SCL:1; SRVR:CS1PR84MB0024; H:CS1PR84MB0024.NAMPRD84.PROD.OUTLOOK.COM; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jun 2017 16:21:43.6610 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR84MB0024 X-OriginatorOrg: hpe.com Subject: Re: [PATCH] ShellPkg/alias: Return status for alias deletion X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jun 2017 16:20:37 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable I would suggest to keep FILE/DIR tokens as-is to avoid more code changes. N= ew token for alias... to match the wording it can be "%s: not = found." -----Original Message----- From: Carsey, Jaben [mailto:jaben.carsey@intel.com]=20 Sent: Thursday, June 08, 2017 11:16 AM To: Shah, Tapan ; Ni, Ruiyu Cc: edk2-devel@lists.01.org Subject: RE: [edk2] [PATCH] ShellPkg/alias: Return status for alias deletio= n Wonder if we should refactor FILE_NOT_FOUND, DIR_NOT_FOUND, and this into "= %s '%s' not found"? > -----Original Message----- > From: Shah, Tapan [mailto:tapandshah@hpe.com] > Sent: Thursday, June 08, 2017 9:14 AM > To: Carsey, Jaben ; Ni, Ruiyu=20 > > Cc: edk2-devel@lists.01.org > Subject: RE: [edk2] [PATCH] ShellPkg/alias: Return status for alias=20 > deletion > Importance: High >=20 > Correct. >=20 > STR_GEN_ERR_NOT_FOUND should be "alias: '' does not=20 > exist." >=20 >=20 > -----Original Message----- > From: Carsey, Jaben [mailto:jaben.carsey@intel.com] > Sent: Thursday, June 08, 2017 11:10 AM > To: Shah, Tapan ; Ni, Ruiyu > Cc: edk2-devel@lists.01.org > Subject: RE: [edk2] [PATCH] ShellPkg/alias: Return status for alias=20 > deletion >=20 > Tapa, >=20 > Is your thinking like this: >=20 > if (EFI_ERROR(Status)) { > if (Status =3D=3D EFI_ACCESS_DENIED) { > ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD),=20 > gShellLevel3HiiHandle, L"alias"); > ShellStatus =3D SHELL_ACCESS_DENIED; > } else if (Status =3D=3D EFI_NOT_FOUND) { > ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN=20 > (STR_GEN_ERR_NOT_FOUND), gShellLevel3HiiHandle, L"alias"); > ShellStatus =3D SHELL_NOT_FOUND; > } else { ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK)= , > gShellLevel3HiiHandle, L"alias", Status); > ShellStatus =3D SHELL_DEVICE_ERROR; > } > } >=20 > Then add a STR_GEN_ERR_NOT_FOUND string? >=20 > > -----Original Message----- > > From: Shah, Tapan [mailto:tapandshah@hpe.com] > > Sent: Thursday, June 08, 2017 9:01 AM > > To: Ni, Ruiyu > > Cc: Carsey, Jaben ; edk2-devel@lists.01.org > > Subject: RE: [edk2] [PATCH] ShellPkg/alias: Return status for alias=20 > > deletion > > Importance: High > > > > EFI_NOT_FOUND should be handled with the token I mentioned for a=20 > > clear message. All other errors should be printed using STR_GEN_ERR_UK. > > > > -----Original Message----- > > From: Ni, Ruiyu [mailto:ruiyu.ni@intel.com] > > Sent: Wednesday, June 07, 2017 5:14 PM > > To: Shah, Tapan > > Cc: Carsey, Jaben ; edk2-devel@lists.01.org > > Subject: Re: [edk2] [PATCH] ShellPkg/alias: Return status for alias=20 > > deletion > > > > I did think about changing as you suggested. But other errors also=20 > > may be DEVICE_ERROR in case the NV storage has some problem. So I=20 > > did not change it. > > Sorry for not replying to you before checking in the code. > > > > Send from mobile phone > > > > > =1B$B:_=1B(B 2017=1B$BG/=1B(B6=1B$B7n=1B(B7=1B$BF|!$2<8a=1B(B11:35=1B= $B!$=1B(BShah, Tapan > =1B$B > =1B$BF;!'=1B(B > > > > > > Ray, > > > I don't see your check-in includes the change I proposed below. > > > > > > Tapan > > > > > > > > > -----Original Message----- > > > From: Shah, Tapan > > > Sent: Tuesday, June 06, 2017 5:03 PM > > > To: 'Carsey, Jaben' ; Ni, Ruiyu=20 > > > ; edk2-devel@lists.01.org > > > Subject: RE: [edk2] [PATCH] ShellPkg/alias: Return status for=20 > > > alias deletion > > > > > > Instead of using STR_GEN_ERR_UK here, it would be better to=20 > > > define a > > new string token as "alias: '' does not exist." > > > > > >>>> + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN=20 > > >>>> + (STR_GEN_ERR_UK), > > >>>> gShellLevel3HiiHandle, L"alias", Status); > > > > > > Reviewed-by: Tapan Shah > > > > > > -----Original Message----- > > > From: Carsey, Jaben [mailto:jaben.carsey@intel.com] > > > Sent: Tuesday, June 06, 2017 4:37 PM > > > To: Ni, Ruiyu ; edk2-devel@lists.01.org > > > Cc: Shah, Tapan > > > Subject: RE: [edk2] [PATCH] ShellPkg/alias: Return status for=20 > > > alias deletion > > > > > > I am good with more clear error information coming to the user. > > > Reviewed-by: Jaben Carsey > > > > > >> -----Original Message----- > > >> From: Ni, Ruiyu > > >> Sent: Tuesday, June 06, 2017 2:26 PM > > >> To: Ni, Ruiyu ; edk2-devel@lists.01.org > > >> Cc: Tapan Shah ; Carsey, Jaben=20 > > >> > > >> Subject: Re: [edk2] [PATCH] ShellPkg/alias: Return status for=20 > > >> alias deletion > > >> Importance: High > > >> > > >> Including Jaben for review. > > >> > > >> Send from mobile phone > > >> > > >>> =1B$B:_=1B(B 2017=1B$BG/=1B(B6=1B$B7n=1B(B6=1B$BF|!$2<8a=1B(B4:43= =1B$B!$=1B(BNi, Ruiyu =1B$B =1B$B!'=1B(B > > >>> > > >>> Including Tapan. > > >>> > > >>> Thanks/Ray > > >>> > > >>>> -----Original Message----- > > >>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On=20 > > >>>> Behalf Of > > >> Ruiyu > > >>>> Ni > > >>>> Sent: Tuesday, June 6, 2017 4:29 PM > > >>>> To: edk2-devel@lists.01.org > > >>>> Subject: [edk2] [PATCH] ShellPkg/alias: Return status for alias=20 > > >>>> deletion > > >>>> > > >>>> Contributed-under: TianoCore Contribution Agreement 1.0 > > >>>> Signed-off-by: Ruiyu Ni > > >>>> Cc: Tapan Shah > > >>>> --- > > >>>> ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c | 11 > > >>>> ++++++++++- > > >>>> 1 file changed, 10 insertions(+), 1 deletion(-) > > >>>> > > >>>> diff --git=20 > > >>>> a/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c > > >>>> b/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c > > >>>> index 5a3b7e5913..7277bd4b90 100644 > > >>>> --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c > > >>>> +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c > > >>>> @@ -2,7 +2,7 @@ > > >>>> Main file for Alias shell level 3 function. > > >>>> > > >>>> (C) Copyright 2015 Hewlett-Packard Development Company, > L.P.
> > >>>> - Copyright (c) 2009 - 2016, Intel Corporation. All rights=20 > > >>>> reserved.
> > >>>> + Copyright (c) 2009 - 2017, Intel Corporation. All rights reserv= ed. > > >>>> +
> > >>>> This program and the accompanying materials are licensed and=20 > > >>>> made available under the terms and conditions of the > > >> BSD > > >>>> License > > >>>> which accompanies this distribution. The full text of the=20 > > >>>> license may be > > >> found > > >>>> at @@ -151,6 +151,15 @@ ShellCommandRunAlias ( > > >>>> // delete an alias > > >>>> // > > >>>> Status =3D gEfiShellProtocol->SetAlias(Param1, NULL, TRUE,=20 > > >>>> FALSE); > > >>>> + if (EFI_ERROR(Status)) { > > >>>> + if (Status =3D=3D EFI_ACCESS_DENIED) { > > >>>> + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN=20 > > >>>> + (STR_GEN_ERR_AD), > > >>>> gShellLevel3HiiHandle, L"alias"); > > >>>> + ShellStatus =3D SHELL_ACCESS_DENIED; > > >>>> + } else { > > >>>> + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN=20 > > >>>> + (STR_GEN_ERR_UK), > > >>>> gShellLevel3HiiHandle, L"alias", Status); > > >>>> + ShellStatus =3D SHELL_DEVICE_ERROR; > > >>>> + } > > >>>> + } > > >>>> } else if (ShellCommandLineGetCount(Package) =3D=3D 3) { > > >>>> // > > >>>> // must be adding an alias > > >>>> -- > > >>>> 2.12.2.windows.2 > > >>>> > > >>>> _______________________________________________ > > >>>> edk2-devel mailing list > > >>>> edk2-devel@lists.01.org > > >>>> https://lists.01.org/mailman/listinfo/edk2-devel >=20