ringtest: commonize implementation of poll_avail/poll_used

Provide new primitives used_empty/avail_empty and
build poll_avail/poll_used on top of it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Paolo Bonzini
2016-10-06 11:39:11 +02:00
committed by Michael S. Tsirkin
parent 44d65ea161
commit d3c3589b8b
6 changed files with 43 additions and 83 deletions

View File

@@ -24,8 +24,9 @@ void *get_buf(unsigned *lenp, void **bufp)
return "Buffer";
}
void poll_used(void)
bool used_empty()
{
return false;
}
void disable_call()
@@ -54,8 +55,9 @@ bool enable_kick()
assert(0);
}
void poll_avail(void)
bool avail_empty()
{
return false;
}
bool use_buf(unsigned *lenp, void **bufp)