xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH]tools/libxl: fix a bug in libxl__build_device_model_args_new. info->vncpasswd can't be empty if info->vncpasswd != NULL
  2011-04-15  8:33 [PATCH]tools/libxl: fix a bug in libxl__build_device_model_args_new. info->vncpasswd can't be empty if info->vncpasswd != NULL ZhouPeng
@ 2011-04-15  8:28 ` Christoph Egger
  2011-04-15  8:42   ` Ian Campbell
  2011-04-15  9:36   ` ZhouPeng
  0 siblings, 2 replies; 8+ messages in thread
From: Christoph Egger @ 2011-04-15  8:28 UTC (permalink / raw)
  To: xen-devel

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 != NULL
>

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


    vncpasswd=''

in the guest config file.

Christoph


> 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 = 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");
>           }
>           flexarray_append(dm_args, "-vnc");
>
> --
> Zhou Peng
> Operating System Technology Group
> Institute of Software, the Chinese Academy of Sciences (ISCAS)
> <mailto:ailvpeng25@gmail.com>
>


-- 
---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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH]tools/libxl: fix a bug in libxl__build_device_model_args_new. info->vncpasswd can't be empty if info->vncpasswd != NULL
@ 2011-04-15  8:33 ZhouPeng
  2011-04-15  8:28 ` Christoph Egger
  0 siblings, 1 reply; 8+ messages in thread
From: ZhouPeng @ 2011-04-15  8:33 UTC (permalink / raw)
  To: Xen-Devel (E-mail), Ian.Jackson, Ian Campbell


[-- Attachment #1.1: Type: text/plain, Size: 847 bytes --]

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 != 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 = 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");
         }
         flexarray_append(dm_args, "-vnc");

-- 
Zhou Peng
Operating System Technology Group
Institute of Software, the Chinese Academy of Sciences (ISCAS)
<ailvpeng25@gmail.com>

[-- Attachment #1.2: Type: text/html, Size: 1092 bytes --]

[-- Attachment #2: vnc-password.diff --]
[-- Type: text/x-patch, Size: 707 bytes --]

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 != 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 = 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");
         }
         flexarray_append(dm_args, "-vnc");

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH]tools/libxl: fix a bug in libxl__build_device_model_args_new. info->vncpasswd can't be empty if info->vncpasswd != NULL
  2011-04-15  8:28 ` Christoph Egger
@ 2011-04-15  8:42   ` Ian Campbell
  2011-04-15  9:36   ` ZhouPeng
  1 sibling, 0 replies; 8+ messages in thread
From: Ian Campbell @ 2011-04-15  8:42 UTC (permalink / raw)
  To: Christoph Egger; +Cc: xen-devel@lists.xensource.com

On Fri, 2011-04-15 at 09:28 +0100, Christoph Egger wrote:
> 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 != NULL
> >
> 
> NACK!  This can info->vncpasswd[0] contains '\0' if you have
> 
> 
>     vncpasswd=''
> 
> in the guest config file.

perhaps a strcmp(...., "") might make this more obvious to the casual
reader?

> 
> Christoph
> 
> 
> > 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 = 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");
> >           }
> >           flexarray_append(dm_args, "-vnc");
> >
> > --
> > Zhou Peng
> > Operating System Technology Group
> > Institute of Software, the Chinese Academy of Sciences (ISCAS)
> > <mailto:ailvpeng25@gmail.com>
> >
> 
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH]tools/libxl: fix a bug in libxl__build_device_model_args_new. info->vncpasswd can't be empty if info->vncpasswd != NULL
  2011-04-15  8:28 ` Christoph Egger
  2011-04-15  8:42   ` Ian Campbell
@ 2011-04-15  9:36   ` ZhouPeng
  2011-04-15  9:37     ` Christoph Egger
  1 sibling, 1 reply; 8+ messages in thread
From: ZhouPeng @ 2011-04-15  9:36 UTC (permalink / raw)
  To: Christoph Egger, ian.campbell; +Cc: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1956 bytes --]

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 != NULL
>>
>>
> NACK!  This can info->vncpasswd[0] contains '\0' if you have
>
>
>   vncpasswd=''
>
> in the guest config file.
>

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

Christoph
>
>
>  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 = 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");
>>          }
>>          flexarray_append(dm_args, "-vnc");
>>
>> --
>> Zhou Peng
>> Operating System Technology Group
>> Institute of Software, the Chinese Academy of Sciences (ISCAS)
>> <mailto:ailvpeng25@gmail.com>
>>
>>
>
> --
> ---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
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>



-- 
Zhou Peng
Operating System Technology Group
Institute of Software, the Chinese Academy of Sciences (ISCAS)
<ailvpeng25@gmail.com>

[-- Attachment #1.2: Type: text/html, Size: 3258 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH]tools/libxl: fix a bug in libxl__build_device_model_args_new. info->vncpasswd can't be empty if info->vncpasswd != NULL
  2011-04-15  9:36   ` ZhouPeng
