Lines Matching refs:ctrl
93 struct libxenvchan *ctrl; member
98 static void vchan_wr(struct libxenvchan *ctrl) { in vchan_wr() argument
103 ret = libxenvchan_write(ctrl, inbuf, insiz); in vchan_wr()
222 struct libxenvchan *ctrl = NULL; in connect_vchan() local
253 ctrl = libxenvchan_client_init(NULL, domid, path); in connect_vchan()
254 if (ctrl) in connect_vchan()
271 return ctrl; in connect_vchan()
275 static void discard_buffers(struct libxenvchan *ctrl) { in discard_buffers() argument
281 while (libxenvchan_data_ready(ctrl)) { in discard_buffers()
282 if (libxenvchan_read(ctrl, inbuf, BUFSIZE) == -1) { in discard_buffers()
295 libxenvchan_fd = libxenvchan_fd_for_select(state->ctrl); in data_loop()
322 libxenvchan_wait(state->ctrl); in data_loop()
323 if (!libxenvchan_is_open(state->ctrl)) { in data_loop()
332 discard_buffers(state->ctrl); in data_loop()
335 vchan_wr(state->ctrl); in data_loop()
348 vchan_wr(state->ctrl); in data_loop()
349 libxenvchan_wait(state->ctrl); in data_loop()
360 vchan_wr(state->ctrl); in data_loop()
364 while (libxenvchan_data_ready(state->ctrl) && outsiz < BUFSIZE) { in data_loop()
365 ret = libxenvchan_read(state->ctrl, outbuf + outsiz, in data_loop()
395 struct vchan_proxy_state state = { .ctrl = NULL, in main()
437 state.ctrl = libxenvchan_server_init(NULL, domid, vchan_path, 0, 0); in main()
438 if (!state.ctrl) { in main()
475 while (libxenvchan_is_open(state.ctrl) != 1) in main()
476 libxenvchan_wait(state.ctrl); in main()
506 state.ctrl = connect_vchan(domid, vchan_path); in main()
507 if (!state.ctrl) { in main()
518 libxenvchan_close(state.ctrl); in main()
519 state.ctrl = NULL; in main()
527 if (state.ctrl) in main()
528 libxenvchan_close(state.ctrl); in main()