From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38658) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtKLh-0005Bv-0F for qemu-devel@nongnu.org; Thu, 10 Jan 2013 10:47:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtKLf-0004iR-MM for qemu-devel@nongnu.org; Thu, 10 Jan 2013 10:47:20 -0500 Received: from cantor2.suse.de ([195.135.220.15]:47895 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtKLf-0004iL-CL for qemu-devel@nongnu.org; Thu, 10 Jan 2013 10:47:19 -0500 Message-ID: <50EEE281.8000200@suse.de> Date: Thu, 10 Jan 2013 16:47:13 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1357831148-17624-1-git-send-email-afaerber@suse.de> In-Reply-To: <1357831148-17624-1-git-send-email-afaerber@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] Make all static TypeInfos const List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: blauwirbel@gmail.com, Stefan Weil , Gerd Hoffmann , anthony@codemonkey.ws, =?UTF-8?B?S09OUkFEIEZyw6k=?= =?UTF-8?B?ZMOpcmlj?= Am 10.01.2013 16:19, schrieb Andreas F=C3=A4rber: > Since 39bffca2030950ef6efe57c2fac8327a45ae1015 (qdev: register all > types natively through QEMU Object Model), TypeInfo as used in > the common, non-iterative pattern is no longer amended with information > and should therefore be const. >=20 > Fix the documented QOM examples: >=20 > sed -i 's/static TypeInfo/static const TypeInfo/g' include/qom/object.= h >=20 > Since frequently the wrong examples are being copied by contributors of > new devices, fix all types in the tree: >=20 > sed -i 's/^static TypeInfo/static const TypeInfo/g' */*.c > sed -i 's/^static TypeInfo/static const TypeInfo/g' */*/*.c >=20 > This also avoids to piggy-back these changes onto real functional > changes or other refactorings. >=20 > Signed-off-by: Andreas F=C3=A4rber > --- Note that I have compile-tested this, which should've caught any attempt to modify a const TypeInfo. And I have reviewed the patch to not do any accidental refactoring. While this is close to a touch-all patch, those lines are rarely touched, so mainly QOM'ification patches touching .name would be affected, i.e. at this time Fred's and mine. Previous art are patches by Stefan W. to make MemoryRegionOps const. After this patch, two occurrences of non-const static TypeInfo remain, inside qom/object.c for Object and Interface respectively. Plus non-static, non-const TypeInfos in eepro100, EHCI, UHCI and CPUs. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg