From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MA7Da-00024T-Tp for qemu-devel@nongnu.org; Fri, 29 May 2009 14:54:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MA7DW-0001zR-IU for qemu-devel@nongnu.org; Fri, 29 May 2009 14:54:14 -0400 Received: from [199.232.76.173] (port=33788 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MA7DW-0001z9-B4 for qemu-devel@nongnu.org; Fri, 29 May 2009 14:54:10 -0400 Received: from mx2.redhat.com ([66.187.237.31]:51999) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MA7DV-0001jA-Pu for qemu-devel@nongnu.org; Fri, 29 May 2009 14:54:10 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n4TIs69w028816 for ; Fri, 29 May 2009 14:54:06 -0400 From: Gerd Hoffmann Date: Fri, 29 May 2009 20:54:02 +0200 Message-Id: <1243623242-7879-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH] qdev: return size of binary properties. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 --- 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