Received: from [140.186.70.92] (port=51000 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PHtas-00068q-E9 for qemu-devel@nongnu.org; Mon, 15 Nov 2010 02:35:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PHtar-0003MQ-B7 for qemu-devel@nongnu.org; Mon, 15 Nov 2010 02:35:14 -0500 Received: from mail.valinux.co.jp ([210.128.90.3]:48206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PHtar-0003MK-0h for qemu-devel@nongnu.org; Mon, 15 Nov 2010 02:35:13 -0500 Date: Mon, 15 Nov 2010 16:35:12 +0900 From: Isaku Yamahata Message-ID: <20101115073512.GG27722@valinux.co.jp> References: <7e0bd57a938864f2bb60651f975f5bcaf042c4f2.1288689399.git.yamahata@valinux.co.jp> <20101102125712.GB29655@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101102125712.GB29655@redhat.com> 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: "Michael S. Tsirkin" Cc: skandasa@cisco.com, adnan@khaleel.us, etmartin@cisco.com, qemu-devel@nongnu.org, wexu2@cisco.com 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? -- yamahata