Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
OSD-TARGET: Changes to receive an osd name from tgtadm through tgtd a…
…nd record the osd name.

This is patch 2/2. The first patch modifies tgtadm and tgtd to
get the osd name as parameter from command line. usage has
explained at the first patch [1/2].

Signed-off-by: Jay Martinez <jmartinez@ubuntu.(none)>
  • Loading branch information
Jay Martinez authored and Boaz Harrosh committed Nov 3, 2011
1 parent 893407a commit fd43003
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions osd-target/cdb.h
Expand Up @@ -29,5 +29,6 @@ int osdemu_cmd_submit(struct osd_device *osd, uint8_t *cdb,
const uint8_t *data_in, uint64_t data_in_len,
uint8_t **data_out, uint64_t *data_out_len,
uint8_t *sense_out, int *senselen_out);
int osd_set_name(struct osd_device *osd, char *osdname);

#endif /* __CDB_H */
16 changes: 16 additions & 0 deletions osd-target/osd.c
Expand Up @@ -1084,6 +1084,22 @@ out:
return ret;
}

int osd_set_name(struct osd_device *osd, char *osdname)
{
int ret = 0;

osd_info("Setting osdname => %s",osdname);

ret = attr_set_attr(osd->dbc, 0, 0, ROOT_INFO_PG,RIAP_OSD_NAME,
osdname, strlen(osdname));

if ( OSD_OK != ret){
osd_error("!attr_set_attr => %d", ret);
}

return ret;
}

int osd_close(struct osd_device *osd)
{
int ret;
Expand Down

0 comments on commit fd43003

Please sign in to comment.