@ 2011-04-15  9:37     ` Christoph Egger
  2011-04-15  9:53       ` ZhouPeng
  0 siblings, 1 reply; 8+ messages in thread
From: Christoph Egger @ 2011-04-15  9:37 UTC (permalink / raw)
  To: ZhouPeng; +Cc: xen-devel@lists.xensource.com, ian.campbell@citrix.com

On 04/15/11 11:36, ZhouPeng wrote:
>
>
> 2011/4/15 Christoph Egger<Christoph.Egger@amd.com<mailto:Christoph.Egger@amd.com>>
> On 04/15/11 10:33, ZhouPeng wrote:
> Signed-off-by: Zhou Peng<zhoupeng@nfs.iscas.ac.cn<mailto: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 != NULL
>
>
> NACK!  This can info->vncpasswd[0] contains '\0' if you have
>
>
>    vncpasswd=''
>
> in the guest config file.
>
>   " if (info->vncpasswd&&   info->vncpasswd[0]) “ can
>    vncpasswd='' in guest cfg file, when using upstream-qemu-xen
>    and block vncpasswd='passwd'
>    Can it be reasonable?
>


Does that mean upstream qemu-xen and in-tree qemu-xen behave differently?

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH]tools/libxl: fix a bug in libxl__build_device_model_args_new. info->vncpasswd can't be empty if info->vncpasswd != NULL
  2011-04-15  9:37     ` Christoph Egger
@ 2011-04-15  9:53       ` ZhouPeng
  2011-04-15 10:02         ` ZhouPeng
  0 siblings, 1 reply; 8+ messages in thread
From: ZhouPeng @ 2011-04-15  9:53 UTC (permalink / raw)
  To: Christoph Egger; +Cc: xen-devel@lists.xensource.com, ian.campbell@citrix.com


[-- Attachment #1.1: Type: text/plain, Size: 1581 bytes --]

2011/4/15 Christoph Egger <Christoph.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>>
>>
>> On 04/15/11 10:33, ZhouPeng wrote:
>> Signed-off-by: Zhou Peng<zhoupeng@nfs.iscas.ac.cn<mailto:
>> 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 != NULL
>>
>>
>> NACK!  This can info->vncpasswd[0] contains '\0' if you have
>>
>>
>>   vncpasswd=''
>>
>> in the guest config file.
>>
>>  " if (info->vncpasswd&&   info->vncpasswd[0]) “ can
>>   vncpasswd='' in guest cfg file, when using upstream-qemu-xen
>>   and block vncpasswd='passwd'
>>   Can it be reasonable?
>>
>>
>
> Does that mean upstream qemu-xen and in-tree qemu-xen behave differently?
>
  if (new_qemu == 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)
<ailvpeng25@gmail.com>

[-- Attachment #1.2: Type: text/html, Size: 2737 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH]tools/libxl: fix a bug in libxl__build_device_model_args_new. info->vncpasswd can't be empty if info->vncpasswd != NULL
  2011-04-15  9:53       ` ZhouPeng
