From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: [PATCH] Don't unregister unassigned PCI BAR Date: Tue, 3 Feb 2009 13:58:19 +0200 Message-ID: <20090203115819.GB30234@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: avi@redhat.com Return-path: Received: from mx2.redhat.com ([66.187.237.31]:38650 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751655AbZBCMAk (ORCPT ); Tue, 3 Feb 2009 07:00:40 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n13C0dGt017250 for ; Tue, 3 Feb 2009 07:00:39 -0500 Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Gleb Natapov diff --git a/qemu/hw/pci.c b/qemu/hw/pci.c index 04aecc2..a6d57e5 100644 --- a/qemu/hw/pci.c +++ b/qemu/hw/pci.c @@ -213,7 +213,7 @@ static void pci_unregister_io_regions(PCIDevice *pci_dev) for(i = 0; i < PCI_NUM_REGIONS; i++) { r = &pci_dev->io_regions[i]; - if (!r->size) + if (!r->size || r->addr == -1) continue; if (r->type == PCI_ADDRESS_SPACE_IO) { isa_unassign_ioport(r->addr, r->size); -- Gleb.