nvmf: use spdk_uuid_copy() API instead of memcpy.
For NVMeoF, extened host identifer is used which is exactly the same size as uuid, while here, use uuid data structure makes sense. For NVMeoF reservation features, host identifier need to be used with each registrant, using spdk_uuid_compare becomes straightforward. Change-Id: Ib6ffaa92fab5e0ae5037682be14fcc415f9714d7 Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-on: https://review.gerrithub.io/436302 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Tested-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
31e8fb4025
commit
187e2dfbbf
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user