vtest: --multi-clients requires version 3

Protocol version 3 uses server-generated, rather than client-generated,
resource ids.  Without that, clients could pick conflicting resource
ids.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Chia-I Wu 5 years ago
parent c0c079f19d
commit 4e2c25f752
  1. 6
      vtest/vtest_renderer.c
  2. 2
      vtest/vtest_server.c

@ -444,6 +444,9 @@ int vtest_lazy_init_context(struct vtest_context *ctx)
if (ctx->context_initialized)
return 0;
if (renderer.multi_clients && ctx->protocol_version < 3)
return report_failed_call("protocol version too low", -EINVAL);
if (ctx->capset_id) {
ret = virgl_renderer_context_create_with_flags(ctx->ctx_id,
ctx->capset_id,
@ -530,6 +533,9 @@ int vtest_protocol_version(UNUSED uint32_t length_dw)
version = 0;
}
if (renderer.multi_clients && version < 3)
return report_failed_call("protocol version too low", -EINVAL);
ctx->protocol_version = version;
hdr_buf[VTEST_CMD_LEN] = VCMD_PROTOCOL_VERSION_SIZE;

@ -186,7 +186,7 @@ static void vtest_server_parse_args(int argc, char **argv)
server.loop = false;
break;
case OPT_MULTI_CLIENTS:
printf("EXPERIMENTAL: clients must know and trust each other\n");
printf("multi-clients enabled: clients must trust each other\n");
server.multi_clients = true;
break;
case OPT_USE_GLX:

Loading…
Cancel
Save