Merge branch 'features/smp' into tizen_next
[sdk/emulator/qemu.git] / target-i386 / hax-windows.c
index d6f402a..eee7684 100644 (file)
@@ -121,8 +121,7 @@ int hax_set_phys_mem(MemoryRegionSection *section)
 
     info.pa_start = start_addr;
     info.size = size;
-    info.va = (uint64_t)(intptr_t)(memory_region_get_ram_ptr(mr) +
-            section->offset_within_region);
+    info.va = (uint64_t)(intptr_t)(memory_region_get_ram_ptr(mr) + section->offset_within_region);
     info.flags = memory_region_is_rom(mr) ? 1 : 0;
 
     hDeviceVM = hax_global.vm->fd;
@@ -286,6 +285,26 @@ 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;