[PATCH] rpc: fix race against dtrace probe generator

Daniel P. Berrangé via Devel posted 1 patch 2 days, 9 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20251002131928.3000815-1-berrange@redhat.com
src/rpc/meson.build | 2 ++
1 file changed, 2 insertions(+)
[PATCH] rpc: fix race against dtrace probe generator
Posted by Daniel P. Berrangé via Devel 2 days, 9 hours ago
From: Daniel P. Berrangé <berrange@redhat.com>

The virt_socket_lib library has a dep on dtrace_gen_headers, but
the virprobe.h file (which includes the libvirt_probes.h) is also
used from virnetserverclient.c and virkeepalive.c files which do
not directly depend on virt_socket_lib. Thus it is possible for
the latter files to be built before the libvirt_probes.h file
has had its content written.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 src/rpc/meson.build | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/rpc/meson.build b/src/rpc/meson.build
index 68aaf24b2a..222447f458 100644
--- a/src/rpc/meson.build
+++ b/src/rpc/meson.build
@@ -48,6 +48,8 @@ endif
 rpc_gen_headers = []
 rpc_gen_sources = []
 
+rpc_gen_headers += dtrace_gen_headers,
+
 foreach name : [ 'virnet', 'virkeepalive' ]
   protocol_file = files('@0@protocol.x'.format(name))
   header_file = '@0@protocol.h'.format(name)
-- 
2.50.1

Re: [PATCH] rpc: fix race against dtrace probe generator
Posted by Daniel P. Berrangé via Devel 2 days, 8 hours ago
On Thu, Oct 02, 2025 at 02:19:28PM +0100, Daniel P. Berrangé wrote:
> From: Daniel P. Berrangé <berrange@redhat.com>
> 
> The virt_socket_lib library has a dep on dtrace_gen_headers, but
> the virprobe.h file (which includes the libvirt_probes.h) is also
> used from virnetserverclient.c and virkeepalive.c files which do
> not directly depend on virt_socket_lib. Thus it is possible for
> the latter files to be built before the libvirt_probes.h file
> has had its content written.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  src/rpc/meson.build | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/rpc/meson.build b/src/rpc/meson.build
> index 68aaf24b2a..222447f458 100644
> --- a/src/rpc/meson.build
> +++ b/src/rpc/meson.build
> @@ -48,6 +48,8 @@ endif
>  rpc_gen_headers = []
>  rpc_gen_sources = []
>  
> +rpc_gen_headers += dtrace_gen_headers,

The trailing comma is a figment of your imagination that absolutely
doesn't exist in my local copy of this commit (anymore) ;-P

> +
>  foreach name : [ 'virnet', 'virkeepalive' ]
>    protocol_file = files('@0@protocol.x'.format(name))
>    header_file = '@0@protocol.h'.format(name)
> -- 
> 2.50.1
> 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

Re: [PATCH] rpc: fix race against dtrace probe generator
Posted by Martin Kletzander via Devel 1 day, 11 hours ago
On Thu, Oct 02, 2025 at 03:13:25PM +0100, Daniel P. Berrangé via Devel wrote:
>On Thu, Oct 02, 2025 at 02:19:28PM +0100, Daniel P. Berrangé wrote:
>> From: Daniel P. Berrangé <berrange@redhat.com>
>>
>> The virt_socket_lib library has a dep on dtrace_gen_headers, but
>> the virprobe.h file (which includes the libvirt_probes.h) is also
>> used from virnetserverclient.c and virkeepalive.c files which do
>> not directly depend on virt_socket_lib. Thus it is possible for
>> the latter files to be built before the libvirt_probes.h file
>> has had its content written.
>>
>> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
>> ---
>>  src/rpc/meson.build | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/src/rpc/meson.build b/src/rpc/meson.build
>> index 68aaf24b2a..222447f458 100644
>> --- a/src/rpc/meson.build
>> +++ b/src/rpc/meson.build
>> @@ -48,6 +48,8 @@ endif
>>  rpc_gen_headers = []
>>  rpc_gen_sources = []
>>
>> +rpc_gen_headers += dtrace_gen_headers,
>
>The trailing comma is a figment of your imagination that absolutely
>doesn't exist in my local copy of this commit (anymore) ;-P
>

Oh really!  I was worried there for a bit.  In that case,

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

>> +
>>  foreach name : [ 'virnet', 'virkeepalive' ]
>>    protocol_file = files('@0@protocol.x'.format(name))
>>    header_file = '@0@protocol.h'.format(name)
>> --
>> 2.50.1
>>
>
>With regards,
>Daniel
>-- 
>|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
>|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
>|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
>