From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH] qemu-kvm: fix error handling in msix vector add Date: Tue, 28 Jul 2009 16:22:36 +0300 Message-ID: <20090728132236.GA5717@redhat.com> References: <20090723133413.GA12944@redhat.com> <20090725153052.GB4429@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: avi@redhat.com, kvm@vger.kernel.org, amit.shah@redhat.com To: Marcelo Tosatti Return-path: Received: from mx2.redhat.com ([66.187.237.31]:49072 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754126AbZG1NXe (ORCPT ); Tue, 28 Jul 2009 09:23:34 -0400 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 n6SDNZQk014387 for ; Tue, 28 Jul 2009 09:23:35 -0400 Content-Disposition: inline In-Reply-To: <20090725153052.GB4429@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On Sat, Jul 25, 2009 at 12:30:52PM -0300, Marcelo Tosatti wrote: > On Thu, Jul 23, 2009 at 04:34:13PM +0300, Michael S. Tsirkin wrote: > > When adding a vector fails, the used counter should > > not be incremented, otherwise on vector change we will > > try to update the routing entry. > > > > Signed-off-by: Michael S. Tsirkin > > Applied, thanks. Should I see this in qemu-kvm master? It does not seem to be there. > > --- > > hw/msix.c | 10 ++++++++-- > > 1 files changed, 8 insertions(+), 2 deletions(-) > > > > diff --git a/hw/msix.c b/hw/msix.c > > index 5f77dc9..47cbdc7 100644 > > --- a/hw/msix.c > > +++ b/hw/msix.c > > @@ -502,13 +502,19 @@ void msix_reset(PCIDevice *dev) > > /* Mark vector as used. */ > > int msix_vector_use(PCIDevice *dev, unsigned vector) > > { > > + int ret; > > if (vector >= dev->msix_entries_nr) > > return -EINVAL; > > - if (dev->msix_entry_used[vector]++) > > + if (dev->msix_entry_used[vector]) { > > return 0; > > + } > > if (kvm_enabled() && qemu_kvm_irqchip_in_kernel()) { > > - return kvm_msix_add(dev, vector); > > + ret = kvm_msix_add(dev, vector); > > + if (ret) { > > + return ret; > > + } > > } > > + ++dev->msix_entry_used[vector]; > > return 0; > > } > > > > -- > > 1.6.2.5 > > -- > > To unsubscribe from this list: send the line "unsubscribe kvm" in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html