[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>
- Re: [PATCH 12/52] migration/rdma: Drop qemu_rdma_search_ram_block() error handling, (continued)
- [PATCH 02/52] migration/rdma: Clean up qemu_rdma_data_init()'s return type, Markus Armbruster, 2023/09/18
- [PATCH 27/52] migration/rdma: Drop superfluous assignments to @ret, Markus Armbruster, 2023/09/18
- [PATCH 20/52] migration/rdma: Drop dead qemu_rdma_data_init() code for !@host_port, Markus Armbruster, 2023/09/18
- [PATCH 46/52] migration/rdma: Silence qemu_rdma_reg_control(), Markus Armbruster, 2023/09/18
- [PATCH 06/52] migration/rdma: Clean up two more harmless signed vs. unsigned issues, Markus Armbruster, 2023/09/18
- [PATCH 32/52] migration/rdma: Fix error handling around rdma_getaddrinfo(), Markus Armbruster, 2023/09/18
- [PATCH 11/52] migration/rdma: Drop rdma_add_block() error handling, Markus Armbruster, 2023/09/18