qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 1/8] qmp: Support for querying stats


From: Paolo Bonzini
Subject: Re: [PATCH 1/8] qmp: Support for querying stats
Date: Tue, 24 May 2022 18:47:58 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0

On 5/24/22 12:41, Markus Armbruster wrote:
+    return stats_results;
+}
Have you considered making the callbacks return bool, following
error.h's "Whenever practical, also return a value that indicates
success / failure" recommendation?


No, because I generally do not consider that recommendation to apply to callbacks.

Callbacks are written many times and typically invoked just once, so I prefer an O(1) loss in convenience to an O(n) chance of making a mistake in the return value.

Paolo



reply via email to

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