diff --git a/lib/nvmf/ctrlr.c b/lib/nvmf/ctrlr.c index f139d3460..f7e56f2cc 100644 --- a/lib/nvmf/ctrlr.c +++ b/lib/nvmf/ctrlr.c @@ -182,7 +182,7 @@ spdk_nvmf_ctrlr_create(struct spdk_nvmf_subsystem *subsystem, ctrlr->feat.number_of_queues.bits.nsqr = transport->opts.max_qpairs_per_ctrlr - 1 - 1; - memcpy(ctrlr->hostid, connect_data->hostid, sizeof(ctrlr->hostid)); + spdk_uuid_copy(&ctrlr->hostid, (struct spdk_uuid *)connect_data->hostid); ctrlr->vcprop.cap.raw = 0; ctrlr->vcprop.cap.bits.cqr = 1; /* NVMe-oF specification required */ @@ -855,7 +855,7 @@ spdk_nvmf_ctrlr_get_features_host_identifier(struct spdk_nvmf_request *req) return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE; } - memcpy(req->data, ctrlr->hostid, sizeof(ctrlr->hostid)); + spdk_uuid_copy((struct spdk_uuid *)req->data, &ctrlr->hostid); return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE; } diff --git a/lib/nvmf/nvmf_internal.h b/lib/nvmf/nvmf_internal.h index 07c8a316b..89de3dd2b 100644 --- a/lib/nvmf/nvmf_internal.h +++ b/lib/nvmf/nvmf_internal.h @@ -216,7 +216,7 @@ struct spdk_nvmf_ctrlr { struct spdk_nvmf_request *aer_req; union spdk_nvme_async_event_completion notice_event; - uint8_t hostid[16]; + struct spdk_uuid hostid; uint16_t changed_ns_list_count; struct spdk_nvme_ns_list changed_ns_list;