Skip to contentSkip to conversation

hax: Windows doesn't like posix device names

PATCH Applied Volker Rümelin 3 participants 6 messages Mar 22, 2020 – Apr 13, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hax: Windows doesn't like posix device names

Patch acb9f95a7c "i386: Fix GCC warning with snprintf when HAX is enabled" replaced Windows device names with posix device names. Revert this.

Fixes acb9f95a7c "i386: Fix GCC warning with snprintf when HAX is enabled"
---
 target/i386/hax-windows.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/i386/hax-windows.c +2 -2
index 0ba488c468..863c2bcc19 100644
@@ -185,12 +185,12 @@ int hax_mod_version(struct hax_state *hax, struct hax_module_version *version)
 
 static char *hax_vm_devfs_string(int vm_id)
 {
-    return g_strdup_printf("/dev/hax_vm/vm%02d", vm_id);
+    return g_strdup_printf("\\\\.\\hax_vm%02d", vm_id);
 }
 
 static char *hax_vcpu_devfs_string(int vm_id, int vcpu_id)
 {
-    return g_strdup_printf("/dev/hax_vm%02d/vcpu%02d", vm_id, vcpu_id);
+    return g_strdup_printf("\\\\.\\hax_vm%02d_vcpu%02d", vm_id, vcpu_id);
 }
 
 int hax_host_create_vm(struct hax_state *hax, int *vmid)
Signature · 1 line
2.16.4
#1 lore raw
Quoted 21 lines · Volker Rümelin

Patch acb9f95a7c "i386: Fix GCC warning with snprintf when HAX is enabled" replaced Windows device names with posix device names. Revert this.

Fixes acb9f95a7c "i386: Fix GCC warning with snprintf when HAX is enabled"
---
 target/i386/hax-windows.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/i386/hax-windows.c +0 -1
index 0ba488c468..863c2bcc19 100644
@@ -185,12 +185,12 @@ int hax_mod_version(struct hax_state *hax, struct hax_module_version *version)
 
 static char *hax_vm_devfs_string(int vm_id)
 {
-    return g_strdup_printf("/dev/hax_vm/vm%02d", vm_id);

target/i386/hax-windows.c int hax_mod_version(struct hax_state *hax, struct hax_module_version *version) · line 196

Quoted 10 lines
target/i386/hax-windows.c +2 -1
+    return g_strdup_printf("\\\\.\\hax_vm%02d", vm_id);
 }
 
 static char *hax_vcpu_devfs_string(int vm_id, int vcpu_id)
 {
-    return g_strdup_printf("/dev/hax_vm%02d/vcpu%02d", vm_id, vcpu_id);
+    return g_strdup_printf("\\\\.\\hax_vm%02d_vcpu%02d", vm_id, vcpu_id);
 }
 
 int hax_host_create_vm(struct hax_state *hax, int *vmid)

Queued, thanks.

Paolo

#2 lore raw

Am 23.03.20 um 09:20 schrieb Paolo Bonzini:

Quoted 30 lines · Volker Rümelin
Quoted 29 lines

Patch acb9f95a7c "i386: Fix GCC warning with snprintf when HAX is enabled" replaced Windows device names with posix device names. Revert this.

Fixes acb9f95a7c "i386: Fix GCC warning with snprintf when HAX is enabled"
---
 target/i386/hax-windows.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/i386/hax-windows.c +2 -2
index 0ba488c468..863c2bcc19 100644
@@ -185,12 +185,12 @@ int hax_mod_version(struct hax_state *hax, struct hax_module_version *version)
 
 static char *hax_vm_devfs_string(int vm_id)
 {
-    return g_strdup_printf("/dev/hax_vm/vm%02d", vm_id);
+    return g_strdup_printf("\\\\.\\hax_vm%02d", vm_id);
 }
 
 static char *hax_vcpu_devfs_string(int vm_id, int vcpu_id)
 {
-    return g_strdup_printf("/dev/hax_vm%02d/vcpu%02d", vm_id, vcpu_id);
+    return g_strdup_printf("\\\\.\\hax_vm%02d_vcpu%02d", vm_id, vcpu_id);
 }
 
Quoted 5 lines

target/i386/hax-windows.c int hax_mod_version(struct hax_state *hax, struct hax_module_version *version) · line 196

Quoted 2 lines
target/i386/hax-windows.c +0 -0
 int hax_host_create_vm(struct hax_state *hax, int *vmid)

Queued, thanks.

Paolo

I am rather sure that macOS does not like Windows device names, so just reverting might be the wrong solution if HAX should work on Windows and on macOS.

Is this relevant? Or should we drop HAX support for Windows? Personally I have no experience with hardware acceleration for QEMU on macOS.

Stefan

#3 lore raw
Quoted 22 lines · Stefan Weil
Quoted 22 lines
Quoted 10 lines
target/i386/hax-windows.c +0 -1
index 0ba488c468..863c2bcc19 100644
@@ -185,12 +185,12 @@ int hax_mod_version(struct hax_state *hax, struct hax_module_version *version)
 
 static char *hax_vm_devfs_string(int vm_id)
 {
-    return g_strdup_printf("/dev/hax_vm/vm%02d", vm_id);

target/i386/hax-windows.c int hax_mod_version(struct hax_state *hax, struct hax_module_version *version) · line 196

Quoted 10 lines
target/i386/hax-windows.c +2 -1
+    return g_strdup_printf("\\\\.\\hax_vm%02d", vm_id);
 }
 
 static char *hax_vcpu_devfs_string(int vm_id, int vcpu_id)
 {
-    return g_strdup_printf("/dev/hax_vm%02d/vcpu%02d", vm_id, vcpu_id);
+    return g_strdup_printf("\\\\.\\hax_vm%02d_vcpu%02d", vm_id, vcpu_id);
 }
 
 int hax_host_create_vm(struct hax_state *hax, int *vmid)

Queued, thanks.

Quoted 5 lines
Quoted 1 line

Paolo

I am rather sure that macOS does not like Windows device names, so just reverting might be the wrong solution if HAX should work on Windows and on macOS.

This is hax-windows.c, macOS uses hax-posix.c. These days Hypervisor.framework is probably a better choice than HAX on macOS, but IIUC hax-posix.c also supports NetBSD so we're keeping it.

Paolo

Quoted 2 lines

Is this relevant? Or should we drop HAX support for Windows? Personally I have no experience with hardware acceleration for QEMU on macOS.

#4 lore raw
In reply to Stefan Weil
Quoted 3 lines

Is this relevant? Or should we drop HAX support for Windows? Personally I have no experience with hardware acceleration for QEMU on macOS.

There's another reason to keep hax for Windows. You can't enable the Hyper-V role on Windows 10 Home. Without hax and whpx there's no usable hypervisor left.

With best regards,
Volker

Quoted 4 lines

Stefan

#5 lore raw
In reply to Paolo Bonzini
Quoted 11 lines · Volker Rümelin
Quoted 10 lines

Patch acb9f95a7c "i386: Fix GCC warning with snprintf when HAX is enabled" replaced Windows device names with posix device names. Revert this.

Fixes acb9f95a7c "i386: Fix GCC warning with snprintf when HAX is enabled"

Queued, thanks.

Paolo

Hi Paolo,

I would like to remind you that without this patch qemu 5.0 on Windows will not work with HAX. There is already a bug report at

https://bugs.launchpad.net/bugs/1871250

With best regards,
Volker