Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[infiniband] Include hostname in node description, if available
  • Loading branch information
Michael Brown committed Nov 16, 2009
1 parent e701822 commit 228ac9d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/net/infiniband/ib_sma.c
Expand Up @@ -25,6 +25,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <stdio.h>
#include <unistd.h>
#include <byteswap.h>
#include <gpxe/settings.h>
#include <gpxe/infiniband.h>
#include <gpxe/iobuf.h>
#include <gpxe/ib_mi.h>
Expand Down Expand Up @@ -88,13 +89,18 @@ static void ib_sma_node_desc ( struct ib_device *ibdev,
struct ib_address_vector *av ) {
struct ib_node_desc *node_desc = &mad->smp.smp_data.node_desc;
struct ib_gid_half guid;
char hostname[ sizeof ( node_desc->node_string ) ];
int hostname_len;
int rc;

/* Fill in information */
memset ( node_desc, 0, sizeof ( *node_desc ) );
ib_get_hca_info ( ibdev, &guid );
hostname_len = fetch_string_setting ( NULL, &hostname_setting,
hostname, sizeof ( hostname ) );
snprintf ( node_desc->node_string, sizeof ( node_desc->node_string ),
"gPXE %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x (%s)",
"gPXE %s%s%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x (%s)",
hostname, ( ( hostname_len >= 0 ) ? " " : "" ),
guid.u.bytes[0], guid.u.bytes[1], guid.u.bytes[2],
guid.u.bytes[3], guid.u.bytes[4], guid.u.bytes[5],
guid.u.bytes[6], guid.u.bytes[7], ibdev->dev->name );
Expand Down

0 comments on commit 228ac9d

Please sign in to comment.