From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMyN0-0002Wq-9l for qemu-devel@nongnu.org; Wed, 14 Nov 2018 11:50:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMyMy-0002Eh-CF for qemu-devel@nongnu.org; Wed, 14 Nov 2018 11:50:26 -0500 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]:38229) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gMyMw-0001rD-Hw for qemu-devel@nongnu.org; Wed, 14 Nov 2018 11:50:24 -0500 Received: by mail-oi1-x242.google.com with SMTP id a77so8232782oii.5 for ; Wed, 14 Nov 2018 08:50:13 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <20181114132931.22624-1-marcandre.lureau@redhat.com> <16b78816-f2cc-a1e5-0d21-906fc2dbaa3d@redhat.com> From: Peter Maydell Date: Wed, 14 Nov 2018 16:49:51 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] vmstate: constify VMStateField List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= Cc: Thomas Huth , =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= , QEMU Developers , Fam Zheng , "Michael S. Tsirkin" , Aurelien Jarno , Cornelia Huck , Mark Cave-Ayland , "Dr. David Alan Gilbert" , Juan Quintela , "open list:S390" , "open list:ARM" , "open list:PowerPC" , Gerd Hoffmann , Aleksandar Markovic , Paolo Bonzini , Stafford Horne , Richard Henderson , Christian Borntraeger , Artyom Tarasenko , David Gibson On 14 November 2018 at 16:39, Philippe Mathieu-Daud=C3=A9 wrote: > Hi Thomas, > > On 14/11/18 17:29, Thomas Huth wrote: >> Please don't. For rationale, see: >> https://www.kernel.org/doc/html/v4.19/process/coding-style.html#typedefs > > > Thanks for the pointer, I am interested in understanding why not do that. > However in the link you pasted I don't see a rational about enforcing > constness, I understand that since this case doesn't match the 5 rules, w= e > should use 'struct VMStateField' directly and remove the typedef. QEMU's coding style is not the kernel's. In the kernel, yes, they prefer "struct foo". In QEMU we generally prefer to use a typedef for most structs. thanks -- PMM