From 357e2f7f4e4dc68f01d5b81f5cd669874314e14a Mon Sep 17 00:00:00 2001 From: Greg Kurz Date: Thu, 1 Feb 2018 21:21:28 +0100 Subject: tests: virtio-9p: add FLUSH operation test The idea is to send a victim request that will possibly block in the server and to send a flush request to cancel the victim request. This patch adds two test to verifiy that: - the server does not reply to a victim request that was actually cancelled - the server replies to the flush request after replying to the victim request if it could not cancel it 9p request cancellation reference: http://man.cat-v.org/plan_9/5/flush Signed-off-by: Greg Kurz Reviewed-by: Stefan Hajnoczi (groug, change the test to only write a single byte to avoid any alignment or endianess consideration) --- hw/9pfs/9p-synth.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'hw/9pfs/9p-synth.h') diff --git a/hw/9pfs/9p-synth.h b/hw/9pfs/9p-synth.h index a74032d7bd..af7a993a1e 100644 --- a/hw/9pfs/9p-synth.h +++ b/hw/9pfs/9p-synth.h @@ -55,4 +55,11 @@ int qemu_v9fs_synth_add_file(V9fsSynthNode *parent, int mode, #define QTEST_V9FS_SYNTH_LOPEN_FILE "LOPEN" #define QTEST_V9FS_SYNTH_WRITE_FILE "WRITE" +/* Any write to the "FLUSH" file is handled one byte at a time by the + * backend. If the byte is zero, the backend returns success (ie, 1), + * otherwise it forces the server to try again forever. Thus allowing + * the client to cancel the request. + */ +#define QTEST_V9FS_SYNTH_FLUSH_FILE "FLUSH" + #endif -- cgit v1.2.3