public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] ShellPkg/alias: Return status for alias deletion
@ 2017-06-06  8:29 Ruiyu Ni
  2017-06-06  8:43 ` Ni, Ruiyu
  0 siblings, 1 reply; 13+ messages in thread
From: Ruiyu Ni @ 2017-06-06  8:29 UTC (permalink / raw)
  To: edk2-devel

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Tapan Shah <tapandshah@hpe.com>
---
 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.<BR>
-  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved. <BR>
+  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved. <BR>
   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 = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE, FALSE);
+      if (EFI_ERROR(Status)) {
+        if (Status == EFI_ACCESS_DENIED) {
+          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel3HiiHandle, L"alias");  
+          ShellStatus = SHELL_ACCESS_DENIED;
+        } else {
+          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel3HiiHandle, L"alias", Status);  
+          ShellStatus = SHELL_DEVICE_ERROR;
+        }
+      }
     } else if (ShellCommandLineGetCount(Package) == 3) {
       //
       // must be adding an alias
-- 
2.12.2.windows.2



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] ShellPkg/alias: Return status for alias deletion
  2017-06-06  8:29 [PATCH] ShellPkg/alias: Return status for alias deletion Ruiyu Ni
@ 2017-06-06  8:43 ` Ni, Ruiyu
  2017-06-06 21:26   ` Ni, Ruiyu
  0 siblings, 1 reply; 13+ messages in thread
From: Ni, Ruiyu @ 2017-06-06  8:43 UTC (permalink / raw)
  To: Ni, Ruiyu, edk2-devel@lists.01.org

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 <ruiyu.ni@intel.com>
> Cc: Tapan Shah <tapandshah@hpe.com>
> ---
>  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.<BR>
> -  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved. <BR>
> +  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
> + <BR>
>    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 = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE, FALSE);
> +      if (EFI_ERROR(Status)) {
> +        if (Status == EFI_ACCESS_DENIED) {
> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD),
> gShellLevel3HiiHandle, L"alias");
> +          ShellStatus = SHELL_ACCESS_DENIED;
> +        } else {
> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK),
> gShellLevel3HiiHandle, L"alias", Status);
> +          ShellStatus = SHELL_DEVICE_ERROR;
> +        }
> +      }
>      } else if (ShellCommandLineGetCount(Package) == 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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] ShellPkg/alias: Return status for alias deletion
  2017-06-06  8:43 ` Ni, Ruiyu
@ 2017-06-06 21:26   ` Ni, Ruiyu
  2017-06-06 21:37     ` Carsey, Jaben
  0 siblings, 1 reply; 13+ messages in thread
From: Ni, Ruiyu @ 2017-06-06 21:26 UTC (permalink / raw)
  To: Ni, Ruiyu, edk2-devel@lists.01.org; +Cc: Tapan Shah, Carsey, Jaben

Including Jaben for review.

Send from mobile phone

> 在 2017年6月6日,下午4:43,Ni, Ruiyu <ruiyu.ni@intel.com> 写道:
> 
> 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 <ruiyu.ni@intel.com>
>> Cc: Tapan Shah <tapandshah@hpe.com>
>> ---
>> 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.<BR>
>> -  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved. <BR>
>> +  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
>> + <BR>
>>   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 = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE, FALSE);
>> +      if (EFI_ERROR(Status)) {
>> +        if (Status == EFI_ACCESS_DENIED) {
>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD),
>> gShellLevel3HiiHandle, L"alias");
>> +          ShellStatus = SHELL_ACCESS_DENIED;
>> +        } else {
>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK),
>> gShellLevel3HiiHandle, L"alias", Status);
>> +          ShellStatus = SHELL_DEVICE_ERROR;
>> +        }
>> +      }
>>     } else if (ShellCommandLineGetCount(Package) == 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] ShellPkg/alias: Return status for alias deletion
  2017-06-06 21:26   ` Ni, Ruiyu
@ 2017-06-06 21:37     ` Carsey, Jaben
  2017-06-06 22:03       ` Shah, Tapan
  2017-06-07 15:35       ` Shah, Tapan
  0 siblings, 2 replies; 13+ messages in thread
From: Carsey, Jaben @ 2017-06-06 21:37 UTC (permalink / raw)
  To: Ni, Ruiyu, edk2-devel@lists.01.org

I am good with more clear error information coming to the user.
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

