From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VK6Gm-0006Pp-B0 for qemu-devel@nongnu.org; Thu, 12 Sep 2013 08:45:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VK6Gi-0008Q6-Hk for qemu-devel@nongnu.org; Thu, 12 Sep 2013 08:45:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51518) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VK6Gi-0008Pf-9K for qemu-devel@nongnu.org; Thu, 12 Sep 2013 08:45:08 -0400 Date: Thu, 12 Sep 2013 13:44:59 +0100 From: "Daniel P. Berrange" Message-ID: <20130912124459.GJ18793@redhat.com> References: <1378906448-15834-1-git-send-email-famz@redhat.com> <1378906448-15834-5-git-send-email-famz@redhat.com> <20130911154841.GD2293@redhat.com> <5230BA69.1000202@twiddle.net> <20130912030232.GK9134@T430s.nay.redhat.com> <523152EB.5010505@msgid.tls.msk.ru> <5231ACA2.50500@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5231ACA2.50500@redhat.com> Subject: Re: [Qemu-devel] [PATCH v6 4/8] module: implement module loading function Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: peter.maydell@linaro.org, famz@redhat.com, Michael Tokarev , qemu-devel@nongnu.org, stefanha@redhat.com, pbonzini@redhat.com, vilanova@ac.upc.edu, Richard Henderson On Thu, Sep 12, 2013 at 05:59:30AM -0600, Eric Blake wrote: > On 09/11/2013 11:36 PM, Michael Tokarev wrote: > > > > A solution which I proposed at the very beginning -- to export > > a "hashed" init function from modules, and call it from the > > main executable. Like, instead of, say, qemu_module_init(), > > call qemu_module_init_0xdeadbeaf(), where 0xdeadbeaf is a > > hash of some build-dependent value. This should be enough > > to keep it going. > > And of course, since we store sources in git, you already have such a > hash value at your disposal: > $CC -DBUILD_HASH=$(git rev-parse HEAD) ... > coupled with > glue(qemu_module_init_, BUILD_HASH) > where the only trick is to figure out how to bake in a hash when > building from a released tarball rather than git. IMHO we want this to change any time you do './configure', so I would not tie this to git hash - we don't want all users of particular release tar.gz to have the same hash regardless of configure options. We want a situation where any time a distro builds an RPM or equiv, a new hash is used. So to me generating it in 'configure' seems like a reasonable place. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|