From 8a539eaab40dc7a8047dbf97c081467029e6c518 Mon Sep 17 00:00:00 2001 From: "Jiang, Yunhong" Date: Fri, 23 Mar 2012 13:47:38 +0800 Subject: Add a HAXM interface for QEMU API version Add a HAXM interface so that QEMU can communicate its API version to HAXM. With this, HAXM can keep better backward compatibility, for example, masking of the new features if qemu does not support new features. Change-Id: I24c7c8d353653978f507739f6e53a9d389d06e43 Signed-off-by: Jiang, Yunhong --- target-i386/hax-windows.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'target-i386/hax-windows.c') diff --git a/target-i386/hax-windows.c b/target-i386/hax-windows.c index 0035d21..6c52388 100644 --- a/target-i386/hax-windows.c +++ b/target-i386/hax-windows.c @@ -279,6 +279,29 @@ hax_fd hax_host_open_vm(struct hax_state *hax, int vm_id) return hDeviceVM; } +int hax_notify_qemu_version(hax_fd vm_fd, struct hax_qemu_version *qversion) +{ + int ret; + DWORD dSize = 0; + + if (hax_invalid_fd(vm_fd)) + return -EINVAL; + + ret = DeviceIoControl(vm_fd, + HAX_VM_IOCTL_NOTIFY_QEMU_VERSION, + qversion, sizeof(struct hax_qemu_version), + NULL, 0, + &dSize, + (LPOVERLAPPED) NULL); + if (!ret) + { + dprint("Failed to notify qemu API version\n"); + return -1; + } + + return 0; +} + int hax_host_create_vcpu(hax_fd vm_fd, int vcpuid) { int ret; -- cgit v1.1