On 30 December 2014 at 16:28, Michael S. Tsirkin <m...@redhat.com> wrote: > Tweak virtio core so we can use linux virtio pci header > directly without duplicating code. > > Signed-off-by: Michael S. Tsirkin <m...@redhat.com>
> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c > index 7382705..bc11d3d 100644 > --- a/hw/virtio/virtio-pci.c > +++ b/hw/virtio/virtio-pci.c > @@ -17,6 +17,7 @@ > > #include <inttypes.h> > > +#include "linux-headers/linux/virtio_pci.h" I'm afraid this won't work. You can only pull in the Linux headers inside CONFIG_KVM ifdefs. Otherwise you're liable to break the build on non-Linux platforms, because the kernel headers make no guarantees about being usable on any hosts other than Linux. Indeed in this specific case MacOSX won't build: In file included from /Users/pm215/src/qemu/hw/virtio/virtio-pci.c:20: /Users/pm215/src/qemu/linux-headers/linux/virtio_pci.h:42:10: fatal error: 'linux/types.h' file not found #include <linux/types.h> ^ If you need the virtio_pci.h header you'll need to make a portable copy of it in include/hw/virtio/, the same way we have already for the other headers. thanks -- PMM