From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGQss-0002zt-0v for qemu-devel@nongnu.org; Tue, 05 Jan 2016 07:38:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGQso-0006OZ-RV for qemu-devel@nongnu.org; Tue, 05 Jan 2016 07:38:41 -0500 Received: from [59.151.112.132] (port=10933 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGQso-0006O7-F0 for qemu-devel@nongnu.org; Tue, 05 Jan 2016 07:38:38 -0500 References: <1451223640-2569-1-git-send-email-caoj.fnst@cn.fujitsu.com> <1451223640-2569-2-git-send-email-caoj.fnst@cn.fujitsu.com> <568B6F6B.3020800@cn.fujitsu.com> From: Cao jin Message-ID: <568BB9F6.9050309@cn.fujitsu.com> Date: Tue, 5 Jan 2016 20:41:26 +0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 1/4] Add Error **errp for xen_host_pci_device_get() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini Cc: qemu-devel@nongnu.org On 01/05/2016 06:40 PM, Stefano Stabellini wrote: > On Tue, 5 Jan 2016, Cao jin wrote: [...] > > This is true, however I think that relying on it is error prone: in a > couple of years from now somebody might change the call sequence without > updating the error handling (easy to forget), causing QEMU to crash on > error. I think it is safer not to rely on errp != NULL. > I see, sounds reasonable > [...] > I think we only need to use a local Error variable when we want to check > for the returned error, in cases such as: > > if (*errp) { > > In other cases, when we are not interested in *errp, we can simply > propagate the error, like you have done in your patches. > Ok, will fix it > . > -- Yours Sincerely, Cao Jin