qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 03/11] test-util-sockets: Clean up SocketAddress construction


From: Markus Armbruster
Subject: Re: [PATCH 03/11] test-util-sockets: Clean up SocketAddress construction
Date: Fri, 30 Oct 2020 15:06:49 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Daniel P. Berrangé <berrange@redhat.com> writes:

> On Thu, Oct 29, 2020 at 02:38:25PM +0100, Markus Armbruster wrote:
>> The thread functions build the SocketAddress from global variable
>> @abstract_sock_name and the tight flag passed as pointer
>> argument (either NULL or (gpointer)1).  There is no need for such
>> hackery; simply pass the SocketAddress instead.
>> 
>> While there, dumb down g_rand_int_range() to g_random_int().
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  tests/test-util-sockets.c | 62 +++++++++++++++------------------------
>>  1 file changed, 24 insertions(+), 38 deletions(-)
>> 
>> diff --git a/tests/test-util-sockets.c b/tests/test-util-sockets.c
>> index 9d317e73a6..b1b5628bd5 100644
>> --- a/tests/test-util-sockets.c
>> +++ b/tests/test-util-sockets.c
>> @@ -230,25 +230,14 @@ static void test_socket_fd_pass_num_nocli(void)
>>  #endif
>>  
>>  #ifdef __linux__
>> -static gchar *abstract_sock_name;
>> -
>>  static gpointer unix_server_thread_func(gpointer user_data)
>>  {
>> -    SocketAddress addr;
>
> Keep this but as a pointer, and initialize it to "user_data",
> so that it is clear what data type this parameter is expected
> to be.

Can do (I don't care for it myself).

[...]




reply via email to

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