[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 30/38] qapi-types.py: Fix enum struct sizes on i686
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 30/38] qapi-types.py: Fix enum struct sizes on i686 |
Date: |
Wed, 25 Sep 2013 07:57:58 -0500 |
From: Cole Robinson <address@hidden>
Unlike other list types, enum wasn't adding any padding, which caused
a mismatch between the generated struct size and GenericList struct
size. More details in a678e26cbe89f7a27cbce794c2c2784571ee9d21
This crashed qemu if calling qmp query-tpm-types for example, which
upsets libvirt capabilities probing. Reproducer on i686:
(sleep 5; printf
'{"execute":"qmp_capabilities"}\n{"execute":"query-tpm-types"}\n') |
./i386-softmmu/qemu-system-i386 -S -nodefaults -nographic -M none -qmp stdio
https://bugs.launchpad.net/qemu/+bug/1219207
Cc: address@hidden
Signed-off-by: Cole Robinson <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Tested-by: Richard W.M. Jones <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>
(cherry picked from commit 02dc4bf5684d3fb46786fab2ecff98214b1df9fe)
Signed-off-by: Michael Roth <address@hidden>
---
scripts/qapi-types.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index 5ee46ea..5d31b06 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -51,7 +51,10 @@ def generate_fwd_enum_struct(name, members):
return mcgen('''
typedef struct %(name)sList
{
- %(name)s value;
+ union {
+ %(name)s value;
+ uint64_t padding;
+ };
struct %(name)sList *next;
} %(name)sList;
''',
--
1.7.9.5
- [Qemu-devel] [PATCH 18/38] exec: always use MADV_DONTFORK, (continued)
- [Qemu-devel] [PATCH 18/38] exec: always use MADV_DONTFORK, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 17/38] virtio_pci: fix level interrupts with irqfd, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 19/38] xhci: reset port when disabling slot, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 20/38] usb: parallelize usb3 streams, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 21/38] w32: Fix access to host devices (regression), Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 23/38] Revert "memory: Return -1 again on reads from unsigned regions", Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 24/38] exec: check offset_within_address_space for register subpage, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 22/38] memory: Provide separate handling of unassigned io ports accesses, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 25/38] ne2000: mark I/O as LITTLE_ENDIAN, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 28/38] pc: Initializing ram_memory under Xen., Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 30/38] qapi-types.py: Fix enum struct sizes on i686,
Michael Roth <=
- [Qemu-devel] [PATCH 31/38] pcnet-pci: mark I/O and MMIO as LITTLE_ENDIAN, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 26/38] ehci: save device pointer in EHCIState, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 29/38] pc_q35: Initialize Xen., Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 33/38] kvmvapic: Catch invalid ROM size, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 36/38] tci: Fix qemu-alpha on 32 bit hosts (wrong assertions), Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 34/38] kvmvapic: Enter inactive state on hardware reset, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 27/38] qxl: fix local renderer, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 35/38] kvmvapic: Clear also physical ROM address when entering INACTIVE state, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 32/38] chardev: fix pty_chr_timer, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 37/38] blockdev: do not default cache.no-flush to true, Michael Roth, 2013/09/25