Actually, the following (old) patch by Yuval Kashtan was sent to
qemu-devel back in October (but not merged AFAIK) to facilitate usb_del
using the same string used during usb_add.

"
Hello,

This proposed patch add support for deleting usb devices by providing
the (exact) same string they were added with, thus enabling to remove a
usb device with the host string.
The old capability of deleting usb device by their internal port is not
harmed. 

I had to move USBHostDevice to vl.h so that I will be able to reference
it from vl.c

and last, I've changed the output of info usb so that it will include
the saved string (for reference).

Please comment. 

BR, 
Yuval Kashtan.
"

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Daniel P.
Berrange
Sent: Tuesday, March 04, 2008 9:54 PM
To: Anthony Liguori
Cc: kvm-devel@lists.sourceforge.net; Marcelo Tosatti; Avi Kivity;
Glauber Costa
Subject: Re: [kvm-devel] [patch 14/23] QEMU/KVM: device hot-add

On Tue, Mar 04, 2008 at 01:30:42PM -0600, Anthony Liguori wrote:
> Daniel P. Berrange wrote:
> >On Tue, Mar 04, 2008 at 03:34:33PM -0300, Marcelo Tosatti wrote:
> >>Add monitor command to hot-add PCI devices (nic and drive).
> >[snip]
> >
> >  
> >>Index: kvm-userspace.hotplug/qemu/monitor.c
> >>===================================================================
> >>--- kvm-userspace.hotplug.orig/qemu/monitor.c
> >>+++ kvm-userspace.hotplug/qemu/monitor.c
> >>@@ -1354,6 +1354,7 @@ static term_cmd_t term_cmds[] = {
> >>     { "migrate_set_speed", "s", do_migrate_set_speed,
> >>       "value", "set maximum speed (in bytes) for migrations" },
> >>     { "cpu_set", "is", do_cpu_set_nr, "cpu [online|offline]",
"change 
> >>     cpu state" },
> >>+    { "pci_add", "ss", device_hot_add, "nic|drive 
> >>[vlan=n][,macaddr=addr][,model=type] 
> >>[[file=file][,if=type][,bus=n][,unit=m][,media=d][index=i]]",
"hotadd PCI 
> >>device" },
> >>    
> >
> >This syntax is not very nice IMHO. We should have explicit commands
> >for the different types of device,
> >
> >ie
> >
> >   nic_add [vlan=n][,macaddr=addr][,model=type]
> >   drive_add
[[file=file][,if=type][,bus=n][,unit=m][,media=d][index=i]]
> >
> >ie, follow naming of the command line args   -nic, and -drive.
> >
> >This also keeps 'pci_add' as a command name available for future use
to
> >do generic host->guest  pci device pass-through.
> >  
> 
> There is symmetry with pci_add and usb_add since usb_add takes either
a 
> USB device identifier or the name of an emulated device along with 
> parameters.  So I prefer the pci_add syntax just to maintain
consistency 
> with the rest of QEMU.

This is true, but the usb_add/remove syntax is horrible to work with.
One
of the reasons I've not added  USB hotplug/remove to libvirt yet is the
difficulty (perhaps even impossibility) of reliably finding out the USB
device number associated with the device that was added. I guess ideally
the add command would have to print out / return the number associated
with the device, which libvirt could record for use when it later comes
time to remove the device.

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392
2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/
-=|
|=-               Projects: http://freshmeat.net/~danielpb/
-=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505
-=| 

------------------------------------------------------------------------
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Attachment: usb_del.patch
Description: usb_del.patch

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to