vdpa_sim: move buffer allocation in the devices
authorStefano Garzarella <sgarzare@redhat.com>
Fri, 7 Apr 2023 13:36:57 +0000 (15:36 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 21 Apr 2023 07:02:35 +0000 (03:02 -0400)
commit112f23cd72a2975e11986d73575e2c3651ea4c7e
treea4468732b77987ec9bb864516d7e98c3b804f4ef
parent5b250fac7c76b670dd1b28b67f1a91a1907bc117
vdpa_sim: move buffer allocation in the devices

Currently, the vdpa_sim core does not use the buffer, but only
allocates it.

The buffer is used by devices differently, and some future devices
may not use it. So let's move all its management inside the devices.

Add a new `free` device callback called to clean up the resources
allocated by the device.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20230407133658.66339-2-sgarzare@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vdpa/vdpa_sim/vdpa_sim.c
drivers/vdpa/vdpa_sim/vdpa_sim.h
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c
drivers/vdpa/vdpa_sim/vdpa_sim_net.c