From 4542d3775d3886c4bc5460dc24c8398f32602e67 Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Tue, 3 Apr 2018 16:40:23 +0800 Subject: [PATCH] hypercall: Fix compile error caused by missing memcpy function Assignment of structures are implemented using memcpy which is not available in the hypervisor. This patch convert such assignment to an explicit memcpy_s() call. Signed-off-by: Junjie Mao Acked-by: Eddie Dong --- hypervisor/common/hypercall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hypervisor/common/hypercall.c b/hypervisor/common/hypercall.c index 6aa02b676..91c217da9 100644 --- a/hypervisor/common/hypercall.c +++ b/hypervisor/common/hypercall.c @@ -727,7 +727,8 @@ int acrn_insert_request_wait(struct vcpu *vcpu, struct vhm_request *req) /* ACRN insert request to VHM and inject upcall */ cur = vcpu->vcpu_id; - req_buf->req_queue[cur] = *req; + memcpy_s(&req_buf->req_queue[cur], sizeof(struct vhm_request), + req, sizeof(struct vhm_request)); /* Must clear the signal before we mark req valid * Once we mark to valid, VHM may process req and signal us