Commit c7ff5482 authored by Fam Zheng's avatar Fam Zheng Committed by Michael S. Tsirkin
Browse files

virtio-pci: Report an error when msix vectors init fails



Currently vectors silently cleared to 0 if the initialization is failed,
but user should at least have one way to notice this.

Signed-off-by: default avatarFam Zheng <famz@redhat.com>
Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent d2fc39b4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -976,6 +976,8 @@ static void virtio_pci_device_plugged(DeviceState *d)

    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;
    }