> -----Original Message-----
> From: Ni, Ruiyu
> Sent: Tuesday, June 06, 2017 2:26 PM
> To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
> Cc: Tapan Shah <tapandshah@hpe.com>; Carsey, Jaben
> <jaben.carsey@intel.com>
> Subject: Re: [edk2] [PATCH] ShellPkg/alias: Return status for alias deletion
> Importance: High
> 
> Including Jaben for review.
> 
> Send from mobile phone
> 
> > 在 2017年6月6日,下午4:43,Ni, Ruiyu <ruiyu.ni@intel.com> 写道:
> >
> > 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 <ruiyu.ni@intel.com>
> >> Cc: Tapan Shah <tapandshah@hpe.com>
> >> ---
> >> 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.<BR>
> >> -  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved. <BR>
> >> +  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
> >> + <BR>
> >>   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 = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE, FALSE);
> >> +      if (EFI_ERROR(Status)) {
> >> +        if (Status == EFI_ACCESS_DENIED) {
> >> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD),
> >> gShellLevel3HiiHandle, L"alias");
> >> +          ShellStatus = SHELL_ACCESS_DENIED;
> >> +        } else {
> >> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK),
> >> gShellLevel3HiiHandle, L"alias", Status);
> >> +          ShellStatus = SHELL_DEVICE_ERROR;
> >> +        }
> >> +      }
> >>     } else if (ShellCommandLineGetCount(Package) == 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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] ShellPkg/alias: Return status for alias deletion
  2017-06-06 21:37     ` Carsey, Jaben
@ 2017-06-06 22:03       ` Shah, Tapan
  2017-06-07 15:35       ` Shah, Tapan
  1 sibling, 0 replies; 13+ messages in thread
From: Shah, Tapan @ 2017-06-06 22:03 UTC (permalink / raw)
  To: Carsey, Jaben, Ni, Ruiyu, edk2-devel@lists.01.org

Instead of using  STR_GEN_ERR_UK here, it would be better to define a new string token as "alias: '<alias_name>' does not exist."

> >> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK),
> >> gShellLevel3HiiHandle, L"alias", Status);

Reviewed-by: Tapan Shah <tapandshah@hpe.com>

-----Original Message-----
From: Carsey, Jaben [mailto:jaben.carsey@intel.com] 
Sent: Tuesday, June 06, 2017 4:37 PM
To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
Cc: Shah, Tapan <tapandshah@hpe.com>
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 <jaben.carsey@intel.com>

> -----Original Message-----
> From: Ni, Ruiyu
> Sent: Tuesday, June 06, 2017 2:26 PM
> To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
> Cc: Tapan Shah <tapandshah@hpe.com>; Carsey, Jaben
> <jaben.carsey@intel.com>
> Subject: Re: [edk2] [PATCH] ShellPkg/alias: Return status for alias deletion
> Importance: High
> 
> Including Jaben for review.
> 
> Send from mobile phone
> 
> > 在 2017年6月6日,下午4:43,Ni, Ruiyu <ruiyu.ni@intel.com> 写道:
> >
> > 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 <ruiyu.ni@intel.com>
> >> Cc: Tapan Shah <tapandshah@hpe.com>
> >> ---
> >> 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.<BR>
> >> -  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved. <BR>
> >> +  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
> >> + <BR>
> >>   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 = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE, FALSE);
> >> +      if (EFI_ERROR(Status)) {
> >> +        if (Status == EFI_ACCESS_DENIED) {
> >> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD),
> >> gShellLevel3HiiHandle, L"alias");
> >> +          ShellStatus = SHELL_ACCESS_DENIED;
> >> +        } else {
> >> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK),
> >> gShellLevel3HiiHandle, L"alias", Status);
> >> +          ShellStatus = SHELL_DEVICE_ERROR;
> >> +        }
> >> +      }
> >>     } else if (ShellCommandLineGetCount(Package) == 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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] ShellPkg/alias: Return status for alias deletion
  2017-06-06 21:37     ` Carsey, Jaben
  2017-06-06 22:03       ` Shah, Tapan
@ 2017-06-07 15:35       ` Shah, Tapan
  2017-06-07 22:14         ` Ni, Ruiyu
  1 sibling, 1 reply; 13+ messages in thread
From: Shah, Tapan @ 2017-06-07 15:35 UTC (permalink / raw)
  To: Carsey, Jaben, Ni, Ruiyu, edk2-devel@lists.01.org

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' <jaben.carsey@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>; 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: '<alias_name>' does not exist."

> >> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN 
> >> + (STR_GEN_ERR_UK),
> >> gShellLevel3HiiHandle, L"alias", Status);

Reviewed-by: Tapan Shah <tapandshah@hpe.com>

-----Original Message-----
From: Carsey, Jaben [mailto:jaben.carsey@intel.com]
Sent: Tuesday, June 06, 2017 4:37 PM
To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
Cc: Shah, Tapan <tapandshah@hpe.com>
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 <jaben.carsey@intel.com>

> -----Original Message-----
> From: Ni, Ruiyu
> Sent: Tuesday, June 06, 2017 2:26 PM
> To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
> Cc: Tapan Shah <tapandshah@hpe.com>; Carsey, Jaben 
> <jaben.carsey@intel.com>
> Subject: Re: [edk2] [PATCH] ShellPkg/alias: Return status for alias 
> deletion
> Importance: High
> 
> Including Jaben for review.
> 
> Send from mobile phone
> 
> > 在 2017年6月6日,下午4:43,Ni, Ruiyu <ruiyu.ni@intel.com> 写道:
> >
> > 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 <ruiyu.ni@intel.com>
> >> Cc: Tapan Shah <tapandshah@hpe.com>
> >> ---
> >> 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.<BR>
> >> -  Copyright (c) 2009 - 2016, Intel Corporation. All rights 
> >> reserved. <BR>
> >> +  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
> >> + <BR>
> >>   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 = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE, 
> >> FALSE);
> >> +      if (EFI_ERROR(Status)) {
> >> +        if (Status == EFI_ACCESS_DENIED) {
> >> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN 
> >> + (STR_GEN_ERR_AD),
> >> gShellLevel3HiiHandle, L"alias");
> >> +          ShellStatus = SHELL_ACCESS_DENIED;
> >> +        } else {
> >> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN 
> >> + (STR_GEN_ERR_UK),
> >> gShellLevel3HiiHandle, L"alias", Status);
> >> +          ShellStatus = SHELL_DEVICE_ERROR;
> >> +        }
> >> +      }
> >>     } else if (ShellCommandLineGetCount(Package) == 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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] ShellPkg/alias: Return status for alias deletion
  2017-06-07 15:35       ` Shah, Tapan
@ 2017-06-07 22:14         ` Ni, Ruiyu
  2017-06-08 16:00           ` Shah, Tapan
  0 siblings, 1 reply; 13+ messages in thread
From: Ni, Ruiyu @ 2017-06-07 22:14 UTC (permalink / raw)
  To: Shah, Tapan; +Cc: Carsey, Jaben, edk2-devel@lists.01.org

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

> 在 2017年6月7日,下午11:35,Shah, Tapan <tapandshah@hpe.com> 写道:
> 
> 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' <jaben.carsey@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>; 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: '<alias_name>' does not exist."
> 
>>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
>>>> + (STR_GEN_ERR_UK),
>>>> gShellLevel3HiiHandle, L"alias", Status);
> 
> Reviewed-by: Tapan Shah <tapandshah@hpe.com>
> 
> -----Original Message-----
> From: Carsey, Jaben [mailto:jaben.carsey@intel.com]
> Sent: Tuesday, June 06, 2017 4:37 PM
> To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
> Cc: Shah, Tapan <tapandshah@hpe.com>
> 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 <jaben.carsey@intel.com>
> 
>> -----Original Message-----
>> From: Ni, Ruiyu
>> Sent: Tuesday, June 06, 2017 2:26 PM
>> To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
>> Cc: Tapan Shah <tapandshah@hpe.com>; Carsey, Jaben
>> <jaben.carsey@intel.com>
>> Subject: Re: [edk2] [PATCH] ShellPkg/alias: Return status for alias
>> deletion
>> Importance: High
>> 
>> Including Jaben for review.
>> 
>> Send from mobile phone
>> 
>>> 在 2017年6月6日,下午4:43,Ni, Ruiyu <ruiyu.ni@intel.com> 写道:
>>> 
>>> 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 <ruiyu.ni@intel.com>
>>>> Cc: Tapan Shah <tapandshah@hpe.com>
>>>> ---
>>>> 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.<BR>
>>>> -  Copyright (c) 2009 - 2016, Intel Corporation. All rights
>>>> reserved. <BR>
>>>> +  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
>>>> + <BR>
>>>>  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 = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE,
>>>> FALSE);
>>>> +      if (EFI_ERROR(Status)) {
>>>> +        if (Status == EFI_ACCESS_DENIED) {
>>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
>>>> + (STR_GEN_ERR_AD),
>>>> gShellLevel3HiiHandle, L"alias");
>>>> +          ShellStatus = SHELL_ACCESS_DENIED;
>>>> +        } else {
>>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
>>>> + (STR_GEN_ERR_UK),
>>>> gShellLevel3HiiHandle, L"alias", Status);
>>>> +          ShellStatus = SHELL_DEVICE_ERROR;
>>>> +        }
>>>> +      }
>>>>    } else if (ShellCommandLineGetCount(Package) == 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] ShellPkg/alias: Return status for alias deletion
  2017-06-07 22:14         ` Ni, Ruiyu
@ 2017-06-08 16:00           ` Shah, Tapan
  2017-06-08 16:10             ` Carsey, Jaben
  0 siblings, 1 reply; 13+ messages in thread
From: Shah, Tapan @ 2017-06-08 16:00 UTC (permalink / raw)
  To: Ni, Ruiyu; +Cc: Carsey, Jaben, edk2-devel@lists.01.org

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_UK.

-----Original Message-----
From: Ni, Ruiyu [mailto:ruiyu.ni@intel.com] 
Sent: Wednesday, June 07, 2017 5:14 PM
To: Shah, Tapan <tapandshah@hpe.com>
Cc: Carsey, Jaben <jaben.carsey@intel.com>; 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

> 在 2017年6月7日,下午11:35,Shah, Tapan <tapandshah@hpe.com> 写道:
> 
> 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' <jaben.carsey@intel.com>; Ni, Ruiyu 
> <ruiyu.ni@intel.com>; 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: '<alias_name>' does not exist."
> 
>>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN 
>>>> + (STR_GEN_ERR_UK),
>>>> gShellLevel3HiiHandle, L"alias", Status);
> 
> Reviewed-by: Tapan Shah <tapandshah@hpe.com>
> 
> -----Original Message-----
> From: Carsey, Jaben [mailto:jaben.carsey@intel.com]
> Sent: Tuesday, June 06, 2017 4:37 PM
> To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
> Cc: Shah, Tapan <tapandshah@hpe.com>
> 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 <jaben.carsey@intel.com>
> 
>> -----Original Message-----
>> From: Ni, Ruiyu
>> Sent: Tuesday, June 06, 2017 2:26 PM
>> To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
>> Cc: Tapan Shah <tapandshah@hpe.com>; Carsey, Jaben 
>> <jaben.carsey@intel.com>
>> Subject: Re: [edk2] [PATCH] ShellPkg/alias: Return status for alias 
>> deletion
>> Importance: High
>> 
>> Including Jaben for review.
>> 
>> Send from mobile phone
>> 
>>> 在 2017年6月6日,下午4:43,Ni, Ruiyu <ruiyu.ni@intel.com> 写道:
>>> 
>>> 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 <ruiyu.ni@intel.com>
>>>> Cc: Tapan Shah <tapandshah@hpe.com>
>>>> ---
>>>> 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.<BR>
>>>> -  Copyright (c) 2009 - 2016, Intel Corporation. All rights 
>>>> reserved. <BR>
>>>> +  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
>>>> + <BR>
>>>>  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 = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE, 
>>>> FALSE);
>>>> +      if (EFI_ERROR(Status)) {
>>>> +        if (Status == EFI_ACCESS_DENIED) {
>>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN 
>>>> + (STR_GEN_ERR_AD),
>>>> gShellLevel3HiiHandle, L"alias");
>>>> +          ShellStatus = SHELL_ACCESS_DENIED;
>>>> +        } else {
>>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN 
>>>> + (STR_GEN_ERR_UK),
>>>> gShellLevel3HiiHandle, L"alias", Status);
>>>> +          ShellStatus = SHELL_DEVICE_ERROR;
>>>> +        }
>>>> +      }
>>>>    } else if (ShellCommandLineGetCount(Package) == 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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] ShellPkg/alias: Return status for alias deletion
  2017-06-08 16:00           ` Shah, Tapan
@ 2017-06-08 16:10             ` Carsey, Jaben
  2017-06-08 16:14               ` Shah, Tapan
  0 siblings, 1 reply; 13+ messages in thread
From: Carsey, Jaben @ 2017-06-08 16:10 UTC (permalink / raw)
  To: Shah, Tapan, Ni, Ruiyu; +Cc: edk2-devel@lists.01.org

Tapa,

Is your thinking like this:

if (EFI_ERROR(Status)) {
  if (Status == EFI_ACCESS_DENIED) {
    ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel3HiiHandle, L"alias");
    ShellStatus = SHELL_ACCESS_DENIED;
  } else if (Status == EFI_NOT_FOUND) {
    ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_NOT_FOUND), gShellLevel3HiiHandle, L"alias");
    ShellStatus = SHELL_NOT_FOUND;
  } else {    ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel3HiiHandle, L"alias", Status);
    ShellStatus = 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 <ruiyu.ni@intel.com>
> Cc: Carsey, Jaben <jaben.carsey@intel.com>; 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_UK.
> 
> -----Original Message-----
> From: Ni, Ruiyu [mailto:ruiyu.ni@intel.com]
> Sent: Wednesday, June 07, 2017 5:14 PM
> To: Shah, Tapan <tapandshah@hpe.com>
> Cc: Carsey, Jaben <jaben.carsey@intel.com>; 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
> 
> > 在 2017年6月7日,下午11:35,Shah, Tapan <tapandshah@hpe.com> 写
> 道:
> >
> > 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' <jaben.carsey@intel.com>; Ni, Ruiyu
> > <ruiyu.ni@intel.com>; 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: '<alias_name>' does not exist."
> >
> >>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
> >>>> + (STR_GEN_ERR_UK),
> >>>> gShellLevel3HiiHandle, L"alias", Status);
> >
> > Reviewed-by: Tapan Shah <tapandshah@hpe.com>
> >
> > -----Original Message-----
> > From: Carsey, Jaben [mailto:jaben.carsey@intel.com]
> > Sent: Tuesday, June 06, 2017 4:37 PM
> > To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
> > Cc: Shah, Tapan <tapandshah@hpe.com>
> > 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 <jaben.carsey@intel.com>
> >
> >> -----Original Message-----
> >> From: Ni, Ruiyu
> >> Sent: Tuesday, June 06, 2017 2:26 PM
> >> To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
> >> Cc: Tapan Shah <tapandshah@hpe.com>; Carsey, Jaben
> >> <jaben.carsey@intel.com>
> >> Subject: Re: [edk2] [PATCH] ShellPkg/alias: Return status for alias
> >> deletion
> >> Importance: High
> >>
> >> Including Jaben for review.
> >>
> >> Send from mobile phone
> >>
> >>> 在 2017年6月6日,下午4:43,Ni, Ruiyu <ruiyu.ni@intel.com> 写道:
> >>>
> >>> 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 <ruiyu.ni@intel.com>
> >>>> Cc: Tapan Shah <tapandshah@hpe.com>
> >>>> ---
> >>>> 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.<BR>
> >>>> -  Copyright (c) 2009 - 2016, Intel Corporation. All rights
> >>>> reserved. <BR>
> >>>> +  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
> >>>> + <BR>
> >>>>  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 = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE,
> >>>> FALSE);
> >>>> +      if (EFI_ERROR(Status)) {
> >>>> +        if (Status == EFI_ACCESS_DENIED) {
> >>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
> >>>> + (STR_GEN_ERR_AD),
> >>>> gShellLevel3HiiHandle, L"alias");
> >>>> +          ShellStatus = SHELL_ACCESS_DENIED;
> >>>> +        } else {
> >>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
> >>>> + (STR_GEN_ERR_UK),
> >>>> gShellLevel3HiiHandle, L"alias", Status);
> >>>> +          ShellStatus = SHELL_DEVICE_ERROR;
> >>>> +        }
> >>>> +      }
> >>>>    } else if (ShellCommandLineGetCount(Package) == 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



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] ShellPkg/alias: Return status for alias deletion
  2017-06-08 16:10             ` Carsey, Jaben
@ 2017-06-08 16:14               ` Shah, Tapan
  2017-06-08 16:16                 ` Carsey, Jaben
  0 siblings, 1 reply; 13+ messages in thread
From: Shah, Tapan @ 2017-06-08 16:14 UTC (permalink / raw)
  To: Carsey, Jaben, Ni, Ruiyu; +Cc: edk2-devel@lists.01.org

Correct. 

STR_GEN_ERR_NOT_FOUND should be "alias: '<alias_name>' does not exist."


-----Original Message-----
From: Carsey, Jaben [mailto:jaben.carsey@intel.com] 
Sent: Thursday, June 08, 2017 11:10 AM
To: Shah, Tapan <tapandshah@hpe.com>; Ni, Ruiyu <ruiyu.ni@intel.com>
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 == EFI_ACCESS_DENIED) {
    ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel3HiiHandle, L"alias");
    ShellStatus = SHELL_ACCESS_DENIED;
  } else if (Status == EFI_NOT_FOUND) {
    ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_NOT_FOUND), gShellLevel3HiiHandle, L"alias");
    ShellStatus = SHELL_NOT_FOUND;
  } else {    ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel3HiiHandle, L"alias", Status);
    ShellStatus = 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 <ruiyu.ni@intel.com>
> Cc: Carsey, Jaben <jaben.carsey@intel.com>; 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_UK.
> 
> -----Original Message-----
> From: Ni, Ruiyu [mailto:ruiyu.ni@intel.com]
> Sent: Wednesday, June 07, 2017 5:14 PM
> To: Shah, Tapan <tapandshah@hpe.com>
> Cc: Carsey, Jaben <jaben.carsey@intel.com>; 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
> 
> > 在 2017年6月7日,下午11:35,Shah, Tapan <tapandshah@hpe.com> 写
> 道:
> >
> > 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' <jaben.carsey@intel.com>; Ni, Ruiyu 
> > <ruiyu.ni@intel.com>; 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: '<alias_name>' does not exist."
> >
> >>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN 
> >>>> + (STR_GEN_ERR_UK),
> >>>> gShellLevel3HiiHandle, L"alias", Status);
> >
> > Reviewed-by: Tapan Shah <tapandshah@hpe.com>
> >
> > -----Original Message-----
> > From: Carsey, Jaben [mailto:jaben.carsey@intel.com]
> > Sent: Tuesday, June 06, 2017 4:37 PM
> > To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
> > Cc: Shah, Tapan <tapandshah@hpe.com>
> > 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 <jaben.carsey@intel.com>
> >
> >> -----Original Message-----
> >> From: Ni, Ruiyu
> >> Sent: Tuesday, June 06, 2017 2:26 PM
> >> To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
> >> Cc: Tapan Shah <tapandshah@hpe.com>; Carsey, Jaben 
> >> <jaben.carsey@intel.com>
> >> Subject: Re: [edk2] [PATCH] ShellPkg/alias: Return status for alias 
> >> deletion
> >> Importance: High
> >>
> >> Including Jaben for review.
> >>
> >> Send from mobile phone
> >>
> >>> 在 2017年6月6日,下午4:43,Ni, Ruiyu <ruiyu.ni@intel.com> 写道:
> >>>
> >>> 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 <ruiyu.ni@intel.com>
> >>>> Cc: Tapan Shah <tapandshah@hpe.com>
> >>>> ---
> >>>> 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.<BR>
> >>>> -  Copyright (c) 2009 - 2016, Intel Corporation. All rights 
> >>>> reserved. <BR>
> >>>> +  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
> >>>> + <BR>
> >>>>  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 = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE, 
> >>>> FALSE);
> >>>> +      if (EFI_ERROR(Status)) {
> >>>> +        if (Status == EFI_ACCESS_DENIED) {
> >>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN 
> >>>> + (STR_GEN_ERR_AD),
> >>>> gShellLevel3HiiHandle, L"alias");
> >>>> +          ShellStatus = SHELL_ACCESS_DENIED;
> >>>> +        } else {
> >>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN 
> >>>> + (STR_GEN_ERR_UK),
> >>>> gShellLevel3HiiHandle, L"alias", Status);
> >>>> +          ShellStatus = SHELL_DEVICE_ERROR;
> >>>> +        }
> >>>> +      }
> >>>>    } else if (ShellCommandLineGetCount(Package) == 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



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] ShellPkg/alias: Return status for alias deletion
  2017-06-08 16:14               ` Shah, Tapan
