Received: from eggs.gnu.org ([2001:4830:134:3::10]:45139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWguV-0005Yg-9j for qemu-devel@nongnu.org; Mon, 08 Aug 2016 05:31:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bWguU-0004hG-Ce for qemu-devel@nongnu.org; Mon, 08 Aug 2016 05:31:51 -0400 From: "Daniel P. Berrange" Date: Mon, 8 Aug 2016 10:31:40 +0100 Message-Id: <1470648700-3474-1-git-send-email-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH for-2.7] virtio-gpu: fix missing log.h include file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , qemu-trivial@nongnu.org, 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=3Dnop 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 =E2=80= =98virgl_cmd_create_resource_2d=E2=80=99: /home/berrange/src/virt/qemu/include/hw/virtio/virtio-gpu.h:138:13: error= : implicit declaration of function =E2=80=98qemu_log_mask=E2=80=99 [-Werr= or=3Dimplicit-function-declaration] qemu_log_mask(LOG_GUEST_ERROR, = \ ^ /home/berrange/src/virt/qemu/hw/display/virtio-gpu-3d.c:34:5: note: in ex= pansion of macro =E2=80=98VIRTIO_GPU_FILL_CMD=E2=80=99 VIRTIO_GPU_FILL_CMD(c2d); ^~~~~~~~~~~~~~~~~~~ /home/berrange/src/virt/qemu/hw/display/virtio-gpu-3d.c:34:5: error: nest= ed extern declaration of =E2=80=98qemu_log_mask=E2=80=99 [-Werror=3Dneste= d-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= : =E2=80=98LOG_GUEST_ERROR=E2=80=99 undeclared (first use in this functio= n) qemu_log_mask(LOG_GUEST_ERROR, = \ [snip many more errors] Signed-off-by: Daniel P. Berrange --- 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-gp= u.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" =20 #include "standard-headers/linux/virtio_gpu.h" #define TYPE_VIRTIO_GPU "virtio-gpu-device" --=20 2.7.4