[libvirt] [PATCH 4/6] qemu: Implement startupPolicy for USB passed through devices

Daniel P. Berrange berrange at redhat.com
Wed Oct 10 15:39:06 UTC 2012


On Tue, Oct 09, 2012 at 02:13:25PM +0200, Jiri Denemark wrote:
> ---
>  src/qemu/qemu_cgroup.c  |  2 ++
>  src/qemu/qemu_command.c | 20 +++++++++++++++-----
>  src/qemu/qemu_hostdev.c | 20 +++++++++++++++-----
>  src/qemu/qemu_hostdev.h |  3 ++-
>  src/qemu/qemu_process.c |  2 +-
>  5 files changed, 35 insertions(+), 12 deletions(-)
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 09f412e..d590df6 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -3507,17 +3507,21 @@ qemuBuildUSBHostdevDevStr(virDomainHostdevDefPtr dev,
>  {
>      virBuffer buf = VIR_BUFFER_INITIALIZER;
>  
> -    if (!dev->source.subsys.u.usb.bus &&
> +    if (!dev->missing &&
> +        !dev->source.subsys.u.usb.bus &&
>          !dev->source.subsys.u.usb.device) {
>          virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>                         _("USB host device is missing bus/device information"));
>          return NULL;
>      }
>  
> -    virBufferAsprintf(&buf, "usb-host,hostbus=%d,hostaddr=%d,id=%s",
> -                      dev->source.subsys.u.usb.bus,
> -                      dev->source.subsys.u.usb.device,
> -                      dev->info->alias);
> +    virBufferAddLit(&buf, "usb-host");
> +    if (!dev->missing) {
> +        virBufferAsprintf(&buf, ",hostbus=%d,hostaddr=%d",
> +                          dev->source.subsys.u.usb.bus,
> +                          dev->source.subsys.u.usb.device);
> +    }
> +    virBufferAsprintf(&buf, ",id=%s", dev->info->alias);

I'm curious about this - it will result in

   -device  usb-host,id=XXXXX

shouldn't we actually just leave out the entire arg. I'm not sure
what QEMU would do with such a device specification.


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list