From nobody Mon May 6 15:52:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1526681596136991.5765152673508; Fri, 18 May 2018 15:13:16 -0700 (PDT) Received: from localhost ([::1]:41050 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJncg-0001lJ-Vn for importer@patchew.org; Fri, 18 May 2018 18:13:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJnb4-00013W-Ih for qemu-devel@nongnu.org; Fri, 18 May 2018 18:11:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJnb0-0000Hj-IA for qemu-devel@nongnu.org; Fri, 18 May 2018 18:11:34 -0400 Received: from mga02.intel.com ([134.134.136.20]:8331) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fJnb0-0000HT-AD for qemu-devel@nongnu.org; Fri, 18 May 2018 18:11:30 -0400 Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 May 2018 15:11:28 -0700 Received: from fedora.sh.intel.com ([10.67.114.176]) by orsmga006.jf.intel.com with ESMTP; 18 May 2018 15:11:27 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,416,1520924400"; d="scan'208";a="42991932" From: Changpeng Liu To: qemu-devel@nongnu.org Date: Sat, 19 May 2018 06:20:46 +0800 Message-Id: <1526682046-17414-1-git-send-email-changpeng.liu@intel.com> X-Mailer: git-send-email 1.9.3 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.20 Subject: [Qemu-devel] [PATCH] contrib/vhost-user-blk: enable protocol feature for vhost-user-blk X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: changpeng.liu@intel.com, stefanha@redhat.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch reports the protocol feature that is only advertised by QEMU if the device implements the config ops. Signed-off-by: Changpeng Liu Reviewed-by: Stefan Hajnoczi --- contrib/vhost-user-blk/vhost-user-blk.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-b= lk/vhost-user-blk.c index 67dac81..a6a132a 100644 --- a/contrib/vhost-user-blk/vhost-user-blk.c +++ b/contrib/vhost-user-blk/vhost-user-blk.c @@ -311,6 +311,12 @@ vub_get_features(VuDev *dev) 1ull << VHOST_USER_F_PROTOCOL_FEATURES; } =20 +static uint64_t +vub_get_protocol_features(VuDev *dev) +{ + return 1ull << VHOST_USER_PROTOCOL_F_CONFIG; +} + static int vub_get_config(VuDev *vu_dev, uint8_t *config, uint32_t len) { @@ -373,6 +379,7 @@ vub_set_config(VuDev *vu_dev, const uint8_t *data, static const VuDevIface vub_iface =3D { .get_features =3D vub_get_features, .queue_set_started =3D vub_queue_set_started, + .get_protocol_features =3D vub_get_protocol_features, .get_config =3D vub_get_config, .set_config =3D vub_set_config, }; --=20 1.9.3