qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 1/4] Add Error **errp for xen_host_pci_device


From: Cao jin
Subject: Re: [Qemu-devel] [PATCH v2 1/4] Add Error **errp for xen_host_pci_device_get()
Date: Tue, 5 Jan 2016 20:41:26 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0



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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]