Re: [Qemu-devel] [PATCH v2 1/1] qtest: Fix the bug about disabling vnc causes make check hang

2014-01-05 Thread Kewei Yu
2014/1/3 Paolo Bonzini pbonz...@redhat.com

 Il 02/01/2014 15:45, Andreas Färber ha scritto:
v2: Consolidate VNC macro's #ifdef'ery to one central point
 (tests/libqtest.c).
  
   What happens if qtest instead uses -display none?
  It does use that, since the commit I pointed to in v1. :)

 And why do you need at all -vnc none if it also uses -display none?

Yeah, if -display none, the vnc_display will be NULL in vl.c:4313, So the
vnc is not initialized.
So, the -vnc none is excrescent.


 Paolo

Kewei


Re: [Qemu-devel] [PATCH v2 1/1] qtest: Fix the bug about disabling vnc causes make check hang

2014-01-03 Thread Paolo Bonzini
Il 02/01/2014 15:45, Andreas Färber ha scritto:
   v2: Consolidate VNC macro's #ifdef'ery to one central point 
  (tests/libqtest.c).
  
  What happens if qtest instead uses -display none?
 It does use that, since the commit I pointed to in v1. :)

And why do you need at all -vnc none if it also uses -display none?

Paolo



Re: [Qemu-devel] [PATCH v2 1/1] qtest: Fix the bug about disabling vnc causes make check hang

2014-01-02 Thread Paolo Bonzini
Il 31/12/2013 05:42, Kewei Yu ha scritto:
 When we disabling vnc from ./configure, the qemu can't use the vnc option.
 So qtest can't use the vnc -none , otherwise make check will hang.
 
 Signed-off-by: Kewei Yu kewe...@gmail.com
 ---
  v2: Consolidate VNC macro's #ifdef'ery to one central point 
 (tests/libqtest.c).

What happens if qtest instead uses -display none?

Paolo



Re: [Qemu-devel] [PATCH v2 1/1] qtest: Fix the bug about disabling vnc causes make check hang

2014-01-02 Thread Kewei Yu
The fail is caused by -vnc none, we can't use it when disable vnc from
./configure.


Faithfully yours
Kewei Yu


2014/1/2 Paolo Bonzini pbonz...@redhat.com

 Il 31/12/2013 05:42, Kewei Yu ha scritto:
  When we disabling vnc from ./configure, the qemu can't use the vnc
 option.
  So qtest can't use the vnc -none , otherwise make check will hang.
 
  Signed-off-by: Kewei Yu kewe...@gmail.com
  ---
   v2: Consolidate VNC macro's #ifdef'ery to one central point
 (tests/libqtest.c).

 What happens if qtest instead uses -display none?

 Paolo



Re: [Qemu-devel] [PATCH v2 1/1] qtest: Fix the bug about disabling vnc causes make check hang

2014-01-02 Thread Andreas Färber
Am 02.01.2014 09:15, schrieb Paolo Bonzini:
 Il 31/12/2013 05:42, Kewei Yu ha scritto:
 When we disabling vnc from ./configure, the qemu can't use the vnc option.
 So qtest can't use the vnc -none , otherwise make check will hang.

 Signed-off-by: Kewei Yu kewe...@gmail.com
 ---
  v2: Consolidate VNC macro's #ifdef'ery to one central point 
 (tests/libqtest.c).
 
 What happens if qtest instead uses -display none?

It does use that, since the commit I pointed to in v1. :)

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



Re: [Qemu-devel] [PATCH v2 1/1] qtest: Fix the bug about disabling vnc causes make check hang

2014-01-02 Thread Andreas Färber
Am 01.01.2014 05:40, schrieb Peter Crosthwaite:
 On Tue, Dec 31, 2013 at 11:29 PM, Kewei Yu kewe...@gmail.com wrote:
 2013/12/31 Peter Crosthwaite peter.crosthwa...@xilinx.com
 On Tue, Dec 31, 2013 at 2:42 PM, Kewei Yu kewe...@gmail.com wrote:
 When we disabling vnc from ./configure, the qemu can't use the vnc
 option.
