From patchwork Tue Sep 8 07:38:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuanhan Liu X-Patchwork-Id: 515297 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 ozlabs.org (Postfix) with ESMTPS id 570F2140134 for ; Tue, 8 Sep 2015 17:37:09 +1000 (AEST) Received: from localhost ([::1]:60492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZDSl-0006ZD-F6 for incoming@patchwork.ozlabs.org; Tue, 08 Sep 2015 03:37:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZDSC-0005Yh-Ct for qemu-devel@nongnu.org; Tue, 08 Sep 2015 03:36:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZDS8-0004Vb-DE for qemu-devel@nongnu.org; Tue, 08 Sep 2015 03:36:32 -0400 Received: from mga14.intel.com ([192.55.52.115]:7535) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZDS8-0004V8-8a for qemu-devel@nongnu.org; Tue, 08 Sep 2015 03:36:28 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 08 Sep 2015 00:36:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,488,1437462000"; d="scan'208";a="784835021" Received: from yliu-dev.sh.intel.com ([10.239.66.60]) by fmsmga001.fm.intel.com with ESMTP; 08 Sep 2015 00:35:44 -0700 From: Yuanhan Liu To: qemu-devel@nongnu.org Date: Tue, 8 Sep 2015 15:38:43 +0800 Message-Id: <1441697927-16456-4-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1441697927-16456-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1441697927-16456-1-git-send-email-yuanhan.liu@linux.intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.115 Cc: Yuanhan Liu , changchun.ouyang@intel.com, mst@redhat.com Subject: [Qemu-devel] [PATCH 3/7] vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Quote from Michael: We really should rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE. Suggested-by: Michael S. Tsirkin Signed-off-by: Yuanhan Liu --- docs/specs/vhost-user.txt | 4 ++-- hw/net/vhost_net.c | 2 +- hw/virtio/vhost-user.c | 6 +++--- linux-headers/linux/vhost.h | 2 +- tests/vhost-user-test.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/specs/vhost-user.txt b/docs/specs/vhost-user.txt index 70da3b1..ccbbcbb 100644 --- a/docs/specs/vhost-user.txt +++ b/docs/specs/vhost-user.txt @@ -194,10 +194,10 @@ Message types as an owner of the session. This can be used on the Slave as a "session start" flag. - * VHOST_USER_RESET_OWNER + * VHOST_USER_RESET_DEVICE Id: 4 - Equivalent ioctl: VHOST_RESET_OWNER + Equivalent ioctl: VHOST_RESET_DEVICE Master payload: N/A Issued when a new connection is about to be closed. The Master will no diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index c864237..33b0e97 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -287,7 +287,7 @@ static void vhost_net_stop_one(struct vhost_net *net, } else if (net->nc->info->type == NET_CLIENT_OPTIONS_KIND_VHOST_USER) { for (file.index = 0; file.index < net->dev.nvqs; ++file.index) { const VhostOps *vhost_ops = net->dev.vhost_ops; - int r = vhost_ops->vhost_call(&net->dev, VHOST_RESET_OWNER, + int r = vhost_ops->vhost_call(&net->dev, VHOST_RESET_DEVICE, NULL); assert(r >= 0); } diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index b4d8952..192ea4e 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -32,7 +32,7 @@ typedef enum VhostUserRequest { VHOST_USER_GET_FEATURES = 1, VHOST_USER_SET_FEATURES = 2, VHOST_USER_SET_OWNER = 3, - VHOST_USER_RESET_OWNER = 4, + VHOST_USER_RESET_DEVICE = 4, VHOST_USER_SET_MEM_TABLE = 5, VHOST_USER_SET_LOG_BASE = 6, VHOST_USER_SET_LOG_FD = 7, @@ -98,7 +98,7 @@ static unsigned long int ioctl_to_vhost_user_request[VHOST_USER_MAX] = { VHOST_GET_FEATURES, /* VHOST_USER_GET_FEATURES */ VHOST_SET_FEATURES, /* VHOST_USER_SET_FEATURES */ VHOST_SET_OWNER, /* VHOST_USER_SET_OWNER */ - VHOST_RESET_OWNER, /* VHOST_USER_RESET_OWNER */ + VHOST_RESET_DEVICE, /* VHOST_USER_RESET_DEVICE */ VHOST_SET_MEM_TABLE, /* VHOST_USER_SET_MEM_TABLE */ VHOST_SET_LOG_BASE, /* VHOST_USER_SET_LOG_BASE */ VHOST_SET_LOG_FD, /* VHOST_USER_SET_LOG_FD */ @@ -221,7 +221,7 @@ static int vhost_user_call(struct vhost_dev *dev, unsigned long int request, break; case VHOST_USER_SET_OWNER: - case VHOST_USER_RESET_OWNER: + case VHOST_USER_RESET_DEVICE: break; case VHOST_USER_SET_MEM_TABLE: diff --git a/linux-headers/linux/vhost.h b/linux-headers/linux/vhost.h index ead86db..14a0160 100644 --- a/linux-headers/linux/vhost.h +++ b/linux-headers/linux/vhost.h @@ -78,7 +78,7 @@ struct vhost_memory { #define VHOST_SET_OWNER _IO(VHOST_VIRTIO, 0x01) /* Give up ownership, and reset the device to default values. * Allows subsequent call to VHOST_OWNER_SET to succeed. */ -#define VHOST_RESET_OWNER _IO(VHOST_VIRTIO, 0x02) +#define VHOST_RESET_DEVICE _IO(VHOST_VIRTIO, 0x02) /* Set up/modify memory layout */ #define VHOST_SET_MEM_TABLE _IOW(VHOST_VIRTIO, 0x03, struct vhost_memory) diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c index 75fedf0..e301db7 100644 --- a/tests/vhost-user-test.c +++ b/tests/vhost-user-test.c @@ -58,7 +58,7 @@ typedef enum VhostUserRequest { VHOST_USER_GET_FEATURES = 1, VHOST_USER_SET_FEATURES = 2, VHOST_USER_SET_OWNER = 3, - VHOST_USER_RESET_OWNER = 4, + VHOST_USER_RESET_DEVICE = 4, VHOST_USER_SET_MEM_TABLE = 5, VHOST_USER_SET_LOG_BASE = 6, VHOST_USER_SET_LOG_FD = 7,