libxnvme_ident.h#

Structs#

xnvme_ident#

struct xnvme_ident#

Representation of device identifiers once decoded from text-representation.

Public Members

char subnqn[256]#
char uri[XNVME_IDENT_URI_LEN]#
uint32_t dtype#
uint32_t nsid#
uint8_t csi#
char kernel_driver[32]#
char iommu_group[8]#

IOMMU group of the PCI function or of the namespace’s controller.

uint8_t rsvd[15]#

Functions#

xnvme_ident_from_uri#

int xnvme_ident_from_uri(const char *uri, struct xnvme_ident *ident)#

Parse the given ‘uri’ into xnvme_ident.

Parameters:
  • uri

  • ident – Pointer to ident to fill with values parsed from ‘uri’

Returns:

On success, 0 is returned. On error, negative errno is returned.

Header#

/**
 * SPDX-FileCopyrightText: Samsung Electronics Co., Ltd
 *
 * SPDX-License-Identifier: BSD-3-Clause
 *
 * @file libxnvme_ident.h
 */

/** Size, in bytes, of the 'uri' of ::xnvme_ident, its terminating NUL included */
#define XNVME_IDENT_URI_LEN 384

/**
 * Representation of device identifiers once decoded from text-representation
 *
 * @struct xnvme_ident
 */
struct xnvme_ident {
	char subnqn[256];

	char uri[XNVME_IDENT_URI_LEN];
	uint32_t dtype;

	uint32_t nsid;
	uint8_t csi;

	char kernel_driver[32];
	char iommu_group[8]; ///< IOMMU group of the PCI function or of the namespace's controller
	uint8_t rsvd[15];
};
XNVME_STATIC_ASSERT(sizeof(struct xnvme_ident) == 704, "Incorrect size")

/**
 * Parse the given 'uri' into ::xnvme_ident
 *
 * @param uri
 * @param ident Pointer to ident to fill with values parsed from 'uri'
 *
 * @return On success, 0 is returned. On error, negative `errno` is returned.
 */
int
xnvme_ident_from_uri(const char *uri, struct xnvme_ident *ident);