From mboxrd@z Thu Jan 1 00:00:00 1970 From: ZhouPeng Subject: Re: [PATCH]tools/libxl: fix a bug in libxl__build_device_model_args_new. info->vncpasswd can't be empty if info->vncpasswd != NULL Date: Fri, 15 Apr 2011 18:02:48 +0800 Message-ID: References: <4DA801C4.5060102@amd.com> <4DA811F5.3080106@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1091387892==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Christoph Egger Cc: "xen-devel@lists.xensource.com" , "ian.campbell@citrix.com" List-Id: xen-devel@lists.xenproject.org --===============1091387892== Content-Type: multipart/alternative; boundary=bcaec521574dec1d6d04a0f224ef --bcaec521574dec1d6d04a0f224ef Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable This patch may be more readable =3D=3D Signed-off-by: Zhou Peng tools/libxl: fix a bug in libxl__build_device_model_args_new. info->vncpasswd can't be empty if info->vncpasswd !=3D NULL diff -r 3f00c5faa12a tools/libxl/libxl_dm.c --- a/tools/libxl/libxl_dm.c Wed Apr 13 16:10:26 2011 +0100 +++ b/tools/libxl/libxl_dm.c Fri Apr 15 09:45:43 2011 +0800 @@ -209,7 +209,7 @@ static char ** libxl__build_device_model int display =3D 0; const char *listen =3D "127.0.0.1"; - if (info->vncpasswd && info->vncpasswd[0]) { + if (info->vncpasswd && (info->vncpasswd[0] =3D=3D '\0')) { assert(!"missing code for supplying vnc password to qemu"); } flexarray_append(dm_args, "-vnc"); 2011/4/15 ZhouPeng > > > 2011/4/15 Christoph Egger > >> On 04/15/11 11:36, ZhouPeng wrote: >> >>> >>> >>> 2011/4/15 Christoph Egger>> Christoph.Egger@amd.com>> >>> >>> On 04/15/11 10:33, ZhouPeng wrote: >>> Signed-off-by: Zhou Peng>> zhoupeng@nfs.iscas.ac.cn>> >>> >>> >>> tools/libxl: fix a bug in libxl__build_device_model_args_new. >>> info->vncpasswd can't be empty if info->vncpasswd !=3D NULL >>> >>> >>> NACK! This can info->vncpasswd[0] contains '\0' if you have >>> >>> >>> vncpasswd=3D'' >>> >>> in the guest config file. >>> >>> " if (info->vncpasswd&& info->vncpasswd[0]) =93 can >>> vncpasswd=3D'' in guest cfg file, when using upstream-qemu-xen >>> and block vncpasswd=3D'passwd' >>> Can it be reasonable? >>> >>> >> >> Does that mean upstream qemu-xen and in-tree qemu-xen behave differently= ? >> > if (new_qemu =3D=3D 1) { > return libxl__build_device_model_args_new(gc, info, disks, > num_disks, vifs, num_vifs); > } else { > return libxl__build_device_model_args_old(gc, info, disks, > num_disks, vifs, num_vifs); > } > > >> Christoph >> >> >> >> -- >> ---to satisfy European Law for business letters: >> Advanced Micro Devices GmbH >> Einsteinring 24, 85689 Dornach b. Muenchen >> Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd >> Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen >> Registergericht Muenchen, HRB Nr. 43632 >> >> > > > -- > Zhou Peng > Operating System Technology Group > Institute of Software, the Chinese Academy of Sciences (ISCAS) > > --=20 Zhou Peng Operating System Technology Group Institute of Software, the Chinese Academy of Sciences (ISCAS) --bcaec521574dec1d6d04a0f224ef Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable This patch may be more readable
=3D=3D
Signed-off-by: Zhou Peng <<= a href=3D"mailto:zhoupeng@nfs.iscas.ac.cn">zhoupeng@nfs.iscas.ac.cn>=

tools/libxl: fix a bug in libxl__build_device_model_args_new. info-= >vncpasswd can't be empty if info->vncpasswd !=3D NULL

diff -r 3f00c5faa12a tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_= dm.c=A0=A0=A0 Wed Apr 13 16:10:26 2011 +0100
+++ b/tools/libxl/libxl_dm.= c=A0=A0=A0 Fri Apr 15 09:45:43 2011 +0800
@@ -209,7 +209,7 @@ static cha= r ** libxl__build_device_model
=A0=A0=A0=A0=A0=A0=A0=A0 int display =3D 0;
=A0=A0=A0=A0=A0=A0=A0=A0 con= st char *listen =3D "127.0.0.1";
=A0
-=A0=A0=A0=A0=A0=A0=A0= if (info->vncpasswd && info->vncpasswd[0]) {
+=A0=A0=A0=A0=A0=A0=A0 if (info->vncpasswd &= amp;& (info->vncpasswd[0] =3D=3D '\0')) {
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 assert(!"missing code for supplyi= ng vnc password to qemu");
=A0=A0=A0=A0=A0=A0=A0=A0 }
=A0=A0=A0= =A0=A0=A0=A0=A0 flexarray_append(dm_args, "-vnc");

2011/4/15 ZhouPeng <zpengxen@gmail.com>


2011/4/15 Christoph Egger <Chris= toph.Egger@amd.com>
On 04/15/11 11:36, ZhouPeng wrote:


2011/4/15 Christoph Egger<Christoph.Egger@amd.com<mailto:Christoph.Egger@amd.com>><= div>
On 04/15/11 10:33, ZhouPeng wrote:
Signed-off-by: Zhou Peng<zhoupeng@nfs.iscas.ac.cn<mailto:zhoupeng@nfs.iscas.ac.cn>&g= t;


tools/libxl: fix a bug in libxl__build_device_model_args_new. info->vncp= asswd can't be empty if info->vncpasswd !=3D NULL


NACK! =A0This can info->vncpasswd[0] contains '\0' if you have

=A0 vncpasswd=3D''

in the guest config file.

=A0" if (info->vncpasswd&& =A0 info->vncpasswd[0]) =93 = can
=A0 vncpasswd=3D'' in guest cfg file, when using upstream-qemu-xen=
=A0 and block vncpasswd=3D'passwd'
=A0 Can it be reasonable?



Does that mean upstream qemu-xen and in-tree qemu-xen behave differently?
=A0 if (new_qemu = =3D=3D 1) {
=A0=A0=A0=A0=A0=A0=A0 return libxl__build_device_model_args_= new(gc, info, disks, num_disks, vifs, num_vifs);
=A0=A0=A0 } else {
=A0=A0=A0=A0=A0=A0=A0 return libxl__build_device_mode= l_args_old(gc, info, disks, num_disks, vifs, num_vifs);
=A0=A0=A0 }
= =A0
Christoph



--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632




--
=
Zhou Peng
Operating System Technology Group=
Institute of Software, the Chinese Academy of Sciences (ISCAS)




--
Zhou PengOperating System Technology Group
Institute of Software, the Chinese A= cademy of Sciences (ISCAS)

--bcaec521574dec1d6d04a0f224ef-- --===============1091387892== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1091387892==--