From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=36057 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PCzFL-0001l2-IV for qemu-devel@nongnu.org; Mon, 01 Nov 2010 14:36:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PCzFK-0004Q9-BI for qemu-devel@nongnu.org; Mon, 01 Nov 2010 14:36:43 -0400 Received: from mail-vw0-f45.google.com ([209.85.212.45]:37063) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PCzFK-0004Q4-7f for qemu-devel@nongnu.org; Mon, 01 Nov 2010 14:36:42 -0400 Received: by vws4 with SMTP id 4so4150429vws.4 for ; Mon, 01 Nov 2010 11:36:41 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1288623713-28062-32-git-send-email-agraf@suse.de> References: <1288623713-28062-1-git-send-email-agraf@suse.de> <1288623713-28062-32-git-send-email-agraf@suse.de> From: Blue Swirl Date: Mon, 1 Nov 2010 18:36:21 +0000 Message-ID: Subject: Re: [Qemu-devel] [PATCH 31/40] xenner: libxc emu: xenstore Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-devel Developers , Gerd Hoffmann On Mon, Nov 1, 2010 at 3:01 PM, Alexander Graf wrote: > Xenner emulates parts of libxc, so we can not use the real xen infrastruc= ture > when running xen pv guests without xen. > > This patch adds support for emulation of xenstored. > > Signed-off-by: Alexander Graf > --- > =C2=A0hw/xenner_guest_store.c | =C2=A0494 +++++++++++++++++++++++++++++++= ++ > =C2=A0hw/xenner_libxenstore.c | =C2=A0709 +++++++++++++++++++++++++++++++= ++++++++++++++++ > =C2=A02 files changed, 1203 insertions(+), 0 deletions(-) > =C2=A0create mode 100644 hw/xenner_guest_store.c > =C2=A0create mode 100644 hw/xenner_libxenstore.c > > diff --git a/hw/xenner_guest_store.c b/hw/xenner_guest_store.c > new file mode 100644 > index 0000000..c067275 > --- /dev/null > +++ b/hw/xenner_guest_store.c > @@ -0,0 +1,494 @@ > +/* > + * =C2=A0Copyright (C) 2005 Rusty Russell IBM Corporation > + * =C2=A0Copyright (C) Red Hat 2007 > + * =C2=A0Copyright (C) Novell Inc. 2010 > + * > + * =C2=A0Author(s): Gerd Hoffmann > + * =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Alexander Graf > + * > + * =C2=A0Xenner emulation -- guest interface to xenstore > + * > + * =C2=A0tools/xenstore/xenstored_domain.c equivalent, some code is from= there. > + * > + * =C2=A0This program is free software; you can redistribute it and/or m= odify > + * =C2=A0it under the terms of the GNU General Public License as publish= ed by > + * =C2=A0the Free Software Foundation; under version 2 of the License. > + * > + * =C2=A0This program is distributed in the hope that it will be useful, > + * =C2=A0but WITHOUT ANY WARRANTY; without even the implied warranty of > + * =C2=A0MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. =C2=A0See = the > + * =C2=A0GNU General Public License for more details. > + * > + * =C2=A0You should have received a copy of the GNU General Public Licen= se along > + * =C2=A0with this program; if not, see . > + */ > + > +#include "xen.h" > +#include "xen_interfaces.h" > +#include "xenner.h" > +#include "qemu-char.h" > + > +/* ------------------------------------------------------------- */ > + > +static target_phys_addr_t xen_store_mfn; > + > +static struct xs_handle *xs_guest; > +static char xs_buf[1024]; > +static char xs_len; > +static int debug =3D 0; > + > +static int evtchndev; > +static evtchn_port_t evtchnport; A lot of static state. Couldn't this be wrapped inside a structure, which is then passed around?