diff mbox

hw/xen/xen_pvdev: Include qemu/log.h for qemu_log_vprintf()

Message ID 1478081958-5803-1-git-send-email-thuth@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thomas Huth Nov. 2, 2016, 10:19 a.m. UTC
Olaf Hering reported a build failure due to an undefined reference
to 'qemu_log_vprintf'. Explicitely including qemu/log.h seems to
fix the issue.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/xen/xen_pvdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefano Stabellini Nov. 2, 2016, 5:34 p.m. UTC | #1
On Wed, 2 Nov 2016, Thomas Huth wrote:
> Olaf Hering reported a build failure due to an undefined reference
> to 'qemu_log_vprintf'. Explicitely including qemu/log.h seems to
> fix the issue.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>

The fix makes sense:

Acked-by: Stefano Stabellini <sstabellini@kernel.org>

However I was unable to reproduce the build failure, so I would like a
confirmation from Olaf that the fix is working.


>  hw/xen/xen_pvdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
> index 405e154..5212bc6 100644
> --- a/hw/xen/xen_pvdev.c
> +++ b/hw/xen/xen_pvdev.c
> @@ -18,7 +18,7 @@
>   */
>  
>  #include "qemu/osdep.h"
> -
> +#include "qemu/log.h"
>  #include "hw/xen/xen_backend.h"
>  #include "hw/xen/xen_pvdev.h"
>  
> -- 
> 1.8.3.1
>
Olaf Hering Nov. 2, 2016, 6:39 p.m. UTC | #2
On Wed, Nov 02, Thomas Huth wrote:

> Olaf Hering reported a build failure due to an undefined reference
> to 'qemu_log_vprintf'. Explicitely including qemu/log.h seems to
> fix the issue.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>

Tested-by: Olaf Hering <olaf@aepfle.de>


Olaf
Peter Maydell Nov. 2, 2016, 8:42 p.m. UTC | #3
On 2 November 2016 at 17:34, Stefano Stabellini <sstabellini@kernel.org> wrote:
> On Wed, 2 Nov 2016, Thomas Huth wrote:
>> Olaf Hering reported a build failure due to an undefined reference
>> to 'qemu_log_vprintf'. Explicitely including qemu/log.h seems to
>> fix the issue.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>
> The fix makes sense:
>
> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
>
> However I was unable to reproduce the build failure, so I would like a
> confirmation from Olaf that the fix is working.

If you configure with the (default) simple trace
backend then trace.h will pull in qemu/log.h
(and in this case trace.h comes in via xen_common.h).
But if you're using a different backend then it won't
bring in that header, and you'll get the build failure.

This is a fairly common "breaks but only with
some trace backends" compile failure, but I'm
not sure how best to try to make it more robust
(or at least into a 'fails-everywhere' bug).

thanks
-- PMM
Stefano Stabellini Nov. 2, 2016, 8:53 p.m. UTC | #4
On Wed, 2 Nov 2016, Peter Maydell wrote:
> On 2 November 2016 at 17:34, Stefano Stabellini <sstabellini@kernel.org> wrote:
> > On Wed, 2 Nov 2016, Thomas Huth wrote:
> >> Olaf Hering reported a build failure due to an undefined reference
> >> to 'qemu_log_vprintf'. Explicitely including qemu/log.h seems to
> >> fix the issue.
> >>
> >> Signed-off-by: Thomas Huth <thuth@redhat.com>
> >
> > The fix makes sense:
> >
> > Acked-by: Stefano Stabellini <sstabellini@kernel.org>
> >
> > However I was unable to reproduce the build failure, so I would like a
> > confirmation from Olaf that the fix is working.
> 
> If you configure with the (default) simple trace
> backend then trace.h will pull in qemu/log.h
> (and in this case trace.h comes in via xen_common.h).
> But if you're using a different backend then it won't
> bring in that header, and you'll get the build failure.
> 
> This is a fairly common "breaks but only with
> some trace backends" compile failure, but I'm
> not sure how best to try to make it more robust
> (or at least into a 'fails-everywhere' bug).

Personally what I can do is adding

  --enable-trace-backends=syslog

to my test scripts. That is enough to repro the issue. Thanks for the
explanation.
diff mbox

Patch

diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 405e154..5212bc6 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -18,7 +18,7 @@ 
  */
 
 #include "qemu/osdep.h"
-
+#include "qemu/log.h"
 #include "hw/xen/xen_backend.h"
 #include "hw/xen/xen_pvdev.h"