vdpa_sim: add get_config callback in vdpasim_dev_attr
authorStefano Garzarella <sgarzare@redhat.com>
Tue, 15 Dec 2020 14:42:50 +0000 (15:42 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 18 Dec 2020 21:14:29 +0000 (16:14 -0500)
commit65b709586e222fa6ffd4166ac7fdb5d5dad113ee
tree1b58b4a05b266770ca51549f408362de28e1c698
parentf37cbbc65178e0a45823d281d290c4c02da9631c
vdpa_sim: add get_config callback in vdpasim_dev_attr

The get_config callback can be used by the device to fill the
config structure.
The callback will be invoked in vdpasim_get_config() before copying
bytes into caller buffer.

Move vDPA-net config updates from vdpasim_set_features() in the
new vdpasim_net_get_config() callback.
This is safe since in vdpa_get_config() we already check that
.set_features() callback is called before .get_config().

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20201215144256.155342-13-sgarzare@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vdpa/vdpa_sim/vdpa_sim.c