From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJP7n-0002i1-ER for qemu-devel@nongnu.org; Mon, 09 May 2011 07:59:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJP7m-0005c4-Nz for qemu-devel@nongnu.org; Mon, 09 May 2011 07:59:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJP7m-0005bv-F3 for qemu-devel@nongnu.org; Mon, 09 May 2011 07:59:42 -0400 Message-ID: <4DC7D70F.3030103@redhat.com> Date: Mon, 09 May 2011 13:59:11 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <1304934694-13432-1-git-send-email-armbru@redhat.com> <1304934694-13432-2-git-send-email-armbru@redhat.com> In-Reply-To: <1304934694-13432-2-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 1/5] ide: Split qdev "ide-drive" into "ide-hd" and "ide-cd" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: kwolf@redhat.com, qemu-devel@nongnu.org, hch@lst.de Hi, > +#define DEFINE_IDE_DEV_PROPERTIES() \ > + DEFINE_PROP_UINT32("unit", IDEDrive, dev.unit, -1), \ > + DEFINE_BLOCK_PROPERTIES(IDEDrive, dev.conf), \ > + DEFINE_PROP_STRING("ver", IDEDrive, dev.version), \ > + DEFINE_PROP_STRING("serial", IDEDrive, dev.serial) This can also be done this way: static Property ide_properties[] = { DEFINE_PROP_UINT32("unit", IDEDrive, dev.unit, -1), [ ... ] DEFINE_PROP_END_OF_LIST(), }; > +static IDEDeviceInfo ide_dev_info[] = { > + { > + .qdev.name = "ide-hd", > + .qdev.fw_name = "drive", > + .qdev.desc = "virtual IDE disk", > + .qdev.size = sizeof(IDEDrive), > + .init = ide_hd_initfn, .qdev.props = ide_properties, Works only as long as all devices have exactly the same set (i.e. for scsi it wouldn't work as not all devices have the "removable" property). I tend to like this more than the #define. YMMV, matter of taste. cheers, Gerd