From: Alexander Graf Subject: Re: [PATCH v4] xen_console: support the new extended xenstore protocol Date: Thu, 30 Jun 2011 19:12:25 +0200 Message-ID: References: <1309453581-27110-1-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <1309453581-27110-1-git-send-email-stefano.stabellini@eu.citrix.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: stefano.stabellini@eu.citrix.comstefano.stabellini@eu.citrix.com Cc: peter.maydell@linaro.org, xen-devel@lists.xensource.com, qemu-devel@nongnu.org List-Id: xen-devel@lists.xenproject.org On 30.06.2011, at 19:06, = wrote: > From: Stefano Stabellini >=20 > Since CS 21994 on xen-unstable.hg and CS > 466608f3a32e1f9808acdf832a5843af37e5fcec on qemu-xen-unstable.git, few > changes have been introduced to the PV console xenstore protocol, as > described by the document docs/misc/console.txt under xen-unstable.hg. >=20 > =46rom the Qemu point of view, very few modifications are needed to > correctly support the protocol: read from xenstore the "output" node > that tell us what the output of the PV console is going to be. > In case the output is a tty, write to xenstore the device name. >=20 > Changes in v2: >=20 > - fix error paths: free malloc'ed strings and close the xenstore > connection before returning; >=20 > - remove useless snprintf in xenstore_store_pv_console_info if i =3D=3D = 0. >=20 > Changes in v3: >=20 > - replace xs_daemon_open/xs_daemon_close with xs_open/xs_close. >=20 > Changes in v4: >=20 > - add a compatibility implementation of xs_open/xs_close. >=20 > Signed-off-by: Stefano Stabellini > --- > hw/xen.h | 1 + > hw/xen_common.h | 11 +++++++++ > hw/xen_console.c | 16 +++++++++----- > xen-all.c | 60 = ++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 82 insertions(+), 6 deletions(-) >=20 > diff --git a/hw/xen.h b/hw/xen.h > index d435ca0..dad0ca0 100644 > --- a/hw/xen.h > +++ b/hw/xen.h > @@ -50,6 +50,7 @@ qemu_irq *xen_interrupt_controller_init(void); > int xen_init(void); > int xen_hvm_init(void); > void xen_vcpu_init(void); > +void xenstore_store_pv_console_info(int i, struct CharDriverState = *chr); >=20 > #if defined(NEED_CPU_H) && !defined(CONFIG_USER_ONLY) > void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size); > diff --git a/hw/xen_common.h b/hw/xen_common.h > index 2c79af6..65e6b00 100644 > --- a/hw/xen_common.h > +++ b/hw/xen_common.h > @@ -85,6 +85,17 @@ static inline int xc_domain_add_to_physmap(int = xc_handle, uint32_t domid, > return xc_memory_op(xc_handle, XENMEM_add_to_physmap, &xatp); > } >=20 > +static inline struct xs_handle *xs_open(unsigned long flags) > +{ > + return xs_daemon_open(); > +} > + > +static inline void xs_close(struct xs_handle *xsh) > +{ > + if (xsh !=3D NULL) > + xs_daemon_close(xsh); checkpatch please :) Alex