From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH 06/17] vhost: introduce API to fetch negotiated features Date: Thu, 16 Mar 2017 15:35:16 +0800 Message-ID: <20170316073516.GQ18844@yliu-dev.sh.intel.com> References: <1488534682-3494-1-git-send-email-yuanhan.liu@linux.intel.com> <1488534682-3494-7-git-send-email-yuanhan.liu@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, Harris James R , Liu Changpeng To: Maxime Coquelin Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 7F0B71396 for ; Thu, 16 Mar 2017 08:37:00 +0100 (CET) Content-Disposition: inline In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Mar 14, 2017 at 12:02:59PM +0100, Maxime Coquelin wrote: > >+uint64_t > >+rte_vhost_get_negotiated_features(int vid) > >+{ > >+ struct virtio_net *dev; > >+ > >+ dev = get_device(vid); > >+ if (!dev) > >+ return -1; > >+ > >+ return dev->features; > >+} > Are we sure the negotiation is done when we can get the device? Yes. However, one thing worth noting is that the features may change after the new_device() callback. Notablely, when live migration starts /ends, the VHOST_F_LOG_ALL will be set/cleared, respectively. >>From that point of view, we need a new callback, something like features_changed(), or live_migration_starts()? Or a better name? --yliu