From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJ8ZU-0005iw-7x for qemu-devel@nongnu.org; Tue, 02 Oct 2012 15:56:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJ8ZT-0005jA-64 for qemu-devel@nongnu.org; Tue, 02 Oct 2012 15:56:00 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:56285) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJ8ZT-0005j6-0y for qemu-devel@nongnu.org; Tue, 02 Oct 2012 15:55:59 -0400 Received: by obbwc18 with SMTP id wc18so4222861obb.4 for ; Tue, 02 Oct 2012 12:55:57 -0700 (PDT) From: Anthony Liguori In-Reply-To: <20121002192147.31100.41594.stgit@bling.home> References: <20121002191609.31100.77382.stgit@bling.home> <20121002192147.31100.41594.stgit@bling.home> Date: Tue, 02 Oct 2012 14:55:53 -0500 Message-ID: <87d310643a.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 2/6] pci-assign: Add support for no-route List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson , mst@redhat.com, qemu-devel@nongnu.org Cc: jan.kiszka@siemens.com Alex Williamson writes: > In the event that a pci-assign device is added to a chipset that > hasn't yet implemented the INTx routing interface, exit gracefully > instead of killing the VM. I'm sure we'll implement this for q35, > but there's no reason for such a harsh response. > > Signed-off-by: Alex Williamson > --- > > hw/kvm/pci-assign.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/hw/kvm/pci-assign.c b/hw/kvm/pci-assign.c > index 05b93d9..7ce0f37 100644 > --- a/hw/kvm/pci-assign.c > +++ b/hw/kvm/pci-assign.c > @@ -887,6 +887,12 @@ static int assign_intx(AssignedDevice *dev) > > intx_route = pci_device_route_intx_to_irq(&dev->dev, dev->intpin); > assert(intx_route.mode != PCI_INTX_INVERTED); > + if (intx_route.mode == PCI_INTX_NOROUTE) { > + error_report("pci-assign: chipset provides no INTx routing " > + "information, but device supports INTx interrupt mode.\n"); > + pci_device_set_intx_routing_notifier(&dev->dev, NULL); > + return -ENOTSUP; > + } Please don't use error_report() in new code. Propagate an Error object using error_setg() and friends. Regards, Anthony Liguori > > if (dev->intx_route.mode == intx_route.mode && > dev->intx_route.irq == intx_route.irq) {