Re: [PULL 37/48] usb: build usb-host as module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



adding libvirt-list

On Thu, Jul 08, 2021 at 17:17:37 +0200, Paolo Bonzini wrote:
> From: Gerd Hoffmann <kraxel@xxxxxxxxxx>
> 
> Drop one more shared library dependency (libusb) from core qemu.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@xxxxxxxxxx>
> Reviewed-by: Jose R. Ziviani <jziviani@xxxxxxx>
> Message-Id: <20210624103836.2382472-34-kraxel@xxxxxxxxxx>
> Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> ---
>  hw/usb/host-libusb.c | 1 +
>  hw/usb/meson.build   | 8 ++++++--
>  2 files changed, 7 insertions(+), 2 deletions(-)

After this commit libvirt is no longer detecting the 'hostdevice'
property of 'usb-host'. In fact 'device-list-properties' is returning:

"desc": "Device 'usb-host' not found"

> diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
> index 2b7f87872c..c0f314462a 100644
> --- a/hw/usb/host-libusb.c
> +++ b/hw/usb/host-libusb.c
> @@ -1777,6 +1777,7 @@ static TypeInfo usb_host_dev_info = {
>      .class_init    = usb_host_class_initfn,
>      .instance_init = usb_host_instance_init,
>  };
> +module_obj(TYPE_USB_HOST_DEVICE);
>  
>  static void usb_host_register_types(void)
>  {
> diff --git a/hw/usb/meson.build b/hw/usb/meson.build
> index 817f3e027a..3ca6127937 100644
> --- a/hw/usb/meson.build
> +++ b/hw/usb/meson.build
> @@ -72,8 +72,12 @@ if usbredir.found()
>  endif
>  
>  # usb pass-through
> -softmmu_ss.add(when: ['CONFIG_USB', libusb],
> -               if_true: files('host-libusb.c'))
> +if config_host.has_key('CONFIG_USB_LIBUSB')

The problem is in this condition as it's evaluated as false. When I
replace it with libusb.found(), everything works as it used to.

Unfortunately I don't know what the real goa behind using
CONFIG_USB_LIBUSB here was to see whether my approach is good.

> +  usbhost_ss = ss.source_set()
> +  usbhost_ss.add(when: ['CONFIG_USB', libusb],
> +                 if_true: files('host-libusb.c'))
> +  hw_usb_modules += {'host': usbhost_ss}
> +endif
>  
>  softmmu_ss.add(when: ['CONFIG_USB', 'CONFIG_XEN', libusb], if_true: files('xen-usb.c'))
>  
> -- 
> 2.31.1
> 
> 
> 




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux