Spdk/test/unit/lib/nvme
Darek Stojaczyk c049304a95 env: add spdk_pci_device_unclaim()
spdk_pci_device_claim() could create a file on the
filesystem that couldn't be deleted programatically.
It could only be overwritten - e.g. by another spdk
instance - but this didn't really work if that
another instance had less privileges and hence no
access to the previous file.

This is exactly the case we're seeing on our CI when
running SPDK as non-root. In general it's a good idea
not to leave any leftover files, so now we'll delete
the pci claim file when the spdk process exits.

spdk_pci_device_claim() used to return a file descriptor
that could be simply closed to "un-claim" the device.
It'll now return only a return code. The fd will be
stored inside spdk_pci_device and will be closed either
when user calls the newly introduced spdk_pci_device_unclaim(),
or when the device is detached.

We'll still need to clean up those files somewhere in
our test scripts (probably ./setup.sh cleanup) to
clean up after crashed processes or so - but we don't
necessarily want to run such scripts inside the autotest
whenever a non-root spdk is about to be started.

Change-Id: I797e079417bb56491013cc5b92f0f0d14f451d18
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467107
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-09-18 20:34:39 +00:00
..
nvme_ctrlr_cmd.c nvme: add Get/Set Feature wrappers with NSID 2018-06-12 17:59:33 +00:00
nvme_ctrlr_ocssd_cmd.c ocssd: nvme driver public API extension for Open-Channel 2018-06-12 17:59:33 +00:00
nvme_ctrlr.c nvme: add NVME_QUIRK_DELAY_BEFORE_INIT quirk 2019-08-26 17:35:06 +00:00
nvme_ns_cmd.c ut/nvme: switch to spdk_*malloc(). 2019-07-16 10:51:47 +00:00
nvme_ns_ocssd_cmd.c nvme: assign qpair when req is allocated 2019-06-04 00:01:35 +00:00
nvme_ns.c nvme: add helper to wait for internal commands 2018-05-28 01:43:55 +00:00
nvme_pcie.c env: add spdk_pci_device_unclaim() 2019-09-18 20:34:39 +00:00
nvme_qpair.c nvme_qpair_ut: Fix scanbuild warning about using freed memory. 2019-07-23 04:50:29 +00:00
nvme_quirks.c nvme: add debug logs for matched quirks 2018-02-23 10:07:39 -05:00
nvme_rdma.c test/unit: remove unnecessary mock definitions 2019-01-13 00:48:20 +00:00
nvme_tcp.c nvme/tcp: Change hdr in nvme_tcp_pdu to pointer 2019-08-28 15:38:02 +00:00
nvme.c ut/nvme: silence scan-build warnings about null dereference 2019-07-26 17:47:34 +00:00
Makefile nvme/tcp: add unit test to verify the bug in nvmf_tcp_pdu_set_data_buf 2019-07-01 08:28:20 +00:00