From patchwork Fri Mar 30 02:46:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liu, Changpeng" X-Patchwork-Id: 10316755 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 519F260383 for ; Fri, 30 Mar 2018 02:40:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4156E2A324 for ; Fri, 30 Mar 2018 02:40:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3586D2A32D; Fri, 30 Mar 2018 02:40:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E397B2A324 for ; Fri, 30 Mar 2018 02:40:00 +0000 (UTC) Received: from localhost ([::1]:51990 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f1jxQ-0004vq-5j for patchwork-qemu-devel@patchwork.kernel.org; Thu, 29 Mar 2018 22:40:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f1jwK-0004Au-Dj for qemu-devel@nongnu.org; Thu, 29 Mar 2018 22:38:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f1jwJ-0007Ni-Ki for qemu-devel@nongnu.org; Thu, 29 Mar 2018 22:38:52 -0400 Received: from mga17.intel.com ([192.55.52.151]:20624) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f1jwJ-0007Fy-Ax for qemu-devel@nongnu.org; Thu, 29 Mar 2018 22:38:51 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Mar 2018 19:38:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,378,1517904000"; d="scan'208";a="32663908" Received: from fedora.sh.intel.com ([10.67.114.176]) by fmsmga002.fm.intel.com with ESMTP; 29 Mar 2018 19:38:44 -0700 From: Changpeng Liu To: changpeng.liu@intel.com, qemu-devel@nongnu.org Date: Fri, 30 Mar 2018 10:46:17 +0800 Message-Id: <1522377977-29623-2-git-send-email-changpeng.liu@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1522377977-29623-1-git-send-email-changpeng.liu@intel.com> References: <1522377977-29623-1-git-send-email-changpeng.liu@intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.151 Subject: [Qemu-devel] [PATCH 2/2] 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: marcandre.lureau@redhat.com, maxime.coquelin@redhat.com, mst@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch reports the protocol feature that is only advertised by QEMU if the device implements the config ops. Signed-off-by: Changpeng Liu --- 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-blk/vhost-user-blk.c index 67dac81..f6e0170 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; } +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) { @@ -372,6 +378,7 @@ vub_set_config(VuDev *vu_dev, const uint8_t *data, static const VuDevIface vub_iface = { .get_features = vub_get_features, + .get_protocol_features = vub_get_protocol_features, .queue_set_started = vub_queue_set_started, .get_config = vub_get_config, .set_config = vub_set_config,