diff options
author | Roman Kagan <rkagan@virtuozzo.com> | 2017-07-13 23:15:21 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-09-19 16:20:49 +0200 |
commit | 5e95381260e668a3a02aff5485401788b41b3050 (patch) | |
tree | d5c0aa8d42c9d6996a01b55db95352f6f1688c7e /target/i386/hyperv.c | |
parent | 6c69dfb67e84747cf071958594d939e845dfcc0c (diff) |
hyperv: add header with protocol definitions
The definitions for Hyper-V emulation are currently taken from a header
imported from the Linux kernel.
However, as these describe a third-party protocol rather than a kernel
API, it probably wasn't a good idea to publish it in the kernel uapi.
This patch introduces a header that provides all the necessary
definitions, superseding the one coming from the kernel.
The new header supports (temporary) coexistence with the kernel one.
The constants explicitly named in the Hyper-V specification (e.g. msr
numbers) are defined in a non-conflicting way. Other constants and
types have got new names.
While at this, the protocol data structures are defined in a more
conventional way, without bitfields, enums, and excessive unions.
The code using this stuff is adjusted, too; it can now be built both
with and without the kernel header in the tree.
Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Message-Id: <20170713201522.13765-2-rkagan@virtuozzo.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target/i386/hyperv.c')
-rw-r--r-- | target/i386/hyperv.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index 8545574568..a050c9d2d1 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -14,7 +14,7 @@ #include "qemu/osdep.h" #include "qemu/main-loop.h" #include "hyperv.h" -#include "standard-headers/asm-x86/hyperv.h" +#include "hyperv-proto.h" int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit) { @@ -50,8 +50,8 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit) code = exit->u.hcall.input & 0xffff; switch (code) { - case HVCALL_POST_MESSAGE: - case HVCALL_SIGNAL_EVENT: + case HV_POST_MESSAGE: + case HV_SIGNAL_EVENT: default: exit->u.hcall.result = HV_STATUS_INVALID_HYPERCALL_CODE; return 0; |