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

Reply via email to