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