Files
vfio-native/patches/qemu/05-usb-identity.patch
T

162 lines
6.2 KiB
Diff

Subject: [PATCH] usb: QEMU_USB
Targets VMAware check: QEMU_USB
USB device identity strings that name QEMU: the HID descriptors (dev-hid.c)
and the usb-net CDC/RNDIS descriptors plus its RNDIS vendor-description and
product_desc (dev-network.c). The usb-net VID/PID (0525:a4a1, a real Linux
USB Ethernet Gadget id) is left intact so the device stays CDC-class and the
guest's generic CDC-ECM driver (e.g. macOS AppleUSBEthernet) still binds it.
Applies to QEMU v11.1.2. Apply from the source root with:
patch -p1 < 05-usb-identity.patch
---
diff --git a/hw/usb/dev-hid.c b/hw/usb/dev-hid.c
index ae19d60..9fe1223 100644
--- a/hw/usb/dev-hid.c
+++ b/hw/usb/dev-hid.c
@@ -63,17 +63,17 @@ enum {
};
static const USBDescStrings desc_strings = {
- [STR_MANUFACTURER] = "QEMU",
- [STR_PRODUCT_MOUSE] = "QEMU USB Mouse",
- [STR_PRODUCT_TABLET] = "QEMU USB Tablet",
- [STR_PRODUCT_KEYBOARD] = "QEMU USB Keyboard",
- [STR_SERIAL_COMPAT] = "42",
+ [STR_MANUFACTURER] = "Logitech",
+ [STR_PRODUCT_MOUSE] = "USB Mouse",
+ [STR_PRODUCT_TABLET] = "USB Tablet",
+ [STR_PRODUCT_KEYBOARD] = "USB Keyboard",
+ [STR_SERIAL_COMPAT] = "",
[STR_CONFIG_MOUSE] = "HID Mouse",
[STR_CONFIG_TABLET] = "HID Tablet",
[STR_CONFIG_KEYBOARD] = "HID Keyboard",
- [STR_SERIAL_MOUSE] = "89126",
- [STR_SERIAL_TABLET] = "28754",
- [STR_SERIAL_KEYBOARD] = "68284",
+ [STR_SERIAL_MOUSE] = "",
+ [STR_SERIAL_TABLET] = "",
+ [STR_SERIAL_KEYBOARD] = "",
};
static const USBDescIface desc_iface_mouse = {
@@ -368,8 +368,8 @@ static const USBDescMSOS desc_msos_suspend = {
static const USBDesc desc_mouse = {
.id = {
- .idVendor = 0x0627,
- .idProduct = 0x0001,
+ .idVendor = 0x046D,
+ .idProduct = 0xC077,
.bcdDevice = 0,
.iManufacturer = STR_MANUFACTURER,
.iProduct = STR_PRODUCT_MOUSE,
@@ -382,8 +382,8 @@ static const USBDesc desc_mouse = {
static const USBDesc desc_mouse2 = {
.id = {
- .idVendor = 0x0627,
- .idProduct = 0x0001,
+ .idVendor = 0x046D,
+ .idProduct = 0xC077,
.bcdDevice = 0,
.iManufacturer = STR_MANUFACTURER,
.iProduct = STR_PRODUCT_MOUSE,
@@ -426,8 +426,8 @@ static const USBDesc desc_tablet2 = {
static const USBDesc desc_keyboard = {
.id = {
- .idVendor = 0x0627,
- .idProduct = 0x0001,
+ .idVendor = 0x046D,
+ .idProduct = 0xC31C,
.bcdDevice = 0,
.iManufacturer = STR_MANUFACTURER,
.iProduct = STR_PRODUCT_KEYBOARD,
@@ -440,8 +440,8 @@ static const USBDesc desc_keyboard = {
static const USBDesc desc_keyboard2 = {
.id = {
- .idVendor = 0x0627,
- .idProduct = 0x0001,
+ .idVendor = 0x046D,
+ .idProduct = 0xC31C,
.bcdDevice = 0,
.iManufacturer = STR_MANUFACTURER,
.iProduct = STR_PRODUCT_KEYBOARD,
@@ -805,7 +805,7 @@ static void usb_tablet_class_initfn(ObjectClass *klass, const void *data)
USBDeviceClass *uc = USB_DEVICE_CLASS(klass);
uc->realize = usb_tablet_realize;
- uc->product_desc = "QEMU USB Tablet";
+ uc->product_desc = "USB Tablet";
dc->vmsd = &vmstate_usb_ptr;
device_class_set_props(dc, usb_tablet_properties);
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
@@ -827,7 +827,7 @@ static void usb_mouse_class_initfn(ObjectClass *klass, const void *data)
USBDeviceClass *uc = USB_DEVICE_CLASS(klass);
uc->realize = usb_mouse_realize;
- uc->product_desc = "QEMU USB Mouse";
+ uc->product_desc = "USB Mouse";
dc->vmsd = &vmstate_usb_ptr;
device_class_set_props(dc, usb_mouse_properties);
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
@@ -850,7 +850,7 @@ static void usb_keyboard_class_initfn(ObjectClass *klass, const void *data)
USBDeviceClass *uc = USB_DEVICE_CLASS(klass);
uc->realize = usb_keyboard_realize;
- uc->product_desc = "QEMU USB Keyboard";
+ uc->product_desc = "USB Keyboard";
dc->vmsd = &vmstate_usb_kbd;
device_class_set_props(dc, usb_keyboard_properties);
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c
--- a/hw/usb/dev-network.c
+++ b/hw/usb/dev-network.c
@@ -99,15 +99,15 @@
#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
static const USBDescStrings usb_net_stringtable = {
- [STRING_MANUFACTURER] = "QEMU",
- [STRING_PRODUCT] = "RNDIS/QEMU USB Network Device",
+ [STRING_MANUFACTURER] = "Linux",
+ [STRING_PRODUCT] = "USB Ethernet",
[STRING_ETHADDR] = "400102030405",
- [STRING_DATA] = "QEMU USB Net Data Interface",
- [STRING_CONTROL] = "QEMU USB Net Control Interface",
- [STRING_RNDIS_CONTROL] = "QEMU USB Net RNDIS Control Interface",
- [STRING_CDC] = "QEMU USB Net CDC",
- [STRING_SUBSET] = "QEMU USB Net Subset",
- [STRING_RNDIS] = "QEMU USB Net RNDIS",
+ [STRING_DATA] = "CDC Ethernet Data",
+ [STRING_CONTROL] = "CDC Ethernet Control",
+ [STRING_RNDIS_CONTROL] = "RNDIS Communications Control",
+ [STRING_CDC] = "CDC Ethernet",
+ [STRING_SUBSET] = "CDC Subset Ethernet",
+ [STRING_RNDIS] = "RNDIS Ethernet",
[STRING_SERIALNUMBER] = "1",
};
@@ -717,7 +717,7 @@
/* mandatory */
case OID_GEN_VENDOR_DESCRIPTION:
- pstrcpy((char *)outbuf, outlen, "QEMU USB RNDIS Net");
+ pstrcpy((char *)outbuf, outlen, "USB Ethernet");
return strlen((char *)outbuf) + 1;
case OID_GEN_VENDOR_DRIVER_VERSION:
@@ -1417,7 +1417,7 @@
USBDeviceClass *uc = USB_DEVICE_CLASS(klass);
uc->realize = usb_net_realize;
- uc->product_desc = "QEMU USB Network Interface";
+ uc->product_desc = "USB Ethernet Adapter";
uc->usb_desc = &desc_net;
uc->handle_reset = usb_net_handle_reset;
uc->handle_control = usb_net_handle_control;