diff options
author | Richard Henderson <rth@twiddle.net> | 2015-05-19 13:29:51 -0700 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2015-10-01 16:16:52 +0300 |
commit | 0d583647a7fc73f621eeb64ed703556c4bbebfcc (patch) | |
tree | 9129c8854668d8779c3059c5e535e79b3aad77b2 | |
parent | 798595075bf51c7e3125d260a19d860b9aa63e69 (diff) |
virtio: Notice when the system doesn't support MSIx at all
And do not issue an error_report in that case.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | hw/virtio/virtio-pci.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index eda8205d58..6703806f83 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1491,12 +1491,17 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp) pci_set_long(cfg_mask->pci_cfg_data, ~0x0); } - if (proxy->nvectors && - msix_init_exclusive_bar(&proxy->pci_dev, proxy->nvectors, - proxy->msix_bar)) { - 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, + proxy->msix_bar); + 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; |