summaryrefslogtreecommitdiffstats
path: root/tests/vhost-user-test.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2015-11-16 13:33:36 +0200
committerMichael S. Tsirkin <mst@redhat.com>2015-11-16 14:35:05 +0200
commit87656d50181e1be475303c1b88be6df0963c5bfd (patch)
treeafa290e33b438b342ba29834fb120b273feabfa5 /tests/vhost-user-test.c
parenta586e65bbd017ab55fe4149dd1bcba5c3a72bcd1 (diff)
downloadhqemu-87656d50181e1be475303c1b88be6df0963c5bfd.zip
hqemu-87656d50181e1be475303c1b88be6df0963c5bfd.tar.gz
vhost-user-test: support VHOST_USER_SET_VRING_ENABLE
vhost-user-test is broken now: it assumes QEMU sends RESET_OWNER, and we stopped doing that. Wait for ENABLE_RING with 0 instead. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'tests/vhost-user-test.c')
-rw-r--r--tests/vhost-user-test.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 01cfc7e..022223b 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -70,6 +70,7 @@ typedef enum VhostUserRequest {
VHOST_USER_SET_VRING_ERR = 14,
VHOST_USER_GET_PROTOCOL_FEATURES = 15,
VHOST_USER_SET_PROTOCOL_FEATURES = 16,
+ VHOST_USER_SET_VRING_ENABLE = 18,
VHOST_USER_MAX
} VhostUserRequest;
@@ -315,8 +316,10 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)
g_cond_signal(&s->data_cond);
break;
- case VHOST_USER_RESET_OWNER:
- s->fds_num = 0;
+ case VHOST_USER_SET_VRING_ENABLE:
+ if (!msg.payload.state.num) {
+ s->fds_num = 0;
+ }
break;
default:
OpenPOWER on IntegriCloud