From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH 06/17] vhost: introduce API to fetch negotiated features Date: Thu, 16 Mar 2017 10:22:27 +0100 Message-ID: References: <1488534682-3494-1-git-send-email-yuanhan.liu@linux.intel.com> <1488534682-3494-7-git-send-email-yuanhan.liu@linux.intel.com> <20170316073516.GQ18844@yliu-dev.sh.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, Harris James R , Liu Changpeng To: Yuanhan Liu Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 244141075 for ; Thu, 16 Mar 2017 10:22:34 +0100 (CET) In-Reply-To: <20170316073516.GQ18844@yliu-dev.sh.intel.com> 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 03/16/2017 08:35 AM, Yuanhan Liu wrote: > 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. Good point. > From that point of view, we need a new callback, something like > features_changed(), or live_migration_starts()? Or a better name? I would name it features_changed() to be future-proof (even if I don't foresee other cases than live migration right now). Thanks, Maxime