Home | History | Annotate | Download | only in protocol

Lines Matching full:corecmd

85 _alloc_cmd_param_buf(CoreCmdImpl* corecmd, uint32_t size)
87 if (size < sizeof(corecmd->cmd_param)) {
89 corecmd->cmd_param_buf = &corecmd->cmd_param[0];
92 corecmd->cmd_param_buf = qemu_malloc(size);
94 return corecmd->cmd_param_buf;
100 _free_cmd_param_buf(CoreCmdImpl* corecmd)
102 if (corecmd->cmd_param_buf != &corecmd->cmd_param[0]) {
103 qemu_free(corecmd->cmd_param_buf);
104 corecmd->cmd_param_buf = &corecmd->cmd_param[0];
123 * corecmd - CoreCmdImpl instance to use to send the response.
130 _coreCmdImpl_respond(CoreCmdImpl* corecmd, UICmdRespHeader* resp, void* resp_data)
132 int status = syncsocket_start_write(corecmd->sync_writer);
135 status = syncsocket_write(corecmd->sync_writer, resp,
140 status = syncsocket_write(corecmd->sync_writer, resp_data,
145 syncsocket_stop_write(corecmd->sync_writer);
156 * corecmd - CoreCmdImpl instance that received the command.
161 _coreCmdImpl_handle_command(CoreCmdImpl* corecmd,
200 _coreCmdImpl_respond(corecmd, &resp, NULL);
241 _coreCmdImpl_respond(corecmd, &resp, resp_data);
285 _coreCmdImpl_respond(corecmd, &resp, resp_data);
304 _coreCmdImpl_respond(corecmd, &resp, filepath);
316 _coreCmdImpl_respond(corecmd, &resp, NULL);
336 CoreCmdImpl* corecmd;
345 corecmd = (CoreCmdImpl*)opaque;
348 status = asyncReader_read(&corecmd->async_reader);
351 switch (corecmd->cmd_state) {
354 if (corecmd->cmd_header.cmd_param_size != 0) {
355 corecmd->cmd_state = EXPECTS_PARAMETERS;
357 _alloc_cmd_param_buf(corecmd,
358 corecmd->cmd_header.cmd_param_size);
359 asyncReader_init(&corecmd->async_reader,
360 corecmd->cmd_param_buf,
361 corecmd->cmd_header.cmd_param_size,
362 &corecmd->io);
365 _coreCmdImpl_handle_command(corecmd, &corecmd->cmd_header,
368 corecmd->cmd_state = EXPECTS_HEADER;
369 asyncReader_init(&corecmd->async_reader,
370 &corecmd->cmd_header,
371 sizeof(corecmd->cmd_header),
372 &corecmd->io);
378 _coreCmdImpl_handle_command(corecmd, &corecmd->cmd_header,
379 corecmd->cmd_param_buf);
380 _free_cmd_param_buf(corecmd);
382 corecmd->cmd_state = EXPECTS_HEADER;
383 asyncReader_init(&corecmd->async_reader, &corecmd->cmd_header,
384 sizeof(corecmd->cmd_header), &corecmd->io);
390 loopIo_dontWantRead(&corecmd->io);