From mboxrd@z Thu Jan 1 00:00:00 1970 From: ZhouPeng Subject: Re: [PATCH] tools/libxl: prepare vnc options for dm_args in libxl__build_device_model_args_new Date: Thu, 21 Apr 2011 09:35:07 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: Stefano Stabellini Cc: "Xen-Devel (E-mail)" , Ian Jackson List-Id: xen-devel@lists.xenproject.org Thanks. 2011/4/20 Stefano Stabellini : > On Wed, 20 Apr 2011, ZhouPeng wrote: >> This pacth clean up vnc options preparing code for xen-upstream-qemu. >> Add password option which allows you to use vncpasswd auth by xl. >> >> >> Signed-off-by: Zhou Peng >> >> tools/libxl: prepare vnc options for dm_args in >> libxl__build_device_model_args_new > > > The patch looks OK to me. > Thanks, > > Stefano > >> >> diff -r 569abaf2cc12 tools/libxl/libxl_dm.c >> --- a/tools/libxl/libxl_dm.c =A0Tue Apr 19 13:17:14 2011 +0800 >> +++ b/tools/libxl/libxl_dm.c =A0Wed Apr 20 13:47:42 2011 +0800 >> @@ -208,11 +208,7 @@ static char ** libxl__build_device_model >> =A0 =A0 =A0if (info->vnc || info->vncdisplay || info->vnclisten || info-= >vncunused) { >> =A0 =A0 =A0 =A0 =A0int display =3D 0; >> =A0 =A0 =A0 =A0 =A0const char *listen =3D "127.0.0.1"; >> - >> - =A0 =A0 =A0 =A0if (info->vncpasswd && info->vncpasswd[0]) { >> - =A0 =A0 =A0 =A0 =A0 =A0assert(!"missing code for supplying vnc passwor= d to qemu"); >> - =A0 =A0 =A0 =A0} >> - =A0 =A0 =A0 =A0flexarray_append(dm_args, "-vnc"); >> + =A0 =A0 =A0 =A0char *vncoptions =3D NULL; >> >> =A0 =A0 =A0 =A0 =A0if (info->vncdisplay) { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0display =3D info->vncdisplay; >> @@ -224,13 +220,17 @@ static char ** libxl__build_device_model >> =A0 =A0 =A0 =A0 =A0} >> >> =A0 =A0 =A0 =A0 =A0if (strchr(listen, ':') !=3D NULL) >> - =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl__sprintf(gc, "%s%s", list= en, >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0info->vncunused ? ",to= =3D99" : "")); >> + =A0 =A0 =A0 =A0 =A0 =A0vncoptions =3D libxl__sprintf(gc, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "%s%s", listen= , info->vncunused ? ",to=3D99" : ""); >> =A0 =A0 =A0 =A0 =A0else >> - =A0 =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0libxl__sprintf(gc, "%s:%d%s", l= isten, display, >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0info->vncunused ? ",to= =3D99" : "")); >> + =A0 =A0 =A0 =A0 =A0 =A0vncoptions =3D libxl__sprintf(gc, "%s:%d%s", li= sten, display, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0info->vncunused ? ",to=3D99" : ""); >> + >> + =A0 =A0 =A0 =A0if (info->vncpasswd && info->vncpasswd[0]) >> + =A0 =A0 =A0 =A0 =A0 =A0vncoptions =3D libxl__sprintf(gc, "%s,password"= , vncoptions); >> + >> + =A0 =A0 =A0 =A0flexarray_append(dm_args, "-vnc"); >> + =A0 =A0 =A0 =A0flexarray_append(dm_args, vncoptions); >> =A0 =A0 =A0} >> =A0 =A0 =A0if (info->sdl) { >> =A0 =A0 =A0 =A0 =A0flexarray_append(dm_args, "-sdl"); > > --=20 Zhou Peng Operating System Technology Group Institute of Software, the Chinese Academy of Sciences (ISCAS)