From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH v4] kvm: Use a bitmap for tracking used GSIs Date: Wed, 13 May 2009 17:32:11 +0300 Message-ID: <20090513143211.GB1405@redhat.com> References: <20090512220142.5663.72948.stgit@dl380g6-3.ned.telco.ned.telco> <20090513043835.6696.27384.stgit@dl380g6-3.ned.telco.ned.telco> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, sheng.yang@intel.com To: Alex Williamson Return-path: Received: from mx2.redhat.com ([66.187.237.31]:54303 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752267AbZEMOdK (ORCPT ); Wed, 13 May 2009 10:33:10 -0400 Content-Disposition: inline In-Reply-To: <20090513043835.6696.27384.stgit@dl380g6-3.ned.telco.ned.telco> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, May 12, 2009 at 10:41:29PM -0600, Alex Williamson wrote: > + gsi_count = kvm_get_gsi_count(kvm); > + /* Round up so we can search ints using ffs */ > + gsi_bytes = ((gsi_count + 31) / 32) * 4; > + kvm->used_gsi_bitmap = malloc(gsi_bytes); What happens on error in kvm_get_gsi_count? gsi_count will be negative .. -- MST