vhost: add socket path in info dump
This also save CWD on init so socket path is no longer relative. Change-Id: I303401fe0340f0bc2ea5e4ba468361f68ea84c3d Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-on: https://review.gerrithub.io/419067 Reviewed-by: Karol Latecki <karol.latecki@intel.com> Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com> Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com> Reviewed-by: Paweł Niedźwiecki <pawelx.niedzwiecki@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
parent
a0f4eeaf38
commit
fdd6dbc902
@ -1317,8 +1317,22 @@ int
|
||||
spdk_vhost_init(void)
|
||||
{
|
||||
uint32_t last_core;
|
||||
size_t len;
|
||||
int ret;
|
||||
|
||||
if (dev_dirname[0] == '\0') {
|
||||
if (getcwd(dev_dirname, sizeof(dev_dirname) - 1) == NULL) {
|
||||
SPDK_ERRLOG("getcwd failed (%d): %s\n", errno, spdk_strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
len = strlen(dev_dirname);
|
||||
if (dev_dirname[len - 1] != '/') {
|
||||
dev_dirname[len] = '/';
|
||||
dev_dirname[len + 1] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
last_core = spdk_env_get_last_core();
|
||||
g_num_ctrlrs = calloc(last_core + 1, sizeof(uint32_t));
|
||||
if (!g_num_ctrlrs) {
|
||||
|
@ -477,6 +477,7 @@ spdk_rpc_get_vhost_controllers_cb(struct spdk_vhost_dev *vdev, void *arg)
|
||||
spdk_json_write_named_string_fmt(ctx->w, "cpumask", "0x%s", spdk_cpuset_fmt(vdev->cpumask));
|
||||
spdk_json_write_named_uint32(ctx->w, "delay_base_us", delay_base_us);
|
||||
spdk_json_write_named_uint32(ctx->w, "iops_threshold", iops_threshold);
|
||||
spdk_json_write_named_string(ctx->w, "socket", vdev->path);
|
||||
|
||||
spdk_json_write_named_object_begin(ctx->w, "backend_specific");
|
||||
spdk_vhost_dump_info_json(vdev, ctx->w);
|
||||
|
@ -7,12 +7,12 @@ INITIATOR_JSON_DIR=$(readlink -f $(dirname $0))
|
||||
# Test also virtio_pci bdevs
|
||||
function construct_vhost_devices() {
|
||||
$rpc_py construct_split_vbdev Nvme0n1 4
|
||||
$rpc_py construct_vhost_scsi_controller $JSON_DIR/naa.Nvme0n1p0.0
|
||||
$rpc_py construct_vhost_scsi_controller $JSON_DIR/naa.Nvme0n1p1.1
|
||||
$rpc_py add_vhost_scsi_lun $JSON_DIR/naa.Nvme0n1p0.0 0 Nvme0n1p0
|
||||
$rpc_py add_vhost_scsi_lun $JSON_DIR/naa.Nvme0n1p1.1 0 Nvme0n1p1
|
||||
$rpc_py construct_vhost_blk_controller $JSON_DIR/naa.Nvme0n1p2.0 Nvme0n1p2
|
||||
$rpc_py construct_vhost_blk_controller $JSON_DIR/naa.Nvme0n1p3.1 Nvme0n1p3
|
||||
$rpc_py construct_vhost_scsi_controller naa.Nvme0n1p0.0
|
||||
$rpc_py construct_vhost_scsi_controller naa.Nvme0n1p1.1
|
||||
$rpc_py add_vhost_scsi_lun naa.Nvme0n1p0.0 0 Nvme0n1p0
|
||||
$rpc_py add_vhost_scsi_lun naa.Nvme0n1p1.1 0 Nvme0n1p1
|
||||
$rpc_py construct_vhost_blk_controller naa.Nvme0n1p2.0 Nvme0n1p2
|
||||
$rpc_py construct_vhost_blk_controller naa.Nvme0n1p3.1 Nvme0n1p3
|
||||
pci_scsi=$(lspci -nn -D | grep '1af4:1004' | head -1 | awk '{print $1;}')
|
||||
pci_blk=$(lspci -nn -D | grep '1af4:1001' | head -1 | awk '{print $1;}')
|
||||
if [ ! -z $pci_scsi ]; then
|
||||
@ -25,8 +25,8 @@ function construct_vhost_devices() {
|
||||
|
||||
# Load virtio initiator with bdevs
|
||||
function connect_to_vhost_devices_from_initiator() {
|
||||
$rpc_py construct_virtio_dev -t user -a $JSON_DIR/naa.Nvme0n1p0.0 -d scsi Nvme0n1p0
|
||||
$rpc_py construct_virtio_dev -t user -a $JSON_DIR/naa.Nvme0n1p2.0 -d blk Nvme0n1p2
|
||||
$rpc_py construct_virtio_dev -t user -a naa.Nvme0n1p0.0 -d scsi Nvme0n1p0
|
||||
$rpc_py construct_virtio_dev -t user -a naa.Nvme0n1p2.0 -d blk Nvme0n1p2
|
||||
}
|
||||
|
||||
function disconnect_and_clear_vhost_devices() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user