numam-spdk/lib/vhost
Darek Stojaczyk 3f12b5fa1e vhost/blk: check against hotremoved bdev in GET_CONFIG handler
We always need to ensure bvdev->bdev is not NULL before
accessing it. GET_CONFIG handler was standing out in this
matter, causing segfaults when connecting to a vhost block
device that went through a bdev hotremove.

If the bdev has been hotremoved we'll now report
blocksize == 0 and blockcount == 0. From what I checked,
QEMU will still expose a virtio-blk device to the VM, but
linux (because that's what I checked) won't create a block
device for it.

Note: The behavior above can be tricky to investigate as
neither QEMU nor VM doesn't log any messages about it.

We should eventually reject any new connections to a vhost-blk
socket with hotremoved bdev, but that's a task for later.

Fixes #460

Change-Id: I266257f4b35d07f35ba03adf46cb18425f3cf39a
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/417934
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2018-10-23 17:54:46 +00:00
..
rte_vhost rte_vhost: include <asm/mman.h> for CentOS-6 2018-10-11 20:47:40 +00:00
Makefile vhost_user_nvme: add vhost user nvme target to SPDK 2018-04-03 15:01:24 -04:00
vhost_blk.c vhost/blk: check against hotremoved bdev in GET_CONFIG handler 2018-10-23 17:54:46 +00:00
vhost_internal.h vhost: embed destroy ctx into vhost dev struct 2018-10-03 18:43:54 +00:00
vhost_nvme.c vhost_nvme: add support for bdev_io_wait implement 2018-10-04 21:57:09 +00:00
vhost_rpc.c vhost: rpc: add an optional parameter -n/--name for get_vhost_controllers 2018-10-04 23:33:04 +00:00
vhost_scsi.c vhost: embed destroy ctx into vhost dev struct 2018-10-03 18:43:54 +00:00
vhost.c vhost: don't lock global vhost mutex when waiting for device start/stop 2018-09-28 18:46:11 +00:00