From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH] qdev: return size of binary properties.
Date: Fri, 29 May 2009 20:54:02 +0200 [thread overview]
Message-ID: <1243623242-7879-1-git-send-email-kraxel@redhat.com> (raw)
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
reply other threads:[~2009-05-29 18:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1243623242-7879-1-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).