From 20553a1a0e33ffd2a39ccbb89dd6b2e719230666 Mon Sep 17 00:00:00 2001 From: Pawel Wodkowski Date: Fri, 15 Jun 2018 17:15:19 +0200 Subject: [PATCH] vhost: switch to new API in JSON RPC info Change-Id: I6640c1c3f01f9a0f2f783821355e2e949b72dcd2 Signed-off-by: Pawel Wodkowski Reviewed-on: https://review.gerrithub.io/415460 Tested-by: SPDK Automated Test System Reviewed-by: Daniel Verkamp Reviewed-by: Jim Harris --- lib/vhost/vhost_rpc.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/vhost/vhost_rpc.c b/lib/vhost/vhost_rpc.c index 94ccec86dc..14d410475b 100644 --- a/lib/vhost/vhost_rpc.c +++ b/lib/vhost/vhost_rpc.c @@ -469,20 +469,14 @@ spdk_rpc_get_vhost_controllers_cb(struct spdk_vhost_dev *vdev, void *arg) spdk_json_write_object_begin(ctx->w); - spdk_json_write_name(ctx->w, "ctrlr"); - spdk_json_write_string(ctx->w, spdk_vhost_dev_get_name(vdev)); + spdk_json_write_named_string(ctx->w, "ctrlr", spdk_vhost_dev_get_name(vdev)); + spdk_json_write_named_string_fmt(ctx->w, "cpumask", "0x%s", spdk_cpuset_fmt(vdev->cpumask)); - spdk_json_write_name(ctx->w, "cpumask"); - spdk_json_write_string_fmt(ctx->w, "0x%s", spdk_cpuset_fmt(vdev->cpumask)); - - spdk_json_write_name(ctx->w, "backend_specific"); - - spdk_json_write_object_begin(ctx->w); + spdk_json_write_named_object_begin(ctx->w, "backend_specific"); spdk_vhost_dump_info_json(vdev, ctx->w); spdk_json_write_object_end(ctx->w); - spdk_json_write_object_end(ctx->w); // ctrl - + spdk_json_write_object_end(ctx->w); return 0; }