]> git.proxmox.com Git - mirror_qemu.git/commitdiff
mtp: linux guest detection fix.
authorGerd Hoffmann <kraxel@redhat.com>
Tue, 1 Jul 2014 15:49:25 +0000 (17:49 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 11 Jul 2014 10:31:41 +0000 (12:31 +0200)
Attach a name to the MTP interface (android phones have this too).

With this patch recent linux guests such as fedora 20 happily detect and
use the device.  It shows up in nautilus file manager automatically, and
simple-mtpfs can mount it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/dev-mtp.c

index 380b46562193e3047cf9d28f30db6906882600e7..1b51a90022ae762ab63503e8005a5e153cfd9d81 100644 (file)
@@ -145,6 +145,7 @@ enum {
     STR_MANUFACTURER = 1,
     STR_PRODUCT,
     STR_SERIALNUMBER,
+    STR_MTP,
     STR_CONFIG_FULL,
     STR_CONFIG_HIGH,
     STR_CONFIG_SUPER,
@@ -154,6 +155,7 @@ static const USBDescStrings desc_strings = {
     [STR_MANUFACTURER] = MTP_MANUFACTURER,
     [STR_PRODUCT]      = MTP_PRODUCT,
     [STR_SERIALNUMBER] = "34617",
+    [STR_MTP]          = "MTP",
     [STR_CONFIG_FULL]  = "Full speed config (usb 1.1)",
     [STR_CONFIG_HIGH]  = "High speed config (usb 2.0)",
     [STR_CONFIG_SUPER] = "Super speed config (usb 3.0)",
@@ -165,6 +167,7 @@ static const USBDescIface desc_iface_full = {
     .bInterfaceClass               = USB_CLASS_STILL_IMAGE,
     .bInterfaceSubClass            = 0x01,
     .bInterfaceProtocol            = 0x01,
+    .iInterface                    = STR_MTP,
     .eps = (USBDescEndpoint[]) {
         {
             .bEndpointAddress      = USB_DIR_IN | EP_DATA_IN,
@@ -206,6 +209,7 @@ static const USBDescIface desc_iface_high = {
     .bInterfaceClass               = USB_CLASS_STILL_IMAGE,
     .bInterfaceSubClass            = 0x01,
     .bInterfaceProtocol            = 0x01,
+    .iInterface                    = STR_MTP,
     .eps = (USBDescEndpoint[]) {
         {
             .bEndpointAddress      = USB_DIR_IN | EP_DATA_IN,