aboutsummaryrefslogtreecommitdiff
path: root/target/i386
diff options
context:
space:
mode:
authorJustin Terry (VM) <juterry@microsoft.com>2018-03-14 07:52:41 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2018-03-26 14:37:12 +0200
commit3907e6318eae2668712bba04edc10e3648292508 (patch)
treed792ec045612ae8e596919d92371e8d1fefe17c1 /target/i386
parent36b4cf19348c98fa070dbb99e4bb2eb190ff4cef (diff)
WHPX fix WHvGetCapability out WrittenSizeInBytes
This fixes a breaking change to WHvGetCapability to include the 'out' WrittenSizeInBytes introduced in Windows Insider SDK 17110. This specifies on return the safe length to read into the WHV_CAPABILITY structure passed to the call. Signed-off-by: Justin Terry (VM) <juterry@microsoft.com> Message-Id: <1521039163-138-2-git-send-email-juterry@microsoft.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target/i386')
-rw-r--r--target/i386/whpx-all.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c
index 940bbe590d..2080d58c4c 100644
--- a/target/i386/whpx-all.c
+++ b/target/i386/whpx-all.c
@@ -1254,6 +1254,7 @@ static int whpx_accel_init(MachineState *ms)
int ret;
HRESULT hr;
WHV_CAPABILITY whpx_cap;
+ UINT32 whpx_cap_size;
WHV_PARTITION_PROPERTY prop;
whpx = &whpx_global;
@@ -1262,7 +1263,7 @@ static int whpx_accel_init(MachineState *ms)
whpx->mem_quota = ms->ram_size;
hr = WHvGetCapability(WHvCapabilityCodeHypervisorPresent, &whpx_cap,
- sizeof(whpx_cap));
+ sizeof(whpx_cap), &whpx_cap_size);
if (FAILED(hr) || !whpx_cap.HypervisorPresent) {
error_report("WHPX: No accelerator found, hr=%08lx", hr);
ret = -ENOSPC;