Revision: 17723
          http://sourceforge.net/p/edk2/code/17723
Author:   luobozhang
Date:     2015-06-29 02:21:54 +0000 (Mon, 29 Jun 2015)
Log Message:
-----------
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 <[email protected]>
Reviewed-by: Ye Ting <[email protected]>

Modified Paths:
--------------
    trunk/edk2/NetworkPkg/IScsiDxe/IScsiConfig.c

Modified: trunk/edk2/NetworkPkg/IScsiDxe/IScsiConfig.c
===================================================================
--- trunk/edk2/NetworkPkg/IScsiDxe/IScsiConfig.c        2015-06-26 16:09:52 UTC 
(rev 17722)
+++ trunk/edk2/NetworkPkg/IScsiDxe/IScsiConfig.c        2015-06-29 02:21:54 UTC 
(rev 17723)
@@ -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.<BR>
+Copyright (c) 2004 - 2015, 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
@@ -2160,6 +2160,25 @@
   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;
 


------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to