From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56179 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PHtkp-0003X4-N1 for qemu-devel@nongnu.org; Mon, 15 Nov 2010 02:46:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PHtkg-000562-K2 for qemu-devel@nongnu.org; Mon, 15 Nov 2010 02:45:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21625) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PHtkg-00055l-Aw for qemu-devel@nongnu.org; Mon, 15 Nov 2010 02:45:22 -0500 Date: Mon, 15 Nov 2010 09:44:39 +0200 From: "Michael S. Tsirkin" Message-ID: <20101115074439.GB22248@redhat.com> References: <7e0bd57a938864f2bb60651f975f5bcaf042c4f2.1288689399.git.yamahata@valinux.co.jp> <20101102125712.GB29655@redhat.com> <20101115073512.GG27722@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101115073512.GG27722@valinux.co.jp> Subject: [Qemu-devel] Re: [PATCH v7 2/6] pcie/aer: helper functions for pcie aer capability List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: skandasa@cisco.com, adnan@khaleel.us, etmartin@cisco.com, qemu-devel@nongnu.org, wexu2@cisco.com On Mon, Nov 15, 2010 at 04:35:12PM +0900, Isaku Yamahata wrote: > On Tue, Nov 02, 2010 at 02:57:12PM +0200, Michael S. Tsirkin wrote: > > > + pcie_add_capability(dev, PCI_EXT_CAP_ID_ERR, PCI_ERR_VER, > > > + offset, PCI_ERR_SIZEOF); > > > + exp = &dev->exp; > > > + exp->aer_cap = offset; > > > + if (dev->exp.aer_log.log_max == PCIE_AER_LOG_MAX_UNSET) { > > > + dev->exp.aer_log.log_max = PCIE_AER_LOG_MAX_DEFAULT; > > > + } > > > + if (dev->exp.aer_log.log_max > PCIE_AER_LOG_MAX_MAX) { > > > + dev->exp.aer_log.log_max = PCIE_AER_LOG_MAX_MAX; > > > + } > > > > So someone should set log_max beforehand? And an illegal value is > > rounded down? How is this API supposed to be used? > > It's qdev property. If log_max is too big, should it return error > instead of silently rounding down? I guess so. Ideally the legal range would be part of qdev, maybe we can add this support. > -- > yamahata