From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 CACE921A143CB for ; Thu, 8 Jun 2017 20:14:35 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jun 2017 20:15:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,316,1493708400"; d="scan'208";a="112758898" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga006.fm.intel.com with ESMTP; 08 Jun 2017 20:15:44 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 8 Jun 2017 20:15:44 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.151]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.56]) with mapi id 14.03.0319.002; Fri, 9 Jun 2017 11:14:53 +0800 From: "Ni, Ruiyu" To: "Shah, Tapan" , "Carsey, Jaben" CC: "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH] ShellPkg/alias: Return status for alias deletion Thread-Index: AQHS3p8EZHytuxrwH0iFv+buukdAdqIXhMCAgADVC4CAAAMFAIAABn9wgAEmdbCAAG/KOoAAo+eAgAACoQCAAAEigIAAAJGAgAABfoCAATx24A== Date: Fri, 9 Jun 2017 03:14:53 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5B98DBB3@SHSMSX104.ccr.corp.intel.com> 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, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 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: Fri, 09 Jun 2017 03:14:36 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable All, I just sent out a patch "[edk2] [PATCH] Shell/alias: Print detailed error w= hen deleting alias", could you please review it? Thanks/Ray > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Shah, Tapan > Sent: Friday, June 9, 2017 12:22 AM > To: Carsey, Jaben ; Ni, Ruiyu > Cc: edk2-devel@lists.01.org > Subject: Re: [edk2] [PATCH] ShellPkg/alias: Return status for alias delet= ion >=20 > I would suggest to keep FILE/DIR tokens as-is to avoid more code changes. > New token for alias... to match the wording it can be "%s: n= ot > found." >=20 > -----Original Message----- > From: Carsey, Jaben [mailto:jaben.carsey@intel.com] > 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 delet= ion >=20 > Wonder if we should refactor FILE_NOT_FOUND, DIR_NOT_FOUND, and this > into "%s '%s' not found"? >=20 > > -----Original Message----- > > From: Shah, Tapan [mailto:tapandshah@hpe.com] > > Sent: Thursday, June 08, 2017 9:14 AM > > To: Carsey, Jaben ; Ni, Ruiyu > > > > Cc: edk2-devel@lists.01.org > > Subject: RE: [edk2] [PATCH] ShellPkg/alias: Return status for alias > > deletion > > Importance: High > > > > Correct. > > > > STR_GEN_ERR_NOT_FOUND should be "alias: '' does not > > exist." > > > > > > -----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 > > deletion > > > > Tapa, > > > > Is your thinking like this: > > > > if (EFI_ERROR(Status)) { > > if (Status =3D=3D EFI_ACCESS_DENIED) { > > ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), > > gShellLevel3HiiHandle, L"alias"); > > ShellStatus =3D SHELL_ACCESS_DENIED; > > } else if (Status =3D=3D EFI_NOT_FOUND) { > > ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN > > (STR_GEN_ERR_NOT_FOUND), gShellLevel3HiiHandle, L"alias"); > > ShellStatus =3D SHELL_NOT_FOUND; > > } else { ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_U= K), > > gShellLevel3HiiHandle, L"alias", Status); > > ShellStatus =3D SHELL_DEVICE_ERROR; > > } > > } > > > > Then add a STR_GEN_ERR_NOT_FOUND string? > > > > > -----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 > > > deletion > > > Importance: High > > > > > > EFI_NOT_FOUND should be handled with the token I mentioned for a > > > clear message. All other errors should be printed using STR_GEN_ERR_U= K. > > > > > > -----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 > > > deletion > > > > > > I did think about changing as you suggested. But other errors also > > > may be DEVICE_ERROR in case the NV storage has some problem. So I > > > 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 > > > > ; edk2-devel@lists.01.org > > > > Subject: RE: [edk2] [PATCH] ShellPkg/alias: Return status for > > > > alias deletion > > > > > > > > Instead of using STR_GEN_ERR_UK here, it would be better to > > > > define a > > > new string token as "alias: '' does not exist." > > > > > > > >>>> + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN > > > >>>> + (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 > > > > 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 > > > >> > > > >> Subject: Re: [edk2] [PATCH] ShellPkg/alias: Return status for > > > >> 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$BF;=1B(B > > =1B$B!'=1B(B > > > >>> > > > >>> Including Tapan. > > > >>> > > > >>> Thanks/Ray > > > >>> > > > >>>> -----Original Message----- > > > >>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On > > > >>>> 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 > > > >>>> 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 > > > >>>> 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 > > > >>>> reserved.
> > > >>>> + Copyright (c) 2009 - 2017, Intel Corporation. All rights rese= rved. > > > >>>> +
> > > >>>> This program and the accompanying materials are licensed and > > > >>>> made available under the terms and conditions of the > > > >> BSD > > > >>>> License > > > >>>> which accompanies this distribution. The full text of the > > > >>>> license may be > > > >> found > > > >>>> at @@ -151,6 +151,15 @@ ShellCommandRunAlias ( > > > >>>> // delete an alias > > > >>>> // > > > >>>> Status =3D gEfiShellProtocol->SetAlias(Param1, NULL, TRUE, > > > >>>> FALSE); > > > >>>> + if (EFI_ERROR(Status)) { > > > >>>> + if (Status =3D=3D EFI_ACCESS_DENIED) { > > > >>>> + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN > > > >>>> + (STR_GEN_ERR_AD), > > > >>>> gShellLevel3HiiHandle, L"alias"); > > > >>>> + ShellStatus =3D SHELL_ACCESS_DENIED; > > > >>>> + } else { > > > >>>> + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN > > > >>>> + (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 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel