NetworkPkg: Check whether the iSCSI initiator name is null.

Popup a warning if iSCSI initiator name is null before attempt configure.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17723 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Zhang Lubo 2015-06-29 02:21:54 +00:00 committed by luobozhang
parent 79d274b8b6
commit e9da7deaa4
1 changed files with 20 additions and 1 deletions

View File

@ -1,7 +1,7 @@
/** @file /** @file
Helper functions for configuring or getting the parameters relating to iSCSI. Helper functions for configuring or getting the parameters relating to iSCSI.
Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR> Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -2160,6 +2160,25 @@ IScsiFormCallback (
if (Action == EFI_BROWSER_ACTION_CHANGING) { if (Action == EFI_BROWSER_ACTION_CHANGING) {
switch (QuestionId) { switch (QuestionId) {
case KEY_ADD_ATTEMPT: case KEY_ADD_ATTEMPT:
//
// Check whether iSCSI initiator name is configured already.
//
mPrivate->InitiatorNameLength = ISCSI_NAME_MAX_SIZE;
Status = gIScsiInitiatorName.Get (
&gIScsiInitiatorName,
&mPrivate->InitiatorNameLength,
mPrivate->InitiatorName
);
if (EFI_ERROR (Status)) {
CreatePopUp (
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
&Key,
L"Error: please configure iSCSI initiator name first!",
NULL
);
break;
}
Status = IScsiConfigAddAttempt (); Status = IScsiConfigAddAttempt ();
break; break;