From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfsEa-0004gH-QL for qemu-devel@nongnu.org; Tue, 04 Dec 2012 08:08:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TfsEU-0006fT-On for qemu-devel@nongnu.org; Tue, 04 Dec 2012 08:08:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfsEU-0006fG-He for qemu-devel@nongnu.org; Tue, 04 Dec 2012 08:08:18 -0500 Message-ID: <50BDF5BD.4090703@redhat.com> Date: Tue, 04 Dec 2012 14:08:13 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1354303642-4283-1-git-send-email-ehabkost@redhat.com> <1354303642-4283-7-git-send-email-ehabkost@redhat.com> <20121203224956.04490ad7@thinkpad.mammed.net> <20121204124942.GA4986@otherpad.lan.raisama.net> In-Reply-To: <20121204124942.GA4986@otherpad.lan.raisama.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 06/10] qdev: add stubs for vmstate register/unregister functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Igor Mammedov , qemu-devel@nongnu.org, Anthony Liguori , =?ISO-8859-1?Q?Andreas_F=E4rber?= Il 04/12/2012 13:49, Eduardo Habkost ha scritto: > Well, the commit description says that "if you place each function in a > separate source file, object files for unused functions will not be > taken in", I don't see it as a requirement. In this case, pulling both > stubs is a feature: if a binary ends up using the vmstate_register stub, > we really want it to use the vmstate_unregister stub as well. I think Eduardo is right. In the beginning I was thinking more of having one function per file, but then in some cases the functions are clearly related. For example, if you have monitor_printf/monitor_vprintf, you have two choices: - put both of them in the same file, as done here for vmstate. - put each in a separate file. In this case, it doesn't really make sense to implement only one, so the monitor_printf stub should use va_start/va_end to forward to monitor_vprintf. In the second case, the monitor_printf stub is not even a stub anymore, because the same function will always be usable. This makes it much better to put both of them in the same file, IMHO. Paolo