All of lore.kernel.org
 help / color / mirror / Atom feed
* does qmp supports usb_add?
@ 2010-04-16 13:18 chunhui zhao
  2010-04-16 13:28 ` Daniel P. Berrange
  2010-04-16 13:31 ` Gerd Hoffmann
  0 siblings, 2 replies; 5+ messages in thread
From: chunhui zhao @ 2010-04-16 13:18 UTC (permalink / raw)
  To: kvm

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?

good luck!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: does qmp supports usb_add?
  2010-04-16 13:18 does qmp supports usb_add? chunhui zhao
@ 2010-04-16 13:28 ` Daniel P. Berrange
  2010-04-19 12:55   ` chunhui zhao
  2010-04-16 13:31 ` Gerd Hoffmann
  1 sibling, 1 reply; 5+ messages in thread
From: Daniel P. Berrange @ 2010-04-16 13:28 UTC (permalink / raw)
  To: chunhui zhao; +Cc: kvm

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 :|

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: does qmp supports usb_add?
  2010-04-16 13:18 does qmp supports usb_add? chunhui zhao
  2010-04-16 13:28 ` Daniel P. Berrange
@ 2010-04-16 13:31 ` Gerd Hoffmann
  1 sibling, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2010-04-16 13:31 UTC (permalink / raw)
  To: chunhui zhao; +Cc: kvm

On 04/16/10 15:18, chunhui zhao wrote:
> Hi guys.
>
>      As the kvm does not support auto connection of USB device,

It does.  -device usb-host,vendorid=1234,productid=5678

Plug in the device specified by vendor+product id on the host and your 
guest will see it.

> 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?

Use the more generic device_add instead.

cheers,
   Gerd

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: does qmp supports usb_add?
  2010-04-16 13:28 ` Daniel P. Berrange
@ 2010-04-19 12:55   ` chunhui zhao
  2010-04-19 13:00     ` Daniel P. Berrange
  0 siblings, 1 reply; 5+ messages in thread
From: chunhui zhao @ 2010-04-19 12:55 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: kvm

Thanks Dan.
However,  as I checked this command "device_add", I did not found QMP
support it.
I use the command:
{"QMP": {"query-command"}}
In the return list, I did not found the "device_add". The list is as below:
-------------------------------------------------------------
{"return": [{"name": "quit"}, {"name": "eject"}, {"name": "change"},
{"name": "stop"}, {"name": "cont"}, {"name": "system_reset"}, {"name":
"system_powerdown"}, {"name": "memsave"}, {"name": "pmemsave"},
{"name": "migrate"}, {"name": "migrate_cancel"}, {"name": "pci_add"},
{"name": "pci_del"}, {"name": "balloon"}, {"name": "getfd"}, {"name":
"closefd"}, {"name": "block_passwd"}, {"name": "query-version"},
{"name": "query-commands"}, {"name": "query-chardev"}, {"name":
"query-block"}, {"name": "query-blockstats"}, {"name": "query-cpus"},
{"name": "query-hpet"}, {"name": "query-kvm"}, {"name":
"query-status"}, {"name": "query-mice"}, {"name": "query-vnc"},
{"name": "query-name"}, {"name": "query-uuid"}, {"name":
"query-migrate"}, {"name": "query-balloon"}]}
-------------------------------------------------------------

And on the page : http://www.linux-kvm.org/page/MonitorProtocol.  I
notice that :
-------------------------------------------------------------
TODO
High Priority
do_device_add()/do_device_del() conversions (markus)
do_netdev_add()/do_netdev_del() conversions (markus)
do_blockdev_add()/do_blockdev_del() conversions (markus)
Events Grouping (luiz)
Make qmp-shell work again (luiz)
Self-description & High-level protocol documentation
High-level internal documentation
Better QObjects and QMP debug support
-------------------------------------------------------------

Cause the do_device_add is in the to_do list, does this mean it is not
finished yet?

BTW: my qemu version is 0.12.3 which I believe is the latest version.
My linux kernel is 2.6.33

Good Luck!

On Fri, Apr 16, 2010 at 9:28 PM, Daniel P. Berrange <berrange@redhat.com> wrote:
> 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 :|
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: does qmp supports usb_add?
  2010-04-19 12:55   ` chunhui zhao
@ 2010-04-19 13:00     ` Daniel P. Berrange
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel P. Berrange @ 2010-04-19 13:00 UTC (permalink / raw)
  To: chunhui zhao; +Cc: kvm

On Mon, Apr 19, 2010 at 08:55:37PM +0800, chunhui zhao wrote:
> Thanks Dan.
> However,  as I checked this command "device_add", I did not found QMP
> support it.
> I use the command:
> {"QMP": {"query-command"}}
> In the return list, I did not found the "device_add". The list is as below:
> -------------------------------------------------------------
> {"return": [{"name": "quit"}, {"name": "eject"}, {"name": "change"},
> {"name": "stop"}, {"name": "cont"}, {"name": "system_reset"}, {"name":
> "system_powerdown"}, {"name": "memsave"}, {"name": "pmemsave"},
> {"name": "migrate"}, {"name": "migrate_cancel"}, {"name": "pci_add"},
> {"name": "pci_del"}, {"name": "balloon"}, {"name": "getfd"}, {"name":
> "closefd"}, {"name": "block_passwd"}, {"name": "query-version"},
> {"name": "query-commands"}, {"name": "query-chardev"}, {"name":
> "query-block"}, {"name": "query-blockstats"}, {"name": "query-cpus"},
> {"name": "query-hpet"}, {"name": "query-kvm"}, {"name":
> "query-status"}, {"name": "query-mice"}, {"name": "query-vnc"},
> {"name": "query-name"}, {"name": "query-uuid"}, {"name":
> "query-migrate"}, {"name": "query-balloon"}]}
> -------------------------------------------------------------
> 
> And on the page : http://www.linux-kvm.org/page/MonitorProtocol.  I
> notice that :
> -------------------------------------------------------------
> TODO
> High Priority
> do_device_add()/do_device_del() conversions (markus)
> do_netdev_add()/do_netdev_del() conversions (markus)
> do_blockdev_add()/do_blockdev_del() conversions (markus)
> Events Grouping (luiz)
> Make qmp-shell work again (luiz)
> Self-description & High-level protocol documentation
> High-level internal documentation
> Better QObjects and QMP debug support
> -------------------------------------------------------------
> 
> Cause the do_device_add is in the to_do list, does this mean it is not
> finished yet?
> 
> BTW: my qemu version is 0.12.3 which I believe is the latest version.

It is not practical to use QMP with any 0.12.x version of QEMU. The
0.13.x release series will be the first where it is complete enough
to use. Current GIT code is getting reasonably complete - waiting for
netdev_add/del to be merged, and then blockdev_add/del will complete
the functionality for device hotplug use cases.

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 :|

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-04-19 13:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-16 13:18 does qmp supports usb_add? chunhui zhao
2010-04-16 13:28 ` Daniel P. Berrange
2010-04-19 12:55   ` chunhui zhao
2010-04-19 13:00     ` Daniel P. Berrange
2010-04-16 13:31 ` Gerd Hoffmann

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.