* [Qemu-devel] [PATCH] qdev: return size of binary properties.
@ 2009-05-29 18:54 Gerd Hoffmann
0 siblings, 0 replies; only message in thread
From: Gerd Hoffmann @ 2009-05-29 18:54 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
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 <kraxel@redhat.com>
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-05-29 18:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-29 18:54 [Qemu-devel] [PATCH] qdev: return size of binary properties Gerd Hoffmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).