From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEcls-0001TN-9P for qemu-devel@nongnu.org; Mon, 13 Jul 2015 08:23:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEclr-0006Fh-DO for qemu-devel@nongnu.org; Mon, 13 Jul 2015 08:23:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37825) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEclr-0006FU-8u for qemu-devel@nongnu.org; Mon, 13 Jul 2015 08:23:43 -0400 Date: Mon, 13 Jul 2015 15:23:39 +0300 From: "Michael S. Tsirkin" Message-ID: <1436790197-18666-2-git-send-email-mst@redhat.com> References: <1436790197-18666-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1436790197-18666-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 1/4] qdev: fix 64 bit properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Peter Maydell , Eduardo Habkost , Markus Armbruster , Christian Borntraeger , Stefan Hajnoczi , Cornelia Huck , Paolo Bonzini From: Cornelia Huck 64 bit props used 32 bit callbacks in two places, leading to broken feature bits on virtio (example: got 0x31000000000006d4 which is obviously bogus). Fix this. Fixes: fdba6d96 ("qdev: add 64bit properties") Signed-off-by: Cornelia Huck Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Tested-by: Christian Borntraeger Acked-by: Paolo Bonzini --- include/hw/qdev-properties.h | 2 +- hw/core/qdev-properties.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index 0cfff1c..77538a8 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -53,7 +53,7 @@ extern PropertyInfo qdev_prop_arraylen; } #define DEFINE_PROP_BIT64(_name, _state, _field, _bit, _defval) { \ .name = (_name), \ - .info = &(qdev_prop_bit), \ + .info = &(qdev_prop_bit64), \ .bitnr = (_bit), \ .offset = offsetof(_state, _field) \ + type_check(uint64_t, typeof_field(_state, _field)), \ diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index e9e686f..04fd80a 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -130,7 +130,7 @@ PropertyInfo qdev_prop_bit = { static uint64_t qdev_get_prop_mask64(Property *prop) { - assert(prop->info == &qdev_prop_bit); + assert(prop->info == &qdev_prop_bit64); return 0x1ull << prop->bitnr; } -- MST