MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / get_response

Function get_response

vmm/src/api/mod.rs:606–621  ·  view source on GitHub ↗
(
    action: &Action,
    api_evt: EventFd,
    api_sender: Sender<ApiRequest>,
    data: Action::RequestBody,
)

Source from the content-addressed store, hash-verified

604
605#[allow(clippy::needless_pass_by_value)]
606fn get_response<Action: ApiAction>(
607 action: &Action,
608 api_evt: EventFd,
609 api_sender: Sender<ApiRequest>,
610 data: Action::RequestBody,
611) -> ApiResult<ApiResponsePayload> {
612 let (response_sender, response_receiver) = channel();
613
614 let request = action.request(data, response_sender);
615
616 // Send the VM request.
617 api_sender.send(request).map_err(ApiError::RequestSend)?;
618 api_evt.write(1).map_err(ApiError::EventFdWrite)?;
619
620 response_receiver.recv().map_err(ApiError::ResponseRecv)?
621}
622
623fn get_response_body<Action: ApiAction<ResponseBody = Option<Body>>>(
624 action: &Action,

Callers 2

get_response_bodyFunction · 0.85
sendMethod · 0.85

Calls 4

requestMethod · 0.80
sendMethod · 0.45
writeMethod · 0.45
recvMethod · 0.45

Tested by

no test coverage detected