All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: chunhui zhao <zch.open@gmail.com>
Cc: kvm <kvm@vger.kernel.org>
Subject: Re: does qmp supports usb_add?
Date: Fri, 16 Apr 2010 14:28:01 +0100	[thread overview]
Message-ID: <20100416132801.GN5048@redhat.com> (raw)
In-Reply-To: <n2lacf4d72a1004160618jabe03ce9zc28b680ac71aad25@mail.gmail.com>

On Fri, Apr 16, 2010 at 09:18:12PM +0800, chunhui zhao wrote:
> Hi guys.
> 
>     As the kvm does not support auto connection of USB device, unless
> someone inputs the command "usb_add" in the monitor.  I wonder if
> there is a better way, say, like some linux, auto mount the USB device
> without any command input. And I know there is also qmp(qemu monitor
> protocol) to use to communicate with the monitor. So I wanna write a
> program which will capture the hotplug signal and communicate with the
> monitor to auto mount the USB device.
> 
> The problem is, the qmp does not support the command "usb_add".
> (http://www.linux-kvm.org/page/MonitorProtocol)
> Is there any method to solve this?

usb_add/del & pci_add/del are all deprecated and not going to be ported
to QMP. Instead use the device_add command eg in plain monitor format:

  device_add usb-host,hostbus=BUS,hostaddr=ADDR,vendorid=VID,productid=PRID

Or QMP format

    { "execute": "device_add", "arguments": { "driver": "usb-host",
                                              "hostbus": "BUS",
                                              "hostaddr": "ADDR",
                                              "vendorid": "VID",
                                              "productid": "PRID" }}

This accepts identical param names as the -device command line arg which is
documented in docs/qdev-device-use.txt 

Regards,
Daniel
-- 
|: Red Hat, Engineering, London    -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org        -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

  reply	other threads:[~2010-04-16 13:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-16 13:18 does qmp supports usb_add? chunhui zhao
2010-04-16 13:28 ` Daniel P. Berrange [this message]
2010-04-19 12:55   ` chunhui zhao
2010-04-19 13:00     ` Daniel P. Berrange
2010-04-16 13:31 ` Gerd Hoffmann

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=20100416132801.GN5048@redhat.com \
    --to=berrange@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=zch.open@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.