qemu-devel
[Top][All Lists]
Advanced

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

Re: [PULL 8/9] qapi: introduce forwarding visitor


From: Paolo Bonzini
Subject: Re: [PULL 8/9] qapi: introduce forwarding visitor
Date: Sat, 25 Sep 2021 14:11:42 +0200



El lun., 9 ago. 2021 12:40, Peter Maydell <peter.maydell@linaro.org> escribió:
Is it right, or is this its "looks like this is returning an error
indication" heuristic misfiring again ?

My guess is the latter and it's caused by a mismatch
between the prototype of visit_optional() (returns a
status both by setting *present and in its return value)
and the Visitor::optional method (returns a status only
by setting *present, return void). I guess ideally we'd
standardize on whether these things were intended to return
a value or not.

Yeah, it's a false positive and the fix would be make Visitor::optional return a bool: if the visitor implements it, it's mandatory to overwrite *present, while non-input visitors (including the clone visitor) need not implement it at all and visit_optional will just return *present.

Paolo


thanks
-- PMM


reply via email to

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