@ 2017-06-08 16:16                 ` Carsey, Jaben
  2017-06-08 16:21                   ` Shah, Tapan
  0 siblings, 1 reply; 13+ messages in thread
From: Carsey, Jaben @ 2017-06-08 16:16 UTC (permalink / raw)
  To: Shah, Tapan, Ni, Ruiyu; +Cc: edk2-devel@lists.01.org

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 <jaben.carsey@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>
> 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: '<alias_name>' does not
> exist."
> 
> 
> -----Original Message-----
> From: Carsey, Jaben [mailto:jaben.carsey@intel.com]
> Sent: Thursday, June 08, 2017 11:10 AM
> To: Shah, Tapan <tapandshah@hpe.com>; Ni, Ruiyu <ruiyu.ni@intel.com>
> 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 == EFI_ACCESS_DENIED) {
>     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD),
> gShellLevel3HiiHandle, L"alias");
>     ShellStatus = SHELL_ACCESS_DENIED;
>   } else if (Status == EFI_NOT_FOUND) {
>     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
> (STR_GEN_ERR_NOT_FOUND), gShellLevel3HiiHandle, L"alias");
>     ShellStatus = SHELL_NOT_FOUND;
>   } else {    ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK),
> gShellLevel3HiiHandle, L"alias", Status);
>     ShellStatus = 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 <ruiyu.ni@intel.com>
> > Cc: Carsey, Jaben <jaben.carsey@intel.com>; 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_UK.
> >
> > -----Original Message-----
> > From: Ni, Ruiyu [mailto:ruiyu.ni@intel.com]
> > Sent: Wednesday, June 07, 2017 5:14 PM
> > To: Shah, Tapan <tapandshah@hpe.com>
> > Cc: Carsey, Jaben <jaben.carsey@intel.com>; 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
> >
> > > 在 2017年6月7日,下午11:35,Shah, Tapan <tapandshah@hpe.com>
> 写
> > 道:
> > >
> > > 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' <jaben.carsey@intel.com>; Ni, Ruiyu
> > > <ruiyu.ni@intel.com>; 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: '<alias_name>' does not exist."
> > >
> > >>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
> > >>>> + (STR_GEN_ERR_UK),
> > >>>> gShellLevel3HiiHandle, L"alias", Status);
> > >
> > > Reviewed-by: Tapan Shah <tapandshah@hpe.com>
> > >
> > > -----Original Message-----
> > > From: Carsey, Jaben [mailto:jaben.carsey@intel.com]
> > > Sent: Tuesday, June 06, 2017 4:37 PM
> > > To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
> > > Cc: Shah, Tapan <tapandshah@hpe.com>
> > > 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 <jaben.carsey@intel.com>
> > >
> > >> -----Original Message-----
> > >> From: Ni, Ruiyu
> > >> Sent: Tuesday, June 06, 2017 2:26 PM
> > >> To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
> > >> Cc: Tapan Shah <tapandshah@hpe.com>; Carsey, Jaben
> > >> <jaben.carsey@intel.com>
> > >> Subject: Re: [edk2] [PATCH] ShellPkg/alias: Return status for alias
> > >> deletion
> > >> Importance: High
> > >>
> > >> Including Jaben for review.
> > >>
> > >> Send from mobile phone
> > >>
> > >>> 在 2017年6月6日,下午4:43,Ni, Ruiyu <ruiyu.ni@intel.com> 写道
> :
> > >>>
> > >>> 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 <ruiyu.ni@intel.com>
> > >>>> Cc: Tapan Shah <tapandshah@hpe.com>
> > >>>> ---
> > >>>> 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.<BR>
> > >>>> -  Copyright (c) 2009 - 2016, Intel Corporation. All rights
> > >>>> reserved. <BR>
> > >>>> +  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
> > >>>> + <BR>
> > >>>>  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 = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE,
> > >>>> FALSE);
> > >>>> +      if (EFI_ERROR(Status)) {
> > >>>> +        if (Status == EFI_ACCESS_DENIED) {
> > >>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
> > >>>> + (STR_GEN_ERR_AD),
> > >>>> gShellLevel3HiiHandle, L"alias");
> > >>>> +          ShellStatus = SHELL_ACCESS_DENIED;
> > >>>> +        } else {
> > >>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
> > >>>> + (STR_GEN_ERR_UK),
> > >>>> gShellLevel3HiiHandle, L"alias", Status);
> > >>>> +          ShellStatus = SHELL_DEVICE_ERROR;
> > >>>> +        }
> > >>>> +      }
> > >>>>    } else if (ShellCommandLineGetCount(Package) == 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
> 



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] ShellPkg/alias: Return status for alias deletion
  2017-06-08 16:16                 ` Carsey, Jaben
@ 2017-06-08 16:21                   ` Shah, Tapan
  2017-06-09  3:14                     ` Ni, Ruiyu
  0 siblings, 1 reply; 13+ messages in thread
From: Shah, Tapan @ 2017-06-08 16:21 UTC (permalink / raw)
  To: Carsey, Jaben, Ni, Ruiyu; +Cc: edk2-devel@lists.01.org

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: <alias_name> not found."

-----Original Message-----
From: Carsey, Jaben [mailto:jaben.carsey@intel.com] 
Sent: Thursday, June 08, 2017 11:16 AM
To: Shah, Tapan <tapandshah@hpe.com>; Ni, Ruiyu <ruiyu.ni@intel.com>
Cc: edk2-devel@lists.01.org
Subject: RE: [edk2] [PATCH] ShellPkg/alias: Return status for alias deletion

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 <jaben.carsey@intel.com>; Ni, Ruiyu 
> <ruiyu.ni@intel.com>
> 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: '<alias_name>' does not 
> exist."
> 
> 
> -----Original Message-----
> From: Carsey, Jaben [mailto:jaben.carsey@intel.com]
> Sent: Thursday, June 08, 2017 11:10 AM
> To: Shah, Tapan <tapandshah@hpe.com>; Ni, Ruiyu <ruiyu.ni@intel.com>
> 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 == EFI_ACCESS_DENIED) {
>     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), 
> gShellLevel3HiiHandle, L"alias");
>     ShellStatus = SHELL_ACCESS_DENIED;
>   } else if (Status == EFI_NOT_FOUND) {
>     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN 
> (STR_GEN_ERR_NOT_FOUND), gShellLevel3HiiHandle, L"alias");
>     ShellStatus = SHELL_NOT_FOUND;
>   } else {    ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK),
> gShellLevel3HiiHandle, L"alias", Status);
>     ShellStatus = 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 <ruiyu.ni@intel.com>
> > Cc: Carsey, Jaben <jaben.carsey@intel.com>; 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_UK.
> >
> > -----Original Message-----
> > From: Ni, Ruiyu [mailto:ruiyu.ni@intel.com]
> > Sent: Wednesday, June 07, 2017 5:14 PM
> > To: Shah, Tapan <tapandshah@hpe.com>
> > Cc: Carsey, Jaben <jaben.carsey@intel.com>; 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
> >
> > > 在 2017年6月7日,下午11:35,Shah, Tapan <tapandshah@hpe.com>
> 写
> > 道:
> > >
> > > 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' <jaben.carsey@intel.com>; Ni, Ruiyu 
> > > <ruiyu.ni@intel.com>; 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: '<alias_name>' does not exist."
> > >
> > >>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN 
> > >>>> + (STR_GEN_ERR_UK),
> > >>>> gShellLevel3HiiHandle, L"alias", Status);
> > >
> > > Reviewed-by: Tapan Shah <tapandshah@hpe.com>
> > >
> > > -----Original Message-----
> > > From: Carsey, Jaben [mailto:jaben.carsey@intel.com]
> > > Sent: Tuesday, June 06, 2017 4:37 PM
> > > To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
> > > Cc: Shah, Tapan <tapandshah@hpe.com>
> > > 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 <jaben.carsey@intel.com>
> > >
> > >> -----Original Message-----
> > >> From: Ni, Ruiyu
> > >> Sent: Tuesday, June 06, 2017 2:26 PM
> > >> To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
> > >> Cc: Tapan Shah <tapandshah@hpe.com>; Carsey, Jaben 
> > >> <jaben.carsey@intel.com>
> > >> Subject: Re: [edk2] [PATCH] ShellPkg/alias: Return status for 
> > >> alias deletion
> > >> Importance: High
> > >>
> > >> Including Jaben for review.
> > >>
> > >> Send from mobile phone
> > >>
> > >>> 在 2017年6月6日,下午4:43,Ni, Ruiyu <ruiyu.ni@intel.com> 写道
> :
> > >>>
> > >>> 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 <ruiyu.ni@intel.com>
> > >>>> Cc: Tapan Shah <tapandshah@hpe.com>
> > >>>> ---
> > >>>> 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.<BR>
> > >>>> -  Copyright (c) 2009 - 2016, Intel Corporation. All rights 
> > >>>> reserved. <BR>
> > >>>> +  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
> > >>>> + <BR>
> > >>>>  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 = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE, 
> > >>>> FALSE);
> > >>>> +      if (EFI_ERROR(Status)) {
> > >>>> +        if (Status == EFI_ACCESS_DENIED) {
> > >>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN 
> > >>>> + (STR_GEN_ERR_AD),
> > >>>> gShellLevel3HiiHandle, L"alias");
> > >>>> +          ShellStatus = SHELL_ACCESS_DENIED;
> > >>>> +        } else {
> > >>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN 
> > >>>> + (STR_GEN_ERR_UK),
> > >>>> gShellLevel3HiiHandle, L"alias", Status);
> > >>>> +          ShellStatus = SHELL_DEVICE_ERROR;
> > >>>> +        }
> > >>>> +      }
> > >>>>    } else if (ShellCommandLineGetCount(Package) == 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
> 



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] ShellPkg/alias: Return status for alias deletion
  2017-06-08 16:21                   ` Shah, Tapan
