diff mbox

[PULL,04/21] Print error when failing to load PCI config data

Message ID 4f2cc7f55da197279bcfcf19e8a2d71548944b4b.1434971627.git.mjt@msgid.tls.msk.ru
State New
Headers show

Commit Message

Michael Tokarev June 22, 2015, 11:16 a.m. UTC
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

When loading migration fails due to a disagreement about
PCI config data we don't currently get any errors explaining
that was the cause of the problem or which byte in the config
data was at fault.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/pci/pci.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 2158043..ef44e04 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -427,6 +427,10 @@  static int get_pci_config_device(QEMUFile *f, void *pv, size_t size)
     for (i = 0; i < size; ++i) {
         if ((config[i] ^ s->config[i]) &
             s->cmask[i] & ~s->wmask[i] & ~s->w1cmask[i]) {
+            error_report("%s: Bad config data: i=0x%x read: %x device: %x "
+                         "cmask: %x wmask: %x w1cmask:%x", __func__,
+                         i, config[i], s->config[i],
+                         s->cmask[i], s->wmask[i], s->w1cmask[i]);
             g_free(config);
             return -EINVAL;
         }