@ 2011-04-15 10:02         ` ZhouPeng
  2011-04-18 15:06           ` Ian Jackson
  0 siblings, 1 reply; 8+ messages in thread
From: ZhouPeng @ 2011-04-15 10:02 UTC (permalink / raw)
  To: Christoph Egger; +Cc: xen-devel@lists.xensource.com, ian.campbell@citrix.com


[-- Attachment #1.1: Type: text/plain, Size: 2631 bytes --]

This patch may be more readable
==
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 != 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 = 0;
         const char *listen = "127.0.0.1";

-        if (info->vncpasswd && info->vncpasswd[0]) {
+        if (info->vncpasswd && (info->vncpasswd[0] == '\0')) {
             assert(!"missing code for supplying vnc password to qemu");
         }
         flexarray_append(dm_args, "-vnc");

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

>
>
> 2011/4/15 Christoph Egger <Christoph.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>>
>>>
>>> On 04/15/11 10:33, ZhouPeng wrote:
>>> Signed-off-by: Zhou Peng<zhoupeng@nfs.iscas.ac.cn<mailto:
>>> 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 != NULL
>>>
>>>
>>> NACK!  This can info->vncpasswd[0] contains '\0' if you have
>>>
>>>
>>>   vncpasswd=''
>>>
>>> in the guest config file.
>>>
>>>  " if (info->vncpasswd&&   info->vncpasswd[0]) “ can
>>>   vncpasswd='' in guest cfg file, when using upstream-qemu-xen
>>>   and block vncpasswd='passwd'
>>>   Can it be reasonable?
>>>
>>>
>>
>> Does that mean upstream qemu-xen and in-tree qemu-xen behave differently?
>>
>   if (new_qemu == 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)
> <ailvpeng25@gmail.com>
>



-- 
Zhou Peng
Operating System Technology Group
Institute of Software, the Chinese Academy of Sciences (ISCAS)
<ailvpeng25@gmail.com>

[-- Attachment #1.2: Type: text/html, Size: 4313 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH]tools/libxl: fix a bug in libxl__build_device_model_args_new. info->vncpasswd can't be empty if info->vncpasswd != NULL
  2011-04-15 10:02         ` ZhouPeng
@ 2011-04-18 15:06           ` Ian Jackson
  0 siblings, 0 replies; 8+ messages in thread
From: Ian Jackson @ 2011-04-18 15:06 UTC (permalink / raw)
  To: ZhouPeng
  Cc: Christoph Egger, xen-devel@lists.xensource.com,
	ian.campbell@citrix.com

ZhouPeng writes ("Re: [Xen-devel] [PATCH]tools/libxl: fix a bug in libxl__build_device_model_args_new. info->vncpasswd can't be empty if info->vncpasswd != 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 = 0;
>          const char *listen = "127.0.0.1";
> 
> -        if (info->vncpasswd && info->vncpasswd[0]) {
> +        if (info->vncpasswd && (info->vncpasswd[0] == '\0')) {
>              assert(!"missing code for supplying vnc password to qemu");
>          }
>          flexarray_append(dm_args, "-vnc");

I still think this is wrong.  As I wrote on the 15th of April:

  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...

I have a reply from you in my mailbox but it's a hideously
incomprehensible HTML mess.  Please post only in plain text.

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-04-18 15:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-15  8:33 [PATCH]tools/libxl: fix a bug in libxl__build_device_model_args_new. info->vncpasswd can't be empty if info->vncpasswd != NULL ZhouPeng
2011-04-15  8:28 ` Christoph Egger
2011-04-15  8:42   ` Ian Campbell
2011-04-15  9:36   ` ZhouPeng
2011-04-15  9:37     ` Christoph Egger
2011-04-15  9:53       ` ZhouPeng
2011-04-15 10:02         ` ZhouPeng
2011-04-18 15:06           ` Ian Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).