From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MQLhR-0003CX-Mg for qemu-devel@nongnu.org; Mon, 13 Jul 2009 09:36:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MQLhK-0003Ad-AF for qemu-devel@nongnu.org; Mon, 13 Jul 2009 09:36:06 -0400 Received: from [199.232.76.173] (port=56423 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MQLhI-0003AO-Li for qemu-devel@nongnu.org; Mon, 13 Jul 2009 09:36:00 -0400 Received: from mx2.redhat.com ([66.187.237.31]:53117) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MQLhI-0001cq-2K for qemu-devel@nongnu.org; Mon, 13 Jul 2009 09:36:00 -0400 From: Gerd Hoffmann Date: Mon, 13 Jul 2009 15:33:49 +0200 Message-Id: <1247492031-16104-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [RfC PATCH 0/2] qdev/prop: type checking. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: paul@codesourcery.com, Gerd Hoffmann Hi, Two patches to improve qdev attribute type checking. Goes on top of the qdev bits in anthonys patch queue and the other qdev/prop patches posted today. The first adds a type field to PropertyInfo and switches the qdev_prop_set_*() functions from size checkinf to type checking. The functions are also changed to not return an error and abort() instead. The second helps a bunch of helper macros to help creating property declarations and converts pci.c as example. I'm not that happy with that one yet. Especially I'd like to check somehow that typeof(_state->_field) == _type. But couldn't figure out a way to do so. As we are setting up static data structures we are quite limited in what we can do here. The typechecking trick used by the linux kernel min/max macros can't be used for example. comments & ideas are welcome, Gerd