-
-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy path1006-libxl-use-EHCI-for-providing-tablet-USB-device.patch
53 lines (49 loc) · 2.29 KB
/
1006-libxl-use-EHCI-for-providing-tablet-USB-device.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From 977cf5dc8d7f94c2a610f29bc61f0822509d4bd0 Mon Sep 17 00:00:00 2001
From: alcreator <[email protected]>
Date: Mon, 17 Sep 2018 23:01:36 +1000
Subject: [PATCH] libxl: use EHCI for providing tablet USB device
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Linux guest by default do not enable USB autosuspend for UHCI controller
emulated by QEMU, which increase idle CPU usage. To avoid guest
modification, resolve it by switching to EHCI controller, for which
Linux behave correctly.
Signed-off-by: alcreator <[email protected]>
Signed-off-by: Marek Marczykowski-Górecki <[email protected]>
---
tools/libs/light/libxl_dm.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index 2a09c8953423..7fd53df13ed0 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -1463,18 +1463,20 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
LOGD(ERROR, guest_domid, "Both usbdevice and usbdevice_list set");
return ERROR_INVAL;
}
- flexarray_append(dm_args, "-usb");
+ flexarray_append_pair(dm_args,
+ "-device", "usb-ehci,id=ehci");
if (b_info->u.hvm.usbdevice) {
- flexarray_vappend(dm_args,
- "-usbdevice", b_info->u.hvm.usbdevice, NULL);
+ flexarray_vappend(dm_args, "-device",
+ GCSPRINTF("usb-%s,bus=ehci.0",
+ b_info->u.hvm.usbdevice),
+ NULL);
} else if (b_info->u.hvm.usbdevice_list) {
char **p;
for (p = b_info->u.hvm.usbdevice_list;
*p;
p++) {
- flexarray_vappend(dm_args,
- "-usbdevice",
- *p, NULL);
+ flexarray_vappend(dm_args, "-device",
+ GCSPRINTF("usb-%s,bus=ehci.0", *p), NULL);
}
}
} else if (b_info->u.hvm.usbversion) {
--
2.44.0