qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 20/52] migration/rdma: Drop dead qemu_rdma_data_init() code f


From: Markus Armbruster
Subject: Re: [PATCH 20/52] migration/rdma: Drop dead qemu_rdma_data_init() code for !@host_port
Date: Wed, 20 Sep 2023 15:13:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Peter Xu <peterx@redhat.com> writes:

> On Mon, Sep 18, 2023 at 04:41:34PM +0200, Markus Armbruster wrote:
>> qemu_rdma_data_init() neglects to set an Error when it fails because
>> @host_port is null.  Fortunately, no caller passes null, so this is
>
> Indeed they all seem to be non-null.
>
> Before this patch, qemu_rdma_data_init() can still tolerant NULL, not
> setting errp but still returning NULL showing an error.

Returning failure without setting an error is wrong :)

> After this patch, qemu_rdma_data_init() should crash at inet_parse() if
> it's null.

Yes.

> Would it be simpler and clearer if we just set ERROR() for !host_port?

I dislike impossible error paths, because they are untestable.

> Thanks,
>
>> merely a latent bug.  Drop the flawed code handling null argument.
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>




reply via email to

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