Re: [PATCH 3/5] migration/multifd: Replace assert() with error_setg() in recv paths

Fabiano Rosas <[email protected]>
Newsgroups gmane.comp.emulators.qemu.stable,gmane.comp.emulators.qemu
Message-ID <[email protected]>
Peter Xu <[email protected]> writes:

> On Tue, Jul 28, 2026 at 04:51:07PM -0300, Fabiano Rosas wrote:
>> Peter Xu <[email protected]> writes:
>> 
>> > QPL and UADK multifd backends use assert() to validate wire-controlled
>> > fields like per-page compressed lengths and packet size consistency.  These
>> > asserts will stop working with released version of binaries, so may stop
>> > working.
>> 
>> This is not true, asserts are always on. Same for the similar comment in
>> the previous patch commit message.
>
> Shall I perhaps replace this to "when compiled with -DNDEBUG"?
>

It's not allowed as per osdep.h:

#ifdef NDEBUG
#error building with NDEBUG is not supported
#endif

>> 
>> >
>> > Replace all assert() calls in the receive path with proper error_setg() so
>> > validation failures are reported gracefully rather than crashing or
>> > silently ignored.
>> >
>> > While at it, touch up an assert() in qatzip recv path too.
>> >
>> > Cc: qemu-stable <[email protected]>
>> > Cc: Fabiano Rosas <[email protected]>
>> > Cc: Yuan Liu <[email protected]>
>> > Cc: Yichen Wang <[email protected]>
>> > Signed-off-by: Peter Xu <[email protected]>
>> 
>> Reviewed-by: Fabiano Rosas <[email protected]>
>
> Thanks,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.