[...]
 So qtest can't use the vnc -none , otherwise make check will hang.

 Curious, why exactly does make check hang? Shouldn't it just fail with
 an error result in this case?

 Yeah, there is an error result VNC support is disabled.
 
 I think its just terminology then. s/hangs/fails.

Actually no. When qtest gets an unsupported command line argument, so
that QEMU exits right away, then qtest hangs, waiting for the process.
This was easily reproducible by mistyping machine names in my qom-test.
That's a separate issue though.

Regards,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



Re: [Qemu-devel] [PATCH v2 1/1] qtest: Fix the bug about disabling vnc causes make check hang

2014-01-02 Thread Kewei Yu
2014/1/2 Andreas Färber afaer...@suse.de

 Am 01.01.2014 05:40, schrieb Peter Crosthwaite:
  On Tue, Dec 31, 2013 at 11:29 PM, Kewei Yu kewe...@gmail.com wrote:
  2013/12/31 Peter Crosthwaite peter.crosthwa...@xilinx.com
  On Tue, Dec 31, 2013 at 2:42 PM, Kewei Yu kewe...@gmail.com wrote:
  When we disabling vnc from ./configure, the qemu can't use the vnc
  option.
 [...]
  So qtest can't use the vnc -none , otherwise make check will hang.
 
  Curious, why exactly does make check hang? Shouldn't it just fail with
  an error result in this case?
 
  Yeah, there is an error result VNC support is disabled.
 
  I think its just terminology then. s/hangs/fails.

 Actually no. When qtest gets an unsupported command line argument, so
 that QEMU exits right away, then qtest hangs, waiting for the process.
 This was easily reproducible by mistyping machine names in my qom-test.
 That's a separate issue though.

Yeah, It actually waits for the a handler and doesn't exit from make
check.
Maybe I didn't show a detailed description.
So, Should I submit the patch v4?


 Regards,
 Andreas

 --
 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
 GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



Re: [Qemu-devel] [PATCH v2 1/1] qtest: Fix the bug about disabling vnc causes make check hang

2014-01-02 Thread Peter Crosthwaite
On Fri, Jan 3, 2014 at 1:01 PM, Kewei Yu kewe...@gmail.com wrote:

 2014/1/2 Andreas Färber afaer...@suse.de

 Am 01.01.2014 05:40, schrieb Peter Crosthwaite:
  On Tue, Dec 31, 2013 at 11:29 PM, Kewei Yu kewe...@gmail.com wrote:
  2013/12/31 Peter Crosthwaite peter.crosthwa...@xilinx.com
  On Tue, Dec 31, 2013 at 2:42 PM, Kewei Yu kewe...@gmail.com wrote:
  When we disabling vnc from ./configure, the qemu can't use the vnc
  option.
 [...]
  So qtest can't use the vnc -none , otherwise make check will
  hang.
 
  Curious, why exactly does make check hang? Shouldn't it just fail with
  an error result in this case?
 
  Yeah, there is an error result VNC support is disabled.
 
  I think its just terminology then. s/hangs/fails.

 Actually no. When qtest gets an unsupported command line argument, so
 that QEMU exits right away, then qtest hangs, waiting for the process.
 This was easily reproducible by mistyping machine names in my qom-test.
 That's a separate issue though.

 Yeah, It actually waits for the a handler and doesn't exit from make
 check.
 Maybe I didn't show a detailed description.
 So, Should I submit the patch v4?

Probably not just for this. fails is fine.

Regards,
Peter



 Regards,
 Andreas

 --
 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
 GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg





Re: [Qemu-devel] [PATCH v2 1/1] qtest: Fix the bug about disabling vnc causes make check hang

2013-12-31 Thread Peter Crosthwaite
On Tue, Dec 31, 2013 at 2:42 PM, Kewei Yu kewe...@gmail.com wrote:
 When we disabling vnc from ./configure, the qemu can't use the vnc option.

disable, -the, QEMU,

 So qtest can't use the vnc -none , otherwise make check will hang.


