qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] virtio: Notice when the system doesn't support


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PATCH] virtio: Notice when the system doesn't support MSIx at all
Date: Wed, 20 May 2015 11:59:14 +0200

On Tue, May 19, 2015 at 01:29:51PM -0700, Richard Henderson wrote:
> And do not issue an error_report in that case.
> 
> Signed-off-by: Richard Henderson <address@hidden>
> ---
>  hw/virtio/virtio-pci.c | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> --
> 
> This seems to be about the only sane way to test the value of
> msi_supported from here.  Thoughts?
> 
> 
> r~

Can you please include the qemu command-line that triggers the error
in the commit log?

> 
> 
> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> index 867c9d1..6763872 100644
> --- a/hw/virtio/virtio-pci.c
> +++ b/hw/virtio/virtio-pci.c
> @@ -934,11 +934,16 @@ static void virtio_pci_device_plugged(DeviceState *d)
>      pci_set_word(config + PCI_SUBSYSTEM_ID, virtio_bus_get_vdev_id(bus));
>      config[PCI_INTERRUPT_PIN] = 1;
>  
> -    if (proxy->nvectors &&
> -        msix_init_exclusive_bar(&proxy->pci_dev, proxy->nvectors, 1)) {
> -        error_report("unable to init msix vectors to %" PRIu32,
> -                     proxy->nvectors);
> -        proxy->nvectors = 0;
> +    if (proxy->nvectors) {
> +        int err = msix_init_exclusive_bar(&proxy->pci_dev, proxy->nvectors, 
> 1);
> +        if (err) {
> +            /* Notice when a system that supports MSIx can't initialize it.  
> */
> +            if (err != -ENOTSUP) {
> +                error_report("unable to init msix vectors to %" PRIu32,
> +                             proxy->nvectors);
> +            }
> +            proxy->nvectors = 0;
> +        }
>      }
>  
>      proxy->pci_dev.config_write = virtio_write_config;
> -- 
> 2.1.0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]