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/
Home Products Support Community News


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

To: ZhouPeng <zpengxen@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] libxl: fix against if condition
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Fri, 15 Apr 2011 15:51:52 +0100
Cc: "Xen-Devel \(E-mail\)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 15 Apr 2011 07:52:31 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <BANLkTikM2WidQ4+Xcp1Cen+VemBKCTbyUg@xxxxxxxxxxxxxx>
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>
Newsgroups: chiark.mail.xen.devel
References: <BANLkTikM2WidQ4+Xcp1Cen+VemBKCTbyUg@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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 = "";
> -        if (info->vncpasswd && info->vncpasswd[0]) {
> +        if (info->vncpasswd && !info->vncpasswd[0]) {
>              assert(!"missing code for supplying vnc password to qemu");
>          }
>          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...


Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>