lib/nvmf/vfio_user.c
/*
 * Returns 0 on success and -errno on error.
 */
Returns 0 on success and -errno on error.
Returns 0 on success and - errno on error .
static int
consume_admin_cmd(struct nvmf_vfio_user_ctrlr *ctrlr, struct spdk_nvme_cmd *cmd)
{
	assert(ctrlr != NULL);
	assert(cmd != NULL);
	if (cmd->fuse != 0) {
		return post_completion(ctrlr, &ctrlr->qp[0]->cq, 0, 0, cmd->cid,
				       SPDK_NVME_SC_INVALID_FIELD,
				       SPDK_NVME_SCT_GENERIC);
	}
	switch (cmd->opc) {
	case SPDK_NVME_OPC_CREATE_IO_CQ:
	case SPDK_NVME_OPC_CREATE_IO_SQ:
		return handle_create_io_q(ctrlr, cmd,
					  cmd->opc == SPDK_NVME_OPC_CREATE_IO_CQ);
	case SPDK_NVME_OPC_DELETE_IO_SQ:
	case SPDK_NVME_OPC_DELETE_IO_CQ:
		return handle_del_io_q(ctrlr, cmd,
				       cmd->opc == SPDK_NVME_OPC_DELETE_IO_CQ);
	default:
		return handle_cmd_req(ctrlr, cmd, ctrlr->qp[0]);
	}
}
static int consume_admin_cmd ( struct nvmf_vfio_user_ctrlr * ctrlr , struct spdk_nvme_cmd * cmd ) { assert ( ctrlr != NULL ) ; assert ( cmd != NULL ) ; if ( cmd -> fuse != 0 ) { return post_completion ( ctrlr , & ctrlr -> qp [ 0 ] -> cq , 0 , 0 , cmd -> cid , SPDK_NVME_SC_INVALID_FIELD , SPDK_NVME_SCT_GENERIC ) ; } switch ( cmd -> opc ) { case SPDK_NVME_OPC_CREATE_IO_CQ : case SPDK_NVME_OPC_CREATE_IO_SQ : return handle_create_io_q ( ctrlr , cmd , cmd -> opc == SPDK_NVME_OPC_CREATE_IO_CQ ) ; case SPDK_NVME_OPC_DELETE_IO_SQ : case SPDK_NVME_OPC_DELETE_IO_CQ : return handle_del_io_q ( ctrlr , cmd , cmd -> opc == SPDK_NVME_OPC_DELETE_IO_CQ ) ; default : return handle_cmd_req ( ctrlr , cmd , ctrlr -> qp [ 0 ] ) ; } }
Returns 0 on success and -errno on error.
Returns 0 on success and - errno on error .
/* Fused admin commands are not supported. */