[libvirt] [PATCH 06/12] conf: Return any non-zero value from virDomainDeviceInfoIterateInternal callback

Ján Tomko jtomko at redhat.com
Thu Aug 17 14:44:55 UTC 2017


On Wed, Aug 16, 2017 at 04:57:55PM +0200, Peter Krempa wrote:
>Post parse callbacks will need to be able to signal that they failed
>non-fatally. This means that we need to return the value returned by the
>callback without modification.
>---
> src/conf/domain_conf.c | 93 +++++++++++++++++++++++++-------------------------
> 1 file changed, 47 insertions(+), 46 deletions(-)
>
>diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
>index 298fe9b4e..f94317e52 100644
>--- a/src/conf/domain_conf.c
>+++ b/src/conf/domain_conf.c
>@@ -3570,146 +3570,147 @@ virDomainDeviceInfoIterateInternal(virDomainDefPtr def,
>                                    void *opaque)
> {
>     size_t i;
>+    int ret;

Usually we only change the initial value of 'ret' at most once and
always end the function with 'return ret'.

Please name it 'rc' instead so it's not confused with this convention.

Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170817/c601a36f/attachment-0001.sig>


More information about the libvir-list mailing list