summaryrefslogtreecommitdiffstats
path: root/hw/qdev.h
diff options
context:
space:
mode:
authorMichael Roth <mdroth@linux.vnet.ibm.com>2012-03-04 13:38:27 -0600
committerAndreas Färber <afaerber@suse.de>2012-06-08 16:11:14 +0200
commit09f1bbcd834c63da35b3fe190fcd9a20d7b04f07 (patch)
tree49be20255dd293b1af972a1d7b8cd4cd6e9d87ae /hw/qdev.h
parent0d30b0a2d338cd5f463a0fd3942d19f70eb6db56 (diff)
downloadhqemu-09f1bbcd834c63da35b3fe190fcd9a20d7b04f07.zip
hqemu-09f1bbcd834c63da35b3fe190fcd9a20d7b04f07.tar.gz
qdev: Use int32_t container for devfn property
Valid range for devfn is -1 to 255 (-1 for automatic assignment). We do not currently validate this due to devfn being stored as a uint32_t. This can lead to segfaults and other strange behavior. We could technically just cast it to int32_t to implement the checking, but this will not work for visitor-based setting where we may do additional bounds-checking based on target container type, which is int32_t for this case. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/qdev.h')
-rw-r--r--hw/qdev.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/qdev.h b/hw/qdev.h
index 4e90119..d07da45 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -267,7 +267,7 @@ extern PropertyInfo qdev_prop_blocksize;
#define DEFINE_PROP_HEX64(_n, _s, _f, _d) \
DEFINE_PROP_DEFAULT(_n, _s, _f, _d, qdev_prop_hex64, uint64_t)
#define DEFINE_PROP_PCI_DEVFN(_n, _s, _f, _d) \
- DEFINE_PROP_DEFAULT(_n, _s, _f, _d, qdev_prop_pci_devfn, uint32_t)
+ DEFINE_PROP_DEFAULT(_n, _s, _f, _d, qdev_prop_pci_devfn, int32_t)
#define DEFINE_PROP_PTR(_n, _s, _f) \
DEFINE_PROP(_n, _s, _f, qdev_prop_ptr, void*)
OpenPOWER on IntegriCloud