qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PULL 1/1] mtp: linux guest detection fix.
Date: Fri, 11 Jul 2014 12:42:30 +0200	[thread overview]
Message-ID: <1405075350-20697-2-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1405075350-20697-1-git-send-email-kraxel@redhat.com>

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 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 380b465..1b51a90 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -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,
-- 
1.8.3.1

  reply	other threads:[~2014-07-11 10:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-11 10:42 [Qemu-devel] [PULL 0/1] mtp: linux guest detection fix Gerd Hoffmann
2014-07-11 10:42 ` Gerd Hoffmann [this message]
2014-07-11 11:33   ` [Qemu-devel] [PULL 1/1] " Markus Armbruster
2014-07-11 11:50     ` Gerd Hoffmann
2014-07-11 16:01 ` [Qemu-devel] [PULL 0/1] " Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1405075350-20697-2-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).