qdev: return size of binary properties.
PATCH 1/1 qdev: return size of binary properties.
Make qdev_get_prop_bin() return the actual size of the binary property instead of 0 on success. Needed to handle variable length properties.
Incremental fix for the "qdev: add string and binary properties" patch.
Signed-off-by Gerd Hoffmann <[email protected]>
--- hw/qdev.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
hw/qdev.c +1 -1
@@ -253,7 +253,7 @@ int qdev_get_prop_bin(DeviceState *dev, const char *name, uint8_t *dest, size_tif (size < prop->len)return -1 ;memcpy (dest, prop->value.bin, prop->len); -return 0 ; +return prop->len; }void *qdev_get_prop_ptr (DeviceState *dev,const char *name)
Signature · 1 line
1.6.2.2