From: Keir Fraser Subject: Re: [PATCH] Add an ioctl interface for simple xenstore access Date: Sat, 18 Mar 2006 19:32:06 +0000 Message-ID: References: <87r750pupr.fsf@caffeine.beaverton.ibm.com> <20060318071405.GD23816@granada.merseine.nu> <01789afa761fc8e2b1f398148de7370c@cl.cam.ac.uk> <441C4B20.4000202@us.ibm.com> Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <441C4B20.4000202@us.ibm.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Anthony Liguori Cc: Dan Smith , Xen Developers List-Id: xen-devel@lists.xenproject.org On 18 Mar 2006, at 18:02, Anthony Liguori wrote: > We had discussed this in a previous thread and I thought you were okay > with this approach. The /proc/xen/xenbus interface requires full > parsing of the XenBus protocol. This requires libxenstore in domU. > Today, libxenstore is shipped with the rest of the tools package on > most distros. If one wants to write a Xen-aware application for a > domU, that brings in a pretty large number of unnecessary > dependencies. Also, for 32 bit management apps in a 64 bit > environment, it makes things very nasty (should we build a 32 bit and > 64 bit version of libxenstore? Is the protocol 32/64 bit safe?). > > Ideally, an app could just use a simple interface to /proc/xen/xenbus > to access XenStore. That solves all of the above problems elegantly. > An ioctl() interface seemed like the most obvious approach that > wouldn't break existing apps. Of course, any suggestion for a better > interface would be appreciated. Either way you're going to have an abstraction layer in your apps that hides the grotty details of how you access xenstore via /proc/xen/xenbus, whether it's via the read/write interface or via ioctls. That given, why not just statically link with libxenstore, or even include xs.h, xs.c and xs_lib.c in your applications? They're small, so no significant bloat, and LGPL, so no fear of GPL bleed into your management apps. The protocol is 32/64-bit safe. -- Keir