From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [RFC PATCH v3] os-android: Add support to android platform Date: Mon, 28 Sep 2015 13:40:38 +0200 Message-ID: <56092736.5050908@redhat.com> References: <1443100877-8938-1-git-send-email-houcheng@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit To: Houcheng Lin , qemu-devel@nongnu.org, famz@redhat.com, alex.bennee@linaro.org, linhaocheng@itri.org.tw, peter.maydell@linaro.org, kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:42457 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932876AbbI1Lkn (ORCPT ); Mon, 28 Sep 2015 07:40:43 -0400 In-Reply-To: <1443100877-8938-1-git-send-email-houcheng@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On 24/09/2015 15:21, Houcheng Lin wrote: > +if [ "$android" = "yes" ] ; then > + LIBS="-lglib-2.0 -lgthread-2.0 -lz -lpixman-1 -lintl -liconv -lc $LIBS" > + libs_qga="-lglib-2.0 -lgthread-2.0 -lz -lpixman-1 -lintl -liconv -lc" > +fi This change should not be necessary. > +#define getdtablesize qemu_getdtablesize Please instead replace all occurrences of getdtablesize with qemu_getdtablesize. > > +#ifdef CONFIG_ANDROID > +#include "sysemu/os-android.h" > +#endif > + Please replace this with #include #ifndef IOV_MAX #define IOV_MAX 1024 #endif and get rid of os-android.h. > > +#if defined(CONFIG_ANDROID) > + char pty_buf[PATH_MAX]; > + #define ptsname(fd) pty_buf > +#endif > const char *slave; > int mfd = -1, sfd = -1; > > @@ -67,17 +72,21 @@ static int openpty(int *amaster, int *aslave, char *name, > > if (grantpt(mfd) == -1 || unlockpt(mfd) == -1) > goto err; > - > +#if defined(CONFIG_ANDROID) > + if (ptsname_r(mfd, pty_buf, PATH_MAX) < 0) > + goto err; > +#endif > if ((slave = ptsname(mfd)) == NULL) > goto err; > Better: #if defined(CONFIG_ANDROID) char slave[PATH_MAX]; #else const char *slave; #endif ... #if defined(CONFIG_ANDROID) if (ptsname_r(mfd, slave, PATH_MAX) < 0) goto err; #else if ((slave = ptsname(mfd)) == NULL) goto err; #endif From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgWnX-0001a5-Ti for qemu-devel@nongnu.org; Mon, 28 Sep 2015 07:40:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgWnT-0001XW-GT for qemu-devel@nongnu.org; Mon, 28 Sep 2015 07:40:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42065) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgWnT-0001WX-AE for qemu-devel@nongnu.org; Mon, 28 Sep 2015 07:40:43 -0400 References: <1443100877-8938-1-git-send-email-houcheng@gmail.com> From: Paolo Bonzini Message-ID: <56092736.5050908@redhat.com> Date: Mon, 28 Sep 2015 13:40:38 +0200 MIME-Version: 1.0 In-Reply-To: <1443100877-8938-1-git-send-email-houcheng@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH v3] os-android: Add support to android platform List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Houcheng Lin , qemu-devel@nongnu.org, famz@redhat.com, alex.bennee@linaro.org, linhaocheng@itri.org.tw, peter.maydell@linaro.org, kvm@vger.kernel.org On 24/09/2015 15:21, Houcheng Lin wrote: > +if [ "$android" =3D "yes" ] ; then > + LIBS=3D"-lglib-2.0 -lgthread-2.0 -lz -lpixman-1 -lintl -liconv -lc $= LIBS" > + libs_qga=3D"-lglib-2.0 -lgthread-2.0 -lz -lpixman-1 -lintl -liconv -= lc" > +fi This change should not be necessary. > +#define getdtablesize qemu_getdtablesize Please instead replace all occurrences of getdtablesize with qemu_getdtablesize. >=20 > +#ifdef CONFIG_ANDROID > +#include "sysemu/os-android.h" > +#endif > + Please replace this with #include #ifndef IOV_MAX #define IOV_MAX 1024 #endif and get rid of os-android.h. >=20 > +#if defined(CONFIG_ANDROID) > + char pty_buf[PATH_MAX]; > + #define ptsname(fd) pty_buf > +#endif > const char *slave; > int mfd =3D -1, sfd =3D -1; > =20 > @@ -67,17 +72,21 @@ static int openpty(int *amaster, int *aslave, char = *name, > =20 > if (grantpt(mfd) =3D=3D -1 || unlockpt(mfd) =3D=3D -1) > goto err; > - > +#if defined(CONFIG_ANDROID) > + if (ptsname_r(mfd, pty_buf, PATH_MAX) < 0) > + goto err; > +#endif > if ((slave =3D ptsname(mfd)) =3D=3D NULL) > goto err; > =20 Better: #if defined(CONFIG_ANDROID) char slave[PATH_MAX]; #else const char *slave; #endif ... #if defined(CONFIG_ANDROID) if (ptsname_r(mfd, slave, PATH_MAX) < 0) goto err; #else if ((slave =3D ptsname(mfd)) =3D=3D NULL) goto err; #endif