PCIE: fix regression with coldplugged multifunction device
authorIgor Mammedov <imammedo@redhat.com>
Mon, 17 Feb 2014 14:00:06 +0000 (15:00 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 9 Mar 2014 19:09:37 +0000 (21:09 +0200)
commit6e1f0a55a14bad1d0c8b9d29626ef4e4b2617c74
tree60a890109fd1e4ceef52d35d86cb71fc2bc25dac
parent8e46bbf362458fc3e4638a53249248a1ee40b912
PCIE: fix regression with coldplugged multifunction device

PCIE is causing asserts each time a multifunction device is added
on command line (coldplug).

This is caused by
commit a66e657e18cd9b70e9f57ae5512c07faf2bc508f
    pci/pcie: convert PCIE hotplug to use hotplug-handler API
QEMU abort is caused by misplaced assertion, which should
be checked only when device is hotplugged.

Reference to regression report:
 http://www.mail-archive.com/qemu-devel@nongnu.org/msg216226.html

Fixes: a66e657e18cd9b70e9f57ae5512c07faf2bc508f

Reported-By: Nigel Kukard <nkukard+qemu@lbsd.net>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci/pcie.c