Skip to contentSkip to conversation

update-linux-headers.sh and virtio

PATCH In review Jens Freimann 3 participants 6 messages Feb 12, 2015 – Feb 19, 2015

lore
Share & tools
lore
#0 lore raw

cover update-linux-headers.sh and virtio

Hi,

currently when sync'ing linux-headers against kvm/next, qemu/master won't build because of two problems:

1. virtio_types.h needs to be copied to QEMU linux-headers, as it is now included by virtio_ring.h Patch 2 adds virtio_types.h two update-linux-headers.sh.

2. VIRTIO_TRANSPORT_F_END has changed in the kernel. We have this define twice in QEMU, once in include/hw/virtio/virtio.h and then in linux-headers/linux/virtio_config.h It changed in the kernel and now we have two different values after a header sync.

Can we get rid of the duplicate define for VIRTIO_TRANSPORT_F_START/_END in QEMU? We still have it in the kernel headers.

Jens Freimann (2):
update-linux-headers.sh: also grap virtio_types.h
virtio: remove QEMU definition of VIRTIO_TRANSPORT_F_START/_END

 include/hw/virtio/virtio.h      | 5 -----
 scripts/update-linux-headers.sh | 2 +-
 2 files changed, 1 insertion(+), 6 deletions(-)
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/2 update-linux-headers.sh: also grap virtio_types.h

---
 scripts/update-linux-headers.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/update-linux-headers.sh +1 -1
index c8e026d..0b2e117 100755
@@ -62,7 +62,7 @@ done
 rm -rf "$output/linux-headers/linux"
 mkdir -p "$output/linux-headers/linux"
 for header in kvm.h kvm_para.h vfio.h vhost.h virtio_config.h virtio_ring.h \
-              psci.h; do
+              psci.h virtio_types.h; do
     cp "$tmpdir/include/linux/$header" "$output/linux-headers/linux"
 done
 rm -rf "$output/linux-headers/asm-generic"
Signature · 1 line
2.1.4
#2 lore raw

PATCH 2/2 virtio: remove QEMU definition of VIRTIO_TRANSPORT_F_START/_END

In reply to Jens Freimann

We have defines for VIRTIO_TRANSPORT_F_START/_END in two places. In include/hw/virtio/virtio.h and in linux-headers/linux/virtio_config.h

Since we already get virtio_config.h via update-linux-headers.sh, there's no need to have duplicate defines in QEMU headers files.

Let's remove this define from include/hw/virtio/virtio.h

---
 include/hw/virtio/virtio.h | 5 -----
 1 file changed, 5 deletions(-)
include/hw/virtio/virtio.h +0 -5
index f24997d..f0350db 100644
@@ -35,11 +35,6 @@
 /* We've given up on this device. */
 #define VIRTIO_CONFIG_S_FAILED          0x80
 
-/* Some virtio feature bits (currently bits 28 through 31) are reserved for the
- * transport being used (eg. virtio_ring), the rest are per-device feature bits. */
-#define VIRTIO_TRANSPORT_F_START        28
-#define VIRTIO_TRANSPORT_F_END          32
-
 /* We notify when the ring is completely used, even if the guest is suppressing
  * callbacks */
 #define VIRTIO_F_NOTIFY_ON_EMPTY        24
Signature · 1 line
2.1.4
#3 lore raw

Re: [Qemu-devel] [PATCH 2/2] virtio: remove QEMU definition of VIRTIO_TRANSPORT_F_START/_END

Quoted 7 lines · Jens Freimann

We have defines for VIRTIO_TRANSPORT_F_START/_END in two places. In include/hw/virtio/virtio.h and in linux-headers/linux/virtio_config.h

Since we already get virtio_config.h via update-linux-headers.sh, there's no need to have duplicate defines in QEMU headers files.

Let's remove this define from include/hw/virtio/virtio.h

Isn't this going to break compilation on non-linux hosts? They don't get linux-headers/ on their include path, so our virtio.h is their only source for this define...

-- PMM

#4 lore raw

Re: [Qemu-devel] [PATCH 2/2] virtio: remove QEMU definition of VIRTIO_TRANSPORT_F_START/_END

Quoted 4 lines · Peter Maydell
Quoted 3 lines · Jens Freimann

We have defines for VIRTIO_TRANSPORT_F_START/_END in two places. In include/hw/virtio/virtio.h and in linux-headers/linux/virtio_config.h

Quoted 8 lines
Quoted 4 lines

Since we already get virtio_config.h via update-linux-headers.sh, there's no need to have duplicate defines in QEMU headers files.

Let's remove this define from include/hw/virtio/virtio.h

Isn't this going to break compilation on non-linux hosts? They don't get linux-headers/ on their include path, so our virtio.h is their only source for this define...

Ok, that's a fair point that I didn't think of. What's the correct way to fix this then? Change our virtio.h manually? In a separate commit or in the one generated by update-linux-headers (so we don't break bisect)?

Jens

Quoted 3 lines

-- PMM

#5 lore raw

Re: [Qemu-devel] [PATCH 2/2] virtio: remove QEMU definition of VIRTIO_TRANSPORT_F_START/_END

Quoted 10 lines · On Thu, 12 Feb 2015 15:53:49 +0100 Jens Freimann <[email protected]>…
Quoted 9 lines · Peter Maydell
Quoted 7 lines · Jens Freimann

We have defines for VIRTIO_TRANSPORT_F_START/_END in two places. In include/hw/virtio/virtio.h and in linux-headers/linux/virtio_config.h

Since we already get virtio_config.h via update-linux-headers.sh, there's no need to have duplicate defines in QEMU headers files.

Let's remove this define from include/hw/virtio/virtio.h

Quoted 7 lines
Quoted 3 lines

Isn't this going to break compilation on non-linux hosts? They don't get linux-headers/ on their include path, so our virtio.h is their only source for this define...

Ok, that's a fair point that I didn't think of. What's the correct way to fix this then? Change our virtio.h manually? In a separate commit or in the one generated by update-linux-headers (so we don't break bisect)?

I think this is fixed by MST's standard headers patch series.