From e9da7deaa475fee947760d49e46c74bae90449ad Mon Sep 17 00:00:00 2001 From: Zhang Lubo Date: Mon, 29 Jun 2015 02:21:54 +0000 Subject: [PATCH] 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 Reviewed-by: Ye Ting git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17723 6f19259b-4bc3-4df7-8a09-765794883524 --- NetworkPkg/IScsiDxe/IScsiConfig.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c b/NetworkPkg/IScsiDxe/IScsiConfig.c index c6b48c651b..5cb11572bb 100644 --- a/NetworkPkg/IScsiDxe/IScsiConfig.c +++ b/NetworkPkg/IScsiDxe/IScsiConfig.c @@ -1,7 +1,7 @@ /** @file Helper functions for configuring or getting the parameters relating to iSCSI. -Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
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 @@ -2160,6 +2160,25 @@ IScsiFormCallback ( if (Action == EFI_BROWSER_ACTION_CHANGING) { switch (QuestionId) { 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 (); break; -- 2.39.2