From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sasha Levin Subject: Re: [PATCH 5/5 V2] kvm tools: Initialize and use VESA and VNC Date: Tue, 24 May 2011 14:30:09 +0300 Message-ID: <1306236609.21475.1.camel@lappy> References: <1306149553-26793-1-git-send-email-levinsasha928@gmail.com> <1306149553-26793-5-git-send-email-levinsasha928@gmail.com> <20110523113824.GE4042@elte.hu> <4DDB6E55.8080408@redhat.com> <20110524085024.GA31453@elte.hu> <4DDB75EC.7000300@redhat.com> <4DDB9510.8030501@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Paolo Bonzini , Ingo Molnar , john@jfloren.net, kvm@vger.kernel.org, asias.hejun@gmail.com, gorcunov@gmail.com, prasadjoshi124@gmail.com To: Pekka Enberg Return-path: Received: from mail-wy0-f174.google.com ([74.125.82.174]:50278 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755454Ab1EXLaY (ORCPT ); Tue, 24 May 2011 07:30:24 -0400 Received: by wya21 with SMTP id 21so4889123wya.19 for ; Tue, 24 May 2011 04:30:23 -0700 (PDT) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Tue, 2011-05-24 at 14:26 +0300, Pekka Enberg wrote: > Hi Avi, > > On Tue, May 24, 2011 at 2:22 PM, Avi Kivity wrote: > >> The point is to follow Linux kernel conventions and idioms (and share > >> code) as much as possible so it's familiar to devs who are already > >> working on the kernel. That's why section tricks seem more appropriate > >> than using constructor to me. Or is there some technical advantage to > >> using constructors? > > > > You get to reuse infrastructure that's already there. > > > > Things like using sections and s/uint64_t/u64/ look anti-reuse to me. > > Userspace isn't the kernel, for better or for worse. > > Not really. The type thing is pretty much required once you start > using kernel code (as we learned the hard way). > > Btw, constructor attribute doesn't really seem like a good fit for > "late_initcall" type of thing: > > The constructor attribute causes the function to be called > automatically before execution enters main () You could add a small constructor function that'll add a pointer to the real initialization function to a list which will get called after we get everything initialized and ready. -- Sasha.