From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbXa6-0007sE-49 for qemu-devel@nongnu.org; Fri, 16 Dec 2011 08:12:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RbXa0-0002ga-Ca for qemu-devel@nongnu.org; Fri, 16 Dec 2011 08:12:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:13946) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbXa0-0002gT-3e for qemu-devel@nongnu.org; Fri, 16 Dec 2011 08:12:04 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pBGDC2vN001001 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 16 Dec 2011 08:12:02 -0500 Message-ID: <4EEB439F.7010601@redhat.com> Date: Fri, 16 Dec 2011 14:11:59 +0100 From: Gerd Hoffmann MIME-Version: 1.0 References: <1324036918-2405-1-git-send-email-pbonzini@redhat.com> <1324036918-2405-7-git-send-email-pbonzini@redhat.com> In-Reply-To: <1324036918-2405-7-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 6/8] qom: introduce get/set methods for Property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, qemu-devel@nongnu.org Hi, > PropertyInfo qdev_prop_drive = { > .name = "drive", > .type = PROP_TYPE_DRIVE, > .size = sizeof(BlockDriverState *), > .parse = parse_drive, > .print = print_drive, > + .get = get_generic, > + .set = set_generic, > .free = free_drive, > }; > > @@ -407,6 +687,8 @@ PropertyInfo qdev_prop_chr = { > .size = sizeof(CharDriverState*), > .parse = parse_chr, > .print = print_chr, > + .get = get_generic, > + .set = set_generic, > }; > > /* --- netdev device --- */ > @@ -441,6 +723,8 @@ PropertyInfo qdev_prop_netdev = { > .size = sizeof(VLANClientState*), > .parse = parse_netdev, > .print = print_netdev, > + .get = get_generic, > + .set = set_generic, > }; > PropertyInfo qdev_prop_vlan = { > .name = "vlan", > .type = PROP_TYPE_VLAN, > .size = sizeof(VLANClientState*), > .parse = parse_vlan, > .print = print_vlan, > + .get = get_vlan, > + .set = set_vlan, > }; > > /* --- pointer --- */ > @@ -531,6 +860,8 @@ PropertyInfo qdev_prop_macaddr = { > .size = sizeof(MACAddr), > .parse = parse_mac, > .print = print_mac, > + .get = get_generic, > + .set = set_generic, > }; > > PropertyInfo qdev_prop_pci_devfn = { > .name = "pci-devfn", > .type = PROP_TYPE_UINT32, > .size = sizeof(uint32_t), > .parse = parse_pci_devfn, > .print = print_pci_devfn, > + .get = get_pci_devfn, > + .set = set_generic, > }; I think we should not touch these. First it doesn't buy us much as we are using the old parse/print functions for the visitor-based access, which doesn't look like a good idea to me. Also they will not stay but will be converted to child<> and link<>, so I think it is better to keep the old stuff in the legacy<> namespace. Agree on the bit/bool/int types. Although we maybe should apply some care to integer bus properties, some of them are used for addressing and will most likely replaced by child<> and link<> too. cheers, Gerd