WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] PV drivers for HVM guests

To: Muli Ben-Yehuda <muli@xxxxxxxxxx>
Subject: Re: [Xen-devel] PV drivers for HVM guests
From: Gerd Hoffmann <kraxel@xxxxxxx>
Date: Wed, 04 Oct 2006 13:02:59 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Ky Srinivasan <ksrinivasan@xxxxxxxxxx>
Delivery-date: Wed, 04 Oct 2006 04:03:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20061004081551.GC6274@xxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <45229025.E57C.0030.0@xxxxxxxxxx> <C14927CD.2084%Keir.Fraser@xxxxxxxxxxxx> <20061004081551.GC6274@xxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.7 (X11/20060911)
Muli Ben-Yehuda wrote:
>> A shim layer (i.e., a set of compat macros) that avoids ifdef'ing
>> the core driver code is definitely the way to go.
> 
> FWIW, neither option has a chance of being accepted upstream.

Exactly thats why a shim layer is the way to go (if possible, doesn't
work for all changes but for most).  Did that that quite some time while
maintaining the v4l subsystem.  Making driver source code use the
2.6.latest conventions and have some compat.h header file full of stuff
like this ...

  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,xx)
  # define foo gryyz
  #endif

or (better if possible as it catches distro backports, which does happen
now and then for compiling recent drivers on old distro kernels).

  #ifndef bar
  # define bar xyzzy
  #endif

nicely separates out the compat bits.  It makes the code more readable
and also is less work when submitting code upstream.

cheers,

  Gerd

-- 
Gerd Hoffmann <kraxel@xxxxxxx>
http://www.suse.de/~kraxel/julika-dora.jpeg

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel