mirror of
https://github.com/xcat2/xNBA.git
synced 2024-12-23 19:51:46 +00:00
Added iBFT construction to iSCSI boot test
This commit is contained in:
parent
22511400c7
commit
7e95980858
@ -14,7 +14,7 @@ static int test_dhcp_aoe_boot ( struct net_device *netdev,
|
||||
return test_aoeboot ( netdev, aoename, drivenum );
|
||||
}
|
||||
|
||||
static int test_dhcp_iscsi_boot ( char *iscsiname ) {
|
||||
static int test_dhcp_iscsi_boot ( struct net_device *netdev, char *iscsiname ) {
|
||||
char *initiator_iqn = "iqn.1900-01.localdomain.localhost:initiator";
|
||||
char *target_iqn;
|
||||
union {
|
||||
@ -33,7 +33,7 @@ static int test_dhcp_iscsi_boot ( char *iscsiname ) {
|
||||
}
|
||||
inet_aton ( iscsiname, &target.sin.sin_addr );
|
||||
|
||||
return test_iscsiboot ( initiator_iqn, &target.st, target_iqn );
|
||||
return test_iscsiboot ( initiator_iqn, &target.st, target_iqn, netdev );
|
||||
}
|
||||
|
||||
static int test_dhcp_hello ( char *helloname ) {
|
||||
@ -97,7 +97,7 @@ static int test_dhcp_boot ( struct net_device *netdev, char *filename ) {
|
||||
if ( strncmp ( filename, "aoe:", 4 ) == 0 ) {
|
||||
return test_dhcp_aoe_boot ( netdev, &filename[4] );
|
||||
} else if ( strncmp ( filename, "iscsi:", 6 ) == 0 ) {
|
||||
return test_dhcp_iscsi_boot ( &filename[6] );
|
||||
return test_dhcp_iscsi_boot ( netdev, &filename[6] );
|
||||
} else if ( strncmp ( filename, "hello:", 6 ) == 0 ) {
|
||||
return test_dhcp_hello ( &filename[6] );
|
||||
} else if ( strncmp ( filename, "http:", 5 ) == 0 ) {
|
||||
|
@ -3,14 +3,15 @@
|
||||
#include <vsprintf.h>
|
||||
#include <gpxe/netdevice.h>
|
||||
#include <gpxe/iscsi.h>
|
||||
#include <gpxe/ibft.h>
|
||||
#include <int13.h>
|
||||
|
||||
static struct iscsi_device test_iscsidev;
|
||||
|
||||
int test_iscsiboot ( const char *initiator_iqn,
|
||||
struct sockaddr_tcpip *target,
|
||||
const char *target_iqn ) {
|
||||
struct sockaddr_in *sin;
|
||||
const char *target_iqn,
|
||||
struct net_device *netdev ) {
|
||||
struct int13_drive drive;
|
||||
int rc;
|
||||
|
||||
@ -26,6 +27,8 @@ int test_iscsiboot ( const char *initiator_iqn,
|
||||
return rc;
|
||||
}
|
||||
|
||||
ibft_fill_data ( netdev, initiator_iqn, target, target_iqn );
|
||||
|
||||
memset ( &drive, 0, sizeof ( drive ) );
|
||||
drive.blockdev = &test_iscsidev.scsi.blockdev;
|
||||
register_int13_drive ( &drive );
|
||||
|
Loading…
Reference in New Issue
Block a user