[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/16] WHPX fix WHvGetCapability out WrittenSizeInByt
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 02/16] WHPX fix WHvGetCapability out WrittenSizeInBytes |
Date: |
Mon, 26 Mar 2018 15:36:29 +0200 |
From: "Justin Terry (VM)" <address@hidden>
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) <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
configure | 4 +++-
target/i386/whpx-all.c | 3 ++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 8376cb1..4d0e92c 100755
--- a/configure
+++ b/configure
@@ -2496,7 +2496,9 @@ if test "$whpx" != "no" ; then
#include <WinHvEmulation.h>
int main(void) {
WHV_CAPABILITY whpx_cap;
- WHvGetCapability(WHvCapabilityCodeFeatures, &whpx_cap, sizeof(whpx_cap));
+ UINT32 writtenSize;
+ WHvGetCapability(WHvCapabilityCodeFeatures, &whpx_cap, sizeof(whpx_cap),
+ &writtenSize);
return 0;
}
EOF
diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c
index 940bbe5..2080d58 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;
--
1.8.3.1
- [Qemu-devel] [PULL 00/16] Misc fixes for QEMU 2.12.0-rc1, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 02/16] WHPX fix WHvGetCapability out WrittenSizeInBytes,
Paolo Bonzini <=
- [Qemu-devel] [PULL 03/16] WHPX fix WHvSetPartitionProperty in PropertyCode, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 04/16] WHPX improve vcpu_post_run perf, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 05/16] hw/net/can: Fix segfaults when using the devices without bus, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 01/16] scripts/get_maintainer.pl: Print proper error message for missing $file, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 07/16] hw/audio: Fix crashes when devices are used on ISA bus without DMA, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 06/16] fdc: Exit if ISA controller does not support DMA, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 08/16] scripts/device-crash-test: Remove fixed isapc-with-iommu entry, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 09/16] vhost-user-test: do not hang if chardev creation failed, Paolo Bonzini, 2018/03/26