]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg: Check whether the iSCSI initiator name is null.
authorZhang Lubo <lubo.zhang@intel.com>
Mon, 29 Jun 2015 02:21:54 +0000 (02:21 +0000)
committerluobozhang <luobozhang@Edk2>
Mon, 29 Jun 2015 02:21:54 +0000 (02:21 +0000)
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

NetworkPkg/IScsiDxe/IScsiConfig.c

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