Curious, why exactly does make check hang? Shouldn't it just fail with
an error result in this case?

 Signed-off-by: Kewei Yu kewe...@gmail.com
 ---
  v2: Consolidate VNC macro's #ifdef'ery to one central point 
 (tests/libqtest.c).

  tests/fdc-test.c |5 +
  tests/ide-test.c |3 ---
  tests/libqtest.c |8 
  3 files changed, 9 insertions(+), 7 deletions(-)

 diff --git a/tests/fdc-test.c b/tests/fdc-test.c
 index 38b5b17..37096dc 100644
 --- a/tests/fdc-test.c
 +++ b/tests/fdc-test.c
 @@ -518,7 +518,6 @@ static void fuzz_registers(void)
  int main(int argc, char **argv)
  {
  const char *arch = qtest_get_arch();
 -char *cmdline;
  int fd;
  int ret;

 @@ -538,9 +537,7 @@ int main(int argc, char **argv)
  /* Run the tests */
  g_test_init(argc, argv, NULL);

 -cmdline = g_strdup_printf(-vnc none );
 -
 -qtest_start(cmdline);
 +qtest_start(NULL);
  qtest_irq_intercept_in(global_qtest, ioapic);
  qtest_add_func(/fdc/cmos, test_cmos);
  qtest_add_func(/fdc/no_media_on_start, test_no_media_on_start);
 diff --git a/tests/ide-test.c b/tests/ide-test.c
 index d5cec5a..4a0d97f 100644
 --- a/tests/ide-test.c
 +++ b/tests/ide-test.c
 @@ -380,7 +380,6 @@ static void test_bmdma_no_busmaster(void)
  static void test_bmdma_setup(void)
  {
  ide_test_start(
 --vnc none 
  -drive file=%s,if=ide,serial=%s,cache=writeback 
  -global ide-hd.ver=%s,
  tmp_path, testdisk, version);
 @@ -410,7 +409,6 @@ static void test_identify(void)
  int ret;

  ide_test_start(
 --vnc none 
  -drive file=%s,if=ide,serial=%s,cache=writeback 
  -global ide-hd.ver=%s,
  tmp_path, testdisk, version);
 @@ -455,7 +453,6 @@ static void test_flush(void)
  uint8_t data;

  ide_test_start(
 --vnc none 
  -drive file=blkdebug::%s,if=ide,cache=writeback,
  tmp_path);

 diff --git a/tests/libqtest.c b/tests/libqtest.c
 index 359d571..921391c 100644
 --- a/tests/libqtest.c
 +++ b/tests/libqtest.c
 @@ -35,6 +35,12 @@

  #define MAX_IRQ 256

 +#ifdef CONFIG_VNC
 +static const char *qtest_vnc_param = -vnc none ;
 +#else
 +static const char *qtest_vnc_param = NULL;
 +#endif
 +
  QTestState *global_qtest;

  struct QTestState
 @@ -136,8 +142,10 @@ QTestState *qtest_init(const char *extra_args)
-pidfile %s 
-machine accel=qtest 
-display none 
 +  %s
%s, qemu_binary, s-socket_path,
s-qmp_socket_path, pid_file,
 +  qtest_vnc_param ?: ,

I do vaguely remember someone going to efforts to remove uses of ? :
foo (with the blank true value).

Regards,
Peter

extra_args ?: );
  execlp(/bin/sh, sh, -c, command, NULL);
  exit(1);
 --
 1.7.1





Re: [Qemu-devel] [PATCH v2 1/1] qtest: Fix the bug about disabling vnc causes make check hang

2013-12-31 Thread Kewei Yu
2013/12/31 Peter Crosthwaite peter.crosthwa...@xilinx.com

 On Tue, Dec 31, 2013 at 2:42 PM, Kewei Yu kewe...@gmail.com wrote:
  When we disabling vnc from ./configure, the qemu can't use the vnc
 option.

 disable, -the, QEMU,

Do you mean s/disabling/disable; s/the\ qemu/QEMU?


  So qtest can't use the vnc -none , otherwise make check will hang.
 

 Curious, why exactly does make check hang? Shouldn't it just fail with
 an error result in this case?

Yeah, there is an error result VNC support is disabled.


  Signed-off-by: Kewei Yu kewe...@gmail.com
  ---
   v2: Consolidate VNC macro's #ifdef'ery to one central point
 (tests/libqtest.c).
 
   tests/fdc-test.c |5 +
   tests/ide-test.c |3 ---
   tests/libqtest.c |8 
   3 files changed, 9 insertions(+), 7 deletions(-)
 
  diff --git a/tests/fdc-test.c b/tests/fdc-test.c
  index 38b5b17..37096dc 100644
  --- a/tests/fdc-test.c
  +++ b/tests/fdc-test.c
  @@ -518,7 +518,6 @@ static void fuzz_registers(void)
   int main(int argc, char **argv)
   {
   const char *arch = qtest_get_arch();
  -char *cmdline;
   int fd;
   int ret;
 
  @@ -538,9 +537,7 @@ int main(int argc, char **argv)
   /* Run the tests */
   g_test_init(argc, argv, NULL);
 
  -cmdline = g_strdup_printf(-vnc none );
  -
  -qtest_start(cmdline);
  +qtest_start(NULL);
   qtest_irq_intercept_in(global_qtest, ioapic);
   qtest_add_func(/fdc/cmos, test_cmos);
   qtest_add_func(/fdc/no_media_on_start, test_no_media_on_start);
  diff --git a/tests/ide-test.c b/tests/ide-test.c
  index d5cec5a..4a0d97f 100644
  --- a/tests/ide-test.c
  +++ b/tests/ide-test.c
  @@ -380,7 +380,6 @@ static void test_bmdma_no_busmaster(void)
   static void test_bmdma_setup(void)
   {
   ide_test_start(
  --vnc none 
   -drive file=%s,if=ide,serial=%s,cache=writeback 
   -global ide-hd.ver=%s,
   tmp_path, testdisk, version);
  @@ -410,7 +409,6 @@ static void test_identify(void)
   int ret;
 
   ide_test_start(
  --vnc none 
   -drive file=%s,if=ide,serial=%s,cache=writeback 
   -global ide-hd.ver=%s,
   tmp_path, testdisk, version);
  @@ -455,7 +453,6 @@ static void test_flush(void)
   uint8_t data;
 
   ide_test_start(
  --vnc none 
   -drive file=blkdebug::%s,if=ide,cache=writeback,
   tmp_path);
 
  diff --git a/tests/libqtest.c b/tests/libqtest.c
  index 359d571..921391c 100644
  --- a/tests/libqtest.c
  +++ b/tests/libqtest.c
  @@ -35,6 +35,12 @@
 
   #define MAX_IRQ 256
 
  +#ifdef CONFIG_VNC
  +static const char *qtest_vnc_param = -vnc none ;
  +#else
  +static const char *qtest_vnc_param = NULL;
  +#endif
  +
   QTestState *global_qtest;
 
   struct QTestState
  @@ -136,8 +142,10 @@ QTestState *qtest_init(const char *extra_args)
 -pidfile %s 
 -machine accel=qtest 
 -display none 
  +  %s
 %s, qemu_binary, s-socket_path,
 s-qmp_socket_path, pid_file,
  +  qtest_vnc_param ?: ,

 I do vaguely remember someone going to efforts to remove uses of ? :
 foo (with the blank true value).

 I'm not clear the sentence's meaning.


 Regards,
 Peter

 extra_args ?: );
   execlp(/bin/sh, sh, -c, command, NULL);
   exit(1);
  --
  1.7.1
 
 


Thanks
Kewei


Re: [Qemu-devel] [PATCH v2 1/1] qtest: Fix the bug about disabling vnc causes make check hang

2013-12-31 Thread Kewei Yu
Peter:
 Happy new year, Today is new year's day, so I will present the v3
patch according to your suggestions tomorrow , thanks for your review.

Faithfully yours
Kewei Yu


2013/12/31 Kewei Yu kewe...@gmail.com

 2013/12/31 Peter Crosthwaite peter.crosthwa...@xilinx.com

 On Tue, Dec 31, 2013 at 2:42 PM, Kewei Yu kewe...@gmail.com wrote:
  When we disabling vnc from ./configure, the qemu can't use the vnc
 option.

 disable, -the, QEMU,

 Do you mean s/disabling/disable; s/the\ qemu/QEMU?


  So qtest can't use the vnc -none , otherwise make check will hang.
 

 Curious, why exactly does make check hang? Shouldn't it just fail with
 an error result in this case?

 Yeah, there is an error result VNC support is disabled.


  Signed-off-by: Kewei Yu kewe...@gmail.com
  ---
   v2: Consolidate VNC macro's #ifdef'ery to one central point
 (tests/libqtest.c).
 
   tests/fdc-test.c |5 +
   tests/ide-test.c |3 ---
   tests/libqtest.c |8 
   3 files changed, 9 insertions(+), 7 deletions(-)
 
  diff --git a/tests/fdc-test.c b/tests/fdc-test.c
  index 38b5b17..37096dc 100644
  --- a/tests/fdc-test.c
  +++ b/tests/fdc-test.c
  @@ -518,7 +518,6 @@ static void fuzz_registers(void)
   int main(int argc, char **argv)
   {
   const char *arch = qtest_get_arch();
  -char *cmdline;
   int fd;
   int ret;
 
  @@ -538,9 +537,7 @@ int main(int argc, char **argv)
   /* Run the tests */
   g_test_init(argc, argv, NULL);
 
  -cmdline = g_strdup_printf(-vnc none );
  -
  -qtest_start(cmdline);
  +qtest_start(NULL);
   qtest_irq_intercept_in(global_qtest, ioapic);
   qtest_add_func(/fdc/cmos, test_cmos);
   qtest_add_func(/fdc/no_media_on_start, test_no_media_on_start);
  diff --git a/tests/ide-test.c b/tests/ide-test.c
  index d5cec5a..4a0d97f 100644
  --- a/tests/ide-test.c
  +++ b/tests/ide-test.c
  @@ -380,7 +380,6 @@ static void test_bmdma_no_busmaster(void)
   static void test_bmdma_setup(void)
   {
   ide_test_start(
  --vnc none 
   -drive file=%s,if=ide,serial=%s,cache=writeback 
   -global ide-hd.ver=%s,
   tmp_path, testdisk, version);
  @@ -410,7 +409,6 @@ static void test_identify(void)
   int ret;
 
   ide_test_start(
  --vnc none 
   -drive file=%s,if=ide,serial=%s,cache=writeback 
   -global ide-hd.ver=%s,
   tmp_path, testdisk, version);
  @@ -455,7 +453,6 @@ static void test_flush(void)
   uint8_t data;
 
   ide_test_start(
  --vnc none 
   -drive file=blkdebug::%s,if=ide,cache=writeback,
   tmp_path);
 
  diff --git a/tests/libqtest.c b/tests/libqtest.c
  index 359d571..921391c 100644
  --- a/tests/libqtest.c
  +++ b/tests/libqtest.c
  @@ -35,6 +35,12 @@
 
   #define MAX_IRQ 256
 
  +#ifdef CONFIG_VNC
  +static const char *qtest_vnc_param = -vnc none ;
  +#else
  +static const char *qtest_vnc_param = NULL;
  +#endif
  +
   QTestState *global_qtest;
 
   struct QTestState
  @@ -136,8 +142,10 @@ QTestState *qtest_init(const char *extra_args)
 -pidfile %s 
 -machine accel=qtest 
 -display none 
  +  %s
 %s, qemu_binary, s-socket_path,
 s-qmp_socket_path, pid_file,
  +  qtest_vnc_param ?: ,

 I do vaguely remember someone going to efforts to remove uses of ? :
 foo (with the blank true value).

  I'm not clear the sentence's meaning.


 Regards,
 Peter

 extra_args ?: );
   execlp(/bin/sh, sh, -c, command, NULL);
   exit(1);
  --
  1.7.1
 
 


 Thanks
 Kewei




Re: [Qemu-devel] [PATCH v2 1/1] qtest: Fix the bug about disabling vnc causes make check hang

2013-12-31 Thread Peter Maydell
On 31 December 2013 13:29, Kewei Yu kewe...@gmail.com wrote:
 2013/12/31 Peter Crosthwaite peter.crosthwa...@xilinx.com

 On Tue, Dec 31, 2013 at 2:42 PM, Kewei Yu kewe...@gmail.com wrote:
 %s, qemu_binary, s-socket_path,
 s-qmp_socket_path, pid_file,
  +  qtest_vnc_param ?: ,

 I do vaguely remember someone going to efforts to remove uses of ? :
 foo (with the blank true value).

  I'm not clear the sentence's meaning.

Using the ternary operator X ? Y : Z with an empty 2nd operand
X ?: Y is not standard C. It's a GCC extension. There was a
suggestion a year or so back that we should remove the uses of
it, but the consensus was that this was unnecessary, since in
practice we rely on other GCC extensions. Clang also supports
this syntax, and it's the only other compiler we care about.

In this case it seems reasonable, especially since the line
immediately below this addition is using it too.

thanks
-- PMM



Re: [Qemu-devel] [PATCH v2 1/1] qtest: Fix the bug about disabling vnc causes make check hang

2013-12-31 Thread Kewei Yu
2014/1/1 Peter Maydell peter.mayd...@linaro.org

 On 31 December 2013 13:29, Kewei Yu kewe...@gmail.com wrote:
  2013/12/31 Peter Crosthwaite peter.crosthwa...@xilinx.com
 
  On Tue, Dec 31, 2013 at 2:42 PM, Kewei Yu kewe...@gmail.com wrote:
  %s, qemu_binary, s-socket_path,
  s-qmp_socket_path, pid_file,
   +  qtest_vnc_param ?: ,
 
  I do vaguely remember someone going to efforts to remove uses of ? :
  foo (with the blank true value).
 
   I'm not clear the sentence's meaning.

 Using the ternary operator X ? Y : Z with an empty 2nd operand
 X ?: Y is not standard C. It's a GCC extension. There was a
 suggestion a year or so back that we should remove the uses of
 it, but the consensus was that this was unnecessary, since in
 practice we rely on other GCC extensions. Clang also supports
 this syntax, and it's the only other compiler we care about.


Oh! Thank you, I got it.

In this case it seems reasonable, especially since the line
 immediately below this addition is using it too.


But,do I need to fix them to be X ? Y : Z and keep them consistent?

Faithfully yours
Kewei Yu

thanks
 -- PMM



Re: [Qemu-devel] [PATCH v2 1/1] qtest: Fix the bug about disabling vnc causes make check hang

2013-12-31 Thread Peter Crosthwaite
On Wed, Jan 1, 2014 at 12:29 PM, Kewei Yu kewe...@gmail.com wrote:

 2014/1/1 Peter Maydell peter.mayd...@linaro.org

 On 31 December 2013 13:29, Kewei Yu kewe...@gmail.com wrote:
  2013/12/31 Peter Crosthwaite peter.crosthwa...@xilinx.com
 
  On Tue, Dec 31, 2013 at 2:42 PM, Kewei Yu kewe...@gmail.com wrote:
  %s, qemu_binary, s-socket_path,
  s-qmp_socket_path, pid_file,
   +  qtest_vnc_param ?: ,
 
  I do vaguely remember someone going to efforts to remove uses of ? :
  foo (with the blank true value).
 
   I'm not clear the sentence's meaning.

 Using the ternary operator X ? Y : Z with an empty 2nd operand
 X ?: Y is not standard C. It's a GCC extension. There was a
 suggestion a year or so back that we should remove the uses of
 it, but the consensus was that this was unnecessary, since in
 practice we rely on other GCC extensions. Clang also supports
 this syntax, and it's the only other compiler we care about.


 Oh! Thank you, I got it.

 In this case it seems reasonable, especially since the line
 immediately below this addition is using it too.


 But,do I need to fix them to be X ? Y : Z and keep them consistent?


No, it's already consistent. No change to patch required. Apart from
the grammar and spelling.

Regards,
Peter

 Faithfully yours
 Kewei Yu

 thanks
 -- PMM






Re: [Qemu-devel] [PATCH v2 1/1] qtest: Fix the bug about disabling vnc causes make check hang

2013-12-31 Thread Peter Crosthwaite
On Tue, Dec 31, 2013 at 11:29 PM, Kewei Yu kewe...@gmail.com wrote:
 2013/12/31 Peter Crosthwaite peter.crosthwa...@xilinx.com

 On Tue, Dec 31, 2013 at 2:42 PM, Kewei Yu kewe...@gmail.com wrote:
  When we disabling vnc from ./configure, the qemu can't use the vnc
  option.

 disable, -the, QEMU,

 Do you mean s/disabling/disable; s/the\ qemu/QEMU?

Yes.



  So qtest can't use the vnc -none , otherwise make check will hang.
 

 Curious, why exactly does make check hang? Shouldn't it just fail with
 an error result in this case?

 Yeah, there is an error result VNC support is disabled.

I think its just terminology then. s/hangs/fails.

Happy New Year,
Peter



  Signed-off-by: Kewei Yu kewe...@gmail.com
  ---
   v2: Consolidate VNC macro's #ifdef'ery to one central point
  (tests/libqtest.c).
 
   tests/fdc-test.c |5 +
   tests/ide-test.c |3 ---
   tests/libqtest.c |8 
   3 files changed, 9 insertions(+), 7 deletions(-)
 
  diff --git a/tests/fdc-test.c b/tests/fdc-test.c
  index 38b5b17..37096dc 100644
  --- a/tests/fdc-test.c
  +++ b/tests/fdc-test.c
  @@ -518,7 +518,6 @@ static void fuzz_registers(void)
   int main(int argc, char **argv)
   {
   const char *arch = qtest_get_arch();
  -char *cmdline;
   int fd;
   int ret;
 
  @@ -538,9 +537,7 @@ int main(int argc, char **argv)
   /* Run the tests */
   g_test_init(argc, argv, NULL);
 
  -cmdline = g_strdup_printf(-vnc none );
  -
  -qtest_start(cmdline);
  +qtest_start(NULL);
   qtest_irq_intercept_in(global_qtest, ioapic);
   qtest_add_func(/fdc/cmos, test_cmos);
   qtest_add_func(/fdc/no_media_on_start, test_no_media_on_start);
  diff --git a/tests/ide-test.c b/tests/ide-test.c
  index d5cec5a..4a0d97f 100644
  --- a/tests/ide-test.c
  +++ b/tests/ide-test.c
  @@ -380,7 +380,6 @@ static void test_bmdma_no_busmaster(void)
   static void test_bmdma_setup(void)
   {
   ide_test_start(
  --vnc none 
   -drive file=%s,if=ide,serial=%s,cache=writeback 
   -global ide-hd.ver=%s,
   tmp_path, testdisk, version);
  @@ -410,7 +409,6 @@ static void test_identify(void)
   int ret;
 
   ide_test_start(
  --vnc none 
   -drive file=%s,if=ide,serial=%s,cache=writeback 
   -global ide-hd.ver=%s,
   tmp_path, testdisk, version);
  @@ -455,7 +453,6 @@ static void test_flush(void)
   uint8_t data;
 
   ide_test_start(
  --vnc none 
   -drive file=blkdebug::%s,if=ide,cache=writeback,
   tmp_path);
 
  diff --git a/tests/libqtest.c b/tests/libqtest.c
  index 359d571..921391c 100644
  --- a/tests/libqtest.c
  +++ b/tests/libqtest.c
  @@ -35,6 +35,12 @@
 
   #define MAX_IRQ 256
 
  +#ifdef CONFIG_VNC
  +static const char *qtest_vnc_param = -vnc none ;
  +#else
  +static const char *qtest_vnc_param = NULL;
  +#endif
  +
   QTestState *global_qtest;
 
   struct QTestState
  @@ -136,8 +142,10 @@ QTestState *qtest_init(const char *extra_args)
 -pidfile %s 
 -machine accel=qtest 
 -display none 
  +  %s
 %s, qemu_binary, s-socket_path,
 s-qmp_socket_path, pid_file,
  +  qtest_vnc_param ?: ,

 I do vaguely remember someone going to efforts to remove uses of ? :
 foo (with the blank true value).

  I'm not clear the sentence's meaning.


 Regards,
 Peter

 extra_args ?: );
   execlp(/bin/sh, sh, -c, command, NULL);
   exit(1);
  --
  1.7.1
 
 


 Thanks
 Kewei