Quellcode durchsuchen

Make the "drive number" option apply to iSCSI as well as AoE

tags/v0.9.3
Michael Brown vor 18 Jahren
Ursprung
Commit
70d4b4f7cf
2 geänderte Dateien mit 8 neuen und 3 gelöschten Zeilen
  1. 5
    2
      src/tests/dhcptest.c
  2. 3
    1
      src/tests/iscsiboot.c

+ 5
- 2
src/tests/dhcptest.c Datei anzeigen

@@ -23,7 +23,8 @@ static int test_dhcp_iscsi_boot ( struct net_device *netdev, char *iscsiname ) {
23 23
 		struct sockaddr_in sin;
24 24
 		struct sockaddr_tcpip st;
25 25
 	} target;
26
-
26
+	unsigned int drivenum;
27
+	
27 28
 	memset ( &target, 0, sizeof ( target ) );
28 29
 	target.sin.sin_family = AF_INET;
29 30
 	target.sin.sin_port = htons ( ISCSI_PORT );
@@ -40,8 +41,10 @@ static int test_dhcp_iscsi_boot ( struct net_device *netdev, char *iscsiname ) {
40 41
 	dhcp_snprintf ( password, sizeof ( password ),
41 42
 			find_global_dhcp_option ( DHCP_EB_PASSWORD ) );
42 43
 
44
+	drivenum = find_global_dhcp_num_option ( DHCP_EB_BIOS_DRIVE );
45
+
43 46
 	return test_iscsiboot ( initiator_iqn, &target.st, target_iqn,
44
-				username, password, netdev );
47
+				username, password, netdev, drivenum );
45 48
 }
46 49
 
47 50
 static int test_dhcp_hello ( char *helloname ) {

+ 3
- 1
src/tests/iscsiboot.c Datei anzeigen

@@ -15,7 +15,8 @@ int test_iscsiboot ( const char *initiator_iqn,
15 15
 		     const char *target_iqn,
16 16
 		     const char *username,
17 17
 		     const char *password,
18
-		     struct net_device *netdev ) {
18
+		     struct net_device *netdev,
19
+		     unsigned int drivenum ) {
19 20
 	struct int13_drive drive;
20 21
 	int rc;
21 22
 
@@ -36,6 +37,7 @@ int test_iscsiboot ( const char *initiator_iqn,
36 37
 	ibft_fill_data ( netdev, initiator_iqn, target, target_iqn );
37 38
 #endif
38 39
 	memset ( &drive, 0, sizeof ( drive ) );
40
+	drive.drive = drivenum;
39 41
 	drive.blockdev = &test_iscsidev.scsi.blockdev;
40 42
 	register_int13_drive ( &drive );
41 43
 	printf ( "Registered %s as BIOS drive %#02x\n",

Laden…
Abbrechen
Speichern