Skip to content

Commit

Permalink
hw/hyperv/syndbg: common compilation unit
Browse files Browse the repository at this point in the history
Signed-off-by: Pierrick Bouvier <[email protected]>
  • Loading branch information
pbo-linaro committed Mar 5, 2025
1 parent 9c4b46f commit 47dfd4a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hw/hyperv/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
specific_ss.add(when: 'CONFIG_HYPERV', if_true: files('hyperv.c'))
specific_ss.add(when: 'CONFIG_HYPERV_TESTDEV', if_true: files('hyperv_testdev.c'))
system_ss.add(when: 'CONFIG_VMBUS', if_true: files('vmbus.c'))
specific_ss.add(when: 'CONFIG_SYNDBG', if_true: files('syndbg.c'))
system_ss.add(when: 'CONFIG_SYNDBG', if_true: files('syndbg.c'))
specific_ss.add(when: 'CONFIG_HV_BALLOON', if_true: files('hv-balloon.c', 'hv-balloon-page_range_tree.c', 'hv-balloon-our_range_memslots.c'))
system_ss.add(when: 'CONFIG_HV_BALLOON', if_false: files('hv-balloon-stub.c'))
7 changes: 4 additions & 3 deletions hw/hyperv/syndbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "migration/vmstate.h"
#include "hw/qdev-properties.h"
#include "hw/loader.h"
#include "cpu.h"
#include "exec/target_page.h"
#include "hw/hyperv/hyperv.h"
#include "hw/hyperv/vmbus-bridge.h"
#include "hw/hyperv/hyperv-proto.h"
Expand Down Expand Up @@ -188,7 +188,8 @@ static uint16_t handle_recv_msg(HvSynDbg *syndbg, uint64_t outgpa,
uint64_t timeout, uint32_t *retrieved_count)
{
uint16_t ret;
uint8_t data_buf[TARGET_PAGE_SIZE - UDP_PKT_HEADER_SIZE];
const size_t buf_size = qemu_target_page_size() - UDP_PKT_HEADER_SIZE;
uint8_t *data_buf = g_alloca(buf_size);
hwaddr out_len;
void *out_data;
ssize_t recv_byte_count;
Expand All @@ -201,7 +202,7 @@ static uint16_t handle_recv_msg(HvSynDbg *syndbg, uint64_t outgpa,
recv_byte_count = 0;
} else {
recv_byte_count = recv(syndbg->socket, data_buf,
MIN(sizeof(data_buf), count), MSG_WAITALL);
MIN(buf_size, count), MSG_WAITALL);
if (recv_byte_count == -1) {
return HV_STATUS_INVALID_PARAMETER;
}
Expand Down

0 comments on commit 47dfd4a

Please sign in to comment.