Skip to contentSkip to conversation

qdev: return size of binary properties.

PATCH New Gerd Hoffmann 1 participant 1 message May 29, 2009

lore
Share & tools
lore
#0 lore raw

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.

---
 hw/qdev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/qdev.c +1 -1
index 8c06fce..74a2892 100644
@@ -253,7 +253,7 @@ int qdev_get_prop_bin(DeviceState *dev, const char *name, uint8_t *dest, size_t
     if (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