[PATCH] virt-aa-helper: Fix build by including virutil.h

Jim Fehlig posted 1 patch 4 years, 1 month ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20200224233043.5532-1-jfehlig@suse.com
src/security/virt-aa-helper.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] virt-aa-helper: Fix build by including virutil.h
Posted by Jim Fehlig 4 years, 1 month ago
Commit fb01e1a44d missed including virutil.h, causing the following
compilation error

../../src/security/virt-aa-helper.c:1055:43: error: implicit declaration of
function 'virHostGetDRMRenderNode' [-Werror=implicit-function-declaration]
1055 |                 char *defaultRenderNode = virHostGetDRMRenderNode();

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
---

Pushing under the build-breaker rule.

 src/security/virt-aa-helper.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 6f36652c7c..b6f58efdea 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -41,6 +41,7 @@
 #include "virxml.h"
 #include "viruuid.h"
 #include "virusb.h"
+#include "virutil.h"
 #include "virpci.h"
 #include "virfile.h"
 #include "configmake.h"
-- 
2.25.0


Re: [PATCH] virt-aa-helper: Fix build by including virutil.h
Posted by Christian Ehrhardt 4 years, 1 month ago
On Tue, Feb 25, 2020 at 12:36 AM Jim Fehlig <jfehlig@suse.com> wrote:

> Commit fb01e1a44d missed including virutil.h, causing the following
> compilation error
>
> ../../src/security/virt-aa-helper.c:1055:43: error: implicit declaration of
> function 'virHostGetDRMRenderNode' [-Werror=implicit-function-declaration]
> 1055 |                 char *defaultRenderNode = virHostGetDRMRenderNode();
>
> Signed-off-by: Jim Fehlig <jfehlig@suse.com>
> ---
>
> Pushing under the build-breaker rule.
>

Thanks Jim,
it always built for me in all pre-tests which is odd.
Thanks for fixing it so fast!


>  src/security/virt-aa-helper.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
> index 6f36652c7c..b6f58efdea 100644
> --- a/src/security/virt-aa-helper.c
> +++ b/src/security/virt-aa-helper.c
> @@ -41,6 +41,7 @@
>  #include "virxml.h"
>  #include "viruuid.h"
>  #include "virusb.h"
> +#include "virutil.h"
>  #include "virpci.h"
>  #include "virfile.h"
>  #include "configmake.h"
> --
> 2.25.0
>
>
>

-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd
Re: [PATCH] virt-aa-helper: Fix build by including virutil.h
Posted by Michal Privoznik 4 years, 1 month ago
On 2/25/20 10:06 AM, Christian Ehrhardt wrote:
> 
> 
> On Tue, Feb 25, 2020 at 12:36 AM Jim Fehlig <jfehlig@suse.com 
> <mailto:jfehlig@suse.com>> wrote:
> 
>     Commit fb01e1a44d missed including virutil.h, causing the following
>     compilation error
> 
>     ../../src/security/virt-aa-helper.c:1055:43: error: implicit
>     declaration of
>     function 'virHostGetDRMRenderNode'
>     [-Werror=implicit-function-declaration]
>     1055 |                 char *defaultRenderNode =
>     virHostGetDRMRenderNode();
> 
>     Signed-off-by: Jim Fehlig <jfehlig@suse.com <mailto:jfehlig@suse.com>>
>     ---
> 
>     Pushing under the build-breaker rule.
> 
> 
> Thanks Jim,
> it always built for me in all pre-tests which is odd.
> Thanks for fixing it so fast!

In fact I think the commit that caused the problem was a different one 
(I blame the latest virutil.h include cleanup). The problem was that 
some header files included virutil.h directly and thus aa-helper code 
got it for free. After the include was removed, the helper needs to 
include virtuil.h explicitly. I haven't look at which commit exactly 
caused the problem. It doesn't really matter, does it?

Michal

Re: [PATCH] virt-aa-helper: Fix build by including virutil.h
Posted by Jim Fehlig 4 years, 1 month ago
On 2/25/20 4:35 AM, Michal Privoznik wrote:
> On 2/25/20 10:06 AM, Christian Ehrhardt wrote:
>>
>>
>> On Tue, Feb 25, 2020 at 12:36 AM Jim Fehlig <jfehlig@suse.com 
>> <mailto:jfehlig@suse.com>> wrote:
>>
>>     Commit fb01e1a44d missed including virutil.h, causing the following
>>     compilation error
>>
>>     ../../src/security/virt-aa-helper.c:1055:43: error: implicit
>>     declaration of
>>     function 'virHostGetDRMRenderNode'
>>     [-Werror=implicit-function-declaration]
>>     1055 |                 char *defaultRenderNode =
>>     virHostGetDRMRenderNode();
>>
>>     Signed-off-by: Jim Fehlig <jfehlig@suse.com <mailto:jfehlig@suse.com>>
>>     ---
>>
>>     Pushing under the build-breaker rule.
>>
>>
>> Thanks Jim,
>> it always built for me in all pre-tests which is odd.
>> Thanks for fixing it so fast!
> 
> In fact I think the commit that caused the problem was a different one (I blame 
> the latest virutil.h include cleanup). The problem was that some header files 
> included virutil.h directly and thus aa-helper code got it for free. After the 
> include was removed, the helper needs to include virtuil.h explicitly. I haven't 
> look at which commit exactly caused the problem. It doesn't really matter, does it?

Yep, I think you are right. It was likely commit b11e8ccc. But I also think you 
are right in that it really doesn't matter at this point :-).

Regards,
Jim