virtio-pci: Report an error when msix vectors init fails
authorFam Zheng <famz@redhat.com>
Mon, 23 Jun 2014 09:06:25 +0000 (17:06 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 23 Jun 2014 14:38:00 +0000 (17:38 +0300)
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: Fam Zheng <famz@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/virtio-pci.c

index ce97514b69aeb62f97bcf05b204727d188e4a4e0..57e1e6141e65a585010f6afba54f86458de47f88 100644 (file)
@@ -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;
     }