Skip to content

Commit 518083d

Browse files
stefano-garzarellamstsirkin
authored andcommitted
vdpa_sim_blk: add support for VIRTIO_BLK_T_FLUSH
The simulator behaves like a ramdisk, so we don't have to do anything when a VIRTIO_BLK_T_FLUSH request is received, but it could be useful to test driver behavior. Let's expose the VIRTIO_BLK_F_FLUSH feature to inform the driver that we support the flush command. Signed-off-by: Stefano Garzarella <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent ac926e1 commit 518083d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/vdpa/vdpa_sim/vdpa_sim_blk.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#define DRV_LICENSE "GPL v2"
2626

2727
#define VDPASIM_BLK_FEATURES (VDPASIM_FEATURES | \
28+
(1ULL << VIRTIO_BLK_F_FLUSH) | \
2829
(1ULL << VIRTIO_BLK_F_SIZE_MAX) | \
2930
(1ULL << VIRTIO_BLK_F_SEG_MAX) | \
3031
(1ULL << VIRTIO_BLK_F_BLK_SIZE) | \
@@ -188,6 +189,10 @@ static bool vdpasim_blk_handle_req(struct vdpasim *vdpasim,
188189
pushed += bytes;
189190
break;
190191

192+
case VIRTIO_BLK_T_FLUSH:
193+
/* nothing to do */
194+
break;
195+
191196
default:
192197
dev_dbg(&vdpasim->vdpa.dev,
193198
"Unsupported request type %d\n", type);

0 commit comments

Comments
 (0)