@ 2017-06-09  3:14                     ` Ni, Ruiyu
  0 siblings, 0 replies; 13+ messages in thread
From: Ni, Ruiyu @ 2017-06-09  3:14 UTC (permalink / raw)
  To: Shah, Tapan, Carsey, Jaben; +Cc: edk2-devel@lists.01.org

All,
I just sent out a patch "[edk2] [PATCH] Shell/alias: Print detailed error when 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 <jaben.carsey@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] [PATCH] ShellPkg/alias: Return status for alias deletion
> 
> 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: <alias_name> not
> found."
> 
> -----Original Message-----
> From: Carsey, Jaben [mailto:jaben.carsey@intel.com]
> Sent: Thursday, June 08, 2017 11:16 AM
> To: Shah, Tapan <tapandshah@hpe.com>; Ni, Ruiyu <ruiyu.ni@intel.com>
> Cc: edk2-devel@lists.01.org
> Subject: RE: [edk2] [PATCH] ShellPkg/alias: Return status for alias deletion
> 
> 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 <jaben.carsey@intel.com>; Ni, Ruiyu
> > <ruiyu.ni@intel.com>
> > 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: '<alias_name>' does not
> > exist."
> >
> >
> > -----Original Message-----
> > From: Carsey, Jaben [mailto:jaben.carsey@intel.com]
> > Sent: Thursday, June 08, 2017 11:10 AM
> > To: Shah, Tapan <tapandshah@hpe.com>; Ni, Ruiyu <ruiyu.ni@intel.com>
> > 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 == EFI_ACCESS_DENIED) {
> >     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD),
> > gShellLevel3HiiHandle, L"alias");
> >     ShellStatus = SHELL_ACCESS_DENIED;
> >   } else if (Status == EFI_NOT_FOUND) {
> >     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
> > (STR_GEN_ERR_NOT_FOUND), gShellLevel3HiiHandle, L"alias");
> >     ShellStatus = SHELL_NOT_FOUND;
> >   } else {    ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK),
> > gShellLevel3HiiHandle, L"alias", Status);
> >     ShellStatus = 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 <ruiyu.ni@intel.com>
> > > Cc: Carsey, Jaben <jaben.carsey@intel.com>; 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_UK.
> > >
> > > -----Original Message-----
> > > From: Ni, Ruiyu [mailto:ruiyu.ni@intel.com]
> > > Sent: Wednesday, June 07, 2017 5:14 PM
> > > To: Shah, Tapan <tapandshah@hpe.com>
> > > Cc: Carsey, Jaben <jaben.carsey@intel.com>; 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
> > >
> > > > 在 2017年6月7日,下午11:35,Shah, Tapan
> <tapandshah@hpe.com>
> > 写
> > > 道:
> > > >
> > > > 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' <jaben.carsey@intel.com>; Ni, Ruiyu
> > > > <ruiyu.ni@intel.com>; 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: '<alias_name>' does not exist."
> > > >
> > > >>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
> > > >>>> + (STR_GEN_ERR_UK),
> > > >>>> gShellLevel3HiiHandle, L"alias", Status);
> > > >
> > > > Reviewed-by: Tapan Shah <tapandshah@hpe.com>
> > > >
> > > > -----Original Message-----
> > > > From: Carsey, Jaben [mailto:jaben.carsey@intel.com]
> > > > Sent: Tuesday, June 06, 2017 4:37 PM
> > > > To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
> > > > Cc: Shah, Tapan <tapandshah@hpe.com>
> > > > 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 <jaben.carsey@intel.com>
> > > >
> > > >> -----Original Message-----
> > > >> From: Ni, Ruiyu
> > > >> Sent: Tuesday, June 06, 2017 2:26 PM
> > > >> To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
> > > >> Cc: Tapan Shah <tapandshah@hpe.com>; Carsey, Jaben
> > > >> <jaben.carsey@intel.com>
> > > >> Subject: Re: [edk2] [PATCH] ShellPkg/alias: Return status for
> > > >> alias deletion
> > > >> Importance: High
> > > >>
> > > >> Including Jaben for review.
> > > >>
> > > >> Send from mobile phone
> > > >>
> > > >>> 在 2017年6月6日,下午4:43,Ni, Ruiyu <ruiyu.ni@intel.com> 写
> 道
> > :
> > > >>>
> > > >>> 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 <ruiyu.ni@intel.com>
> > > >>>> Cc: Tapan Shah <tapandshah@hpe.com>
> > > >>>> ---
> > > >>>> 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.<BR>
> > > >>>> -  Copyright (c) 2009 - 2016, Intel Corporation. All rights
> > > >>>> reserved. <BR>
> > > >>>> +  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
> > > >>>> + <BR>
> > > >>>>  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 = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE,
> > > >>>> FALSE);
> > > >>>> +      if (EFI_ERROR(Status)) {
> > > >>>> +        if (Status == EFI_ACCESS_DENIED) {
> > > >>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
> > > >>>> + (STR_GEN_ERR_AD),
> > > >>>> gShellLevel3HiiHandle, L"alias");
> > > >>>> +          ShellStatus = SHELL_ACCESS_DENIED;
> > > >>>> +        } else {
> > > >>>> +          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
> > > >>>> + (STR_GEN_ERR_UK),
> > > >>>> gShellLevel3HiiHandle, L"alias", Status);
> > > >>>> +          ShellStatus = SHELL_DEVICE_ERROR;
> > > >>>> +        }
> > > >>>> +      }
> > > >>>>    } else if (ShellCommandLineGetCount(Package) == 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
> >
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-06-09  3:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-06  8:29 [PATCH] ShellPkg/alias: Return status for alias deletion Ruiyu Ni
2017-06-06  8:43 ` Ni, Ruiyu
2017-06-06 21:26   ` Ni, Ruiyu
2017-06-06 21:37     ` Carsey, Jaben
2017-06-06 22:03       ` Shah, Tapan
2017-06-07 15:35       ` Shah, Tapan
2017-06-07 22:14         ` Ni, Ruiyu
2017-06-08 16:00           ` Shah, Tapan
2017-06-08 16:10             ` Carsey, Jaben
2017-06-08 16:14               ` Shah, Tapan
2017-06-08 16:16                 ` Carsey, Jaben
2017-06-08 16:21                   ` Shah, Tapan
2017-06-09  3:14                     ` Ni, Ruiyu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox