qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.7] virtio-gpu: fix missing log.h include file
@ 2016-08-08  9:31 Daniel P. Berrange
  2016-08-16 10:49 ` Peter Maydell
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel P. Berrange @ 2016-08-08  9:31 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, qemu-trivial, Gerd Hoffmann,
	Daniel P. Berrange

The virtio-gpu.h file defines a macro VIRTIO_GPU_FILL_CMD
which includes a call to qemu_log_mask, but does not
include qemu/log.h. In a default configure, it is lucky
and gets qemu/log.h indirectly due to the 'log' trace
backend being enabled. If that trace backend is disabled
though, eg

 ./configure --enable-trace-backends=nop

Then the build will fail:

In file included from /home/berrange/src/virt/qemu/hw/display/virtio-gpu-3d.c:19:0:
/home/berrange/src/virt/qemu/hw/display/virtio-gpu-3d.c: In function ‘virgl_cmd_create_resource_2d’:
/home/berrange/src/virt/qemu/include/hw/virtio/virtio-gpu.h:138:13: error: implicit declaration of function ‘qemu_log_mask’ [-Werror=implicit-function-declaration]
             qemu_log_mask(LOG_GUEST_ERROR,                              \
             ^
/home/berrange/src/virt/qemu/hw/display/virtio-gpu-3d.c:34:5: note: in expansion of macro ‘VIRTIO_GPU_FILL_CMD’
     VIRTIO_GPU_FILL_CMD(c2d);
     ^~~~~~~~~~~~~~~~~~~
/home/berrange/src/virt/qemu/hw/display/virtio-gpu-3d.c:34:5: error: nested extern declaration of ‘qemu_log_mask’ [-Werror=nested-externs]
In file included from /home/berrange/src/virt/qemu/hw/display/virtio-gpu-3d.c:19:0:
/home/berrange/src/virt/qemu/include/hw/virtio/virtio-gpu.h:138:27: error: ‘LOG_GUEST_ERROR’ undeclared (first use in this function)
             qemu_log_mask(LOG_GUEST_ERROR,                              \

[snip many more errors]

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 include/hw/virtio/virtio-gpu.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
index e4f424a..20d1cd6 100644
--- a/include/hw/virtio/virtio-gpu.h
+++ b/include/hw/virtio/virtio-gpu.h
@@ -19,6 +19,7 @@
 #include "ui/console.h"
 #include "hw/virtio/virtio.h"
 #include "hw/pci/pci.h"
+#include "qemu/log.h"
 
 #include "standard-headers/linux/virtio_gpu.h"
 #define TYPE_VIRTIO_GPU "virtio-gpu-device"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.7] virtio-gpu: fix missing log.h include file
  2016-08-08  9:31 [Qemu-devel] [PATCH for-2.7] virtio-gpu: fix missing log.h include file Daniel P. Berrange
@ 2016-08-16 10:49 ` Peter Maydell
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2016-08-16 10:49 UTC (permalink / raw)
  To: Daniel P. Berrange
  Cc: QEMU Developers, QEMU Trivial, Gerd Hoffmann, Michael S. Tsirkin

On 8 August 2016 at 10:31, Daniel P. Berrange <berrange@redhat.com> wrote:
> The virtio-gpu.h file defines a macro VIRTIO_GPU_FILL_CMD
> which includes a call to qemu_log_mask, but does not
> include qemu/log.h. In a default configure, it is lucky
> and gets qemu/log.h indirectly due to the 'log' trace
> backend being enabled. If that trace backend is disabled
> though, eg
>
>  ./configure --enable-trace-backends=nop
>
> Then the build will fail:
>
> In file included from /home/berrange/src/virt/qemu/hw/display/virtio-gpu-3d.c:19:0:
> /home/berrange/src/virt/qemu/hw/display/virtio-gpu-3d.c: In function ‘virgl_cmd_create_resource_2d’:
> /home/berrange/src/virt/qemu/include/hw/virtio/virtio-gpu.h:138:13: error: implicit declaration of function ‘qemu_log_mask’ [-Werror=implicit-function-declaration]
>              qemu_log_mask(LOG_GUEST_ERROR,                              \
>              ^
> /home/berrange/src/virt/qemu/hw/display/virtio-gpu-3d.c:34:5: note: in expansion of macro ‘VIRTIO_GPU_FILL_CMD’
>      VIRTIO_GPU_FILL_CMD(c2d);
>      ^~~~~~~~~~~~~~~~~~~
> /home/berrange/src/virt/qemu/hw/display/virtio-gpu-3d.c:34:5: error: nested extern declaration of ‘qemu_log_mask’ [-Werror=nested-externs]
> In file included from /home/berrange/src/virt/qemu/hw/display/virtio-gpu-3d.c:19:0:
> /home/berrange/src/virt/qemu/include/hw/virtio/virtio-gpu.h:138:27: error: ‘LOG_GUEST_ERROR’ undeclared (first use in this function)
>              qemu_log_mask(LOG_GUEST_ERROR,                              \
>
> [snip many more errors]
>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-16 10:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-08  9:31 [Qemu-devel] [PATCH for-2.7] virtio-gpu: fix missing log.h include file Daniel P. Berrange
2016-08-16 10:49 ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).