diff --git a/osd-target/cdb.h b/osd-target/cdb.h index e60b88a..98b98bb 100644 --- a/osd-target/cdb.h +++ b/osd-target/cdb.h @@ -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 */ diff --git a/osd-target/osd.c b/osd-target/osd.c index a7d9cb1..bb7d0e6 100644 --- a/osd-target/osd.c +++ b/osd-target/osd.c @@ -1084,6 +1084,22 @@ int osd_open(const char *root, struct osd_device *osd) 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;