WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] libxl: fix against if condition

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] libxl: fix against if condition
From: ZhouPeng <zpengxen@xxxxxxxxx>
Date: Sat, 16 Apr 2011 13:48:23 +0800
Cc: "Xen-Devel \(E-mail\)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 15 Apr 2011 22:48:53 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Hg21iCEr5HUvMiu0kU7vfG087lWdsEbTXJ/+CAgDtBo=; b=Y0PmwgT0cYKKNNpqSllUwvYQQEuDSKd4UxHs1I1NqKNQH+SCeF530e6fCDp4RGb0oQ 6EgvMue+RaBkPAv4J8a+6QfEf19XHqOJxfBdI60R4VGkCtWtgEMrNEpo+qzzMRaZ6xFr AihxvQjO865pXfMcVOk+nCZyVFRWI4PUF/gyM=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=LXEh7UMIK+PjaZhkcC3mGjynSrZegRwDuaEa29w6BvEavMlkahYdPJWg2OPUs+Frve Gi4RPA0KDz2zS5zui/+1Xkq8ed40Zyoz/AFwf9TCkEQUvaJnRMmlLuZKCUf0EFJ9SSOY dFFotGbjWl4pzVRHXx+6/bNGMZjoG8qZqQhMY=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19880.23432.320713.439637@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <BANLkTikM2WidQ4+Xcp1Cen+VemBKCTbyUg@xxxxxxxxxxxxxx> <19880.23432.320713.439637@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

2011/4/15 Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
ZhouPeng writes ("[Xen-devel] [PATCH] libxl: fix against if condition"):
> Signed-off-by: Zhou Peng <zhoupeng@xxxxxxxxxxxxxxx>
>
> --- a/tools/libxl/libxl_dm.c    Wed Apr 13 14:08:41 2011 +0800
> +++ b/tools/libxl/libxl_dm.c    Wed Apr 13 14:20:37 2011 +0800
> @@ -197,7 +197,7 @@ static char ** libxl_build_device_model_
>          int display = 0;
>          const char *listen = "127.0.0.1";
>
> -        if (info->vncpasswd && info->vncpasswd[0]) {
> +        if (info->vncpasswd && !info->vncpasswd[0]) {
>              assert(!"missing code for supplying vnc password to qemu");
  assert( ) here is missleading, I think.
  In my understanding, assert is offten used to help program debuging,
  telling user the program is runing in exception here and abort it.
  So, I just think "missing code" means "missing passwd code", which tell user must supply an non-empty vnc passwd,
  if vncpasswd is used in vm cfg file.
  It's hard for me to give assert() an relationship with a comment telling something in development, :)
  I think an comment like TODO may be more clear,

  Thanks.
>          }
>          flexarray_append(dm_args, "-vnc");

Looking just at the diff there, I think the original code is correct.
That is, the assert trips when:
 * a password is supplied (info->vncpasswd != NULL)
 * the password is nonemtpy (strlen(info->vncpasswd) > 0
     which is the same as !!info->vncpasswd[0]
 * we're using a new qemu for which this code has not been implemented

That the failure manifests as an assert might be argued to be
unfortunate, but this is still code under development...

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel



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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>