[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] qdev: return size of binary properties.
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH] qdev: return size of binary properties. |
Date: |
Fri, 29 May 2009 20:54:02 +0200 |
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 <address@hidden>
---
hw/qdev.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/hw/qdev.c b/hw/qdev.c
index 8c06fce..74a2892 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -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)
--
1.6.2.2
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-devel] [PATCH] qdev: return size of binary properties.,
Gerd Hoffmann <=