diff mbox

[3/5] qemu-char: pass bool parameter for qemu_opt_get_bool

Message ID 1370927720-4348-3-git-send-email-lig.fnst@cn.fujitsu.com
State New
Headers show

Commit Message

liguang June 11, 2013, 5:15 a.m. UTC
Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
---
 qemu-char.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

Comments

Michael Tokarev June 11, 2013, 11:35 a.m. UTC | #1
11.06.2013 09:15, liguang wrote:
> Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
> ---
>  qemu-char.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/qemu-char.c b/qemu-char.c
> index d04b429..8092eb8 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -2767,10 +2767,10 @@ static CharDriverState *qemu_chr_open_socket(QemuOpts *opts)
>      int is_unix;
>      int is_telnet;
>  
> -    is_listen      = qemu_opt_get_bool(opts, "server", 0);
> -    is_waitconnect = qemu_opt_get_bool(opts, "wait", 1);
> -    is_telnet      = qemu_opt_get_bool(opts, "telnet", 0);
> -    do_nodelay     = !qemu_opt_get_bool(opts, "delay", 1);
> +    is_listen      = qemu_opt_get_bool(opts, "server", false);
> +    is_waitconnect = qemu_opt_get_bool(opts, "wait", true);
> +    is_telnet      = qemu_opt_get_bool(opts, "telnet", false);
> +    do_nodelay     = !qemu_opt_get_bool(opts, "delay", true);
>      is_unix        = qemu_opt_get(opts, "path") != NULL;
>      if (!is_listen)
>          is_waitconnect = 0;

While we're at it, all the is_* variables themselves should be made
bool instead of int too.

Thanks,

/mjt
liguang June 18, 2013, 2:33 a.m. UTC | #2
在 2013-06-11二的 15:35 +0400,Michael Tokarev写道:
> 11.06.2013 09:15, liguang wrote:
> > Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
> > ---
> >  qemu-char.c |    8 ++++----
> >  1 files changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/qemu-char.c b/qemu-char.c
> > index d04b429..8092eb8 100644
> > --- a/qemu-char.c
> > +++ b/qemu-char.c
> > @@ -2767,10 +2767,10 @@ static CharDriverState *qemu_chr_open_socket(QemuOpts *opts)
> >      int is_unix;
> >      int is_telnet;
> >  
> > -    is_listen      = qemu_opt_get_bool(opts, "server", 0);
> > -    is_waitconnect = qemu_opt_get_bool(opts, "wait", 1);
> > -    is_telnet      = qemu_opt_get_bool(opts, "telnet", 0);
> > -    do_nodelay     = !qemu_opt_get_bool(opts, "delay", 1);
> > +    is_listen      = qemu_opt_get_bool(opts, "server", false);
> > +    is_waitconnect = qemu_opt_get_bool(opts, "wait", true);
> > +    is_telnet      = qemu_opt_get_bool(opts, "telnet", false);
> > +    do_nodelay     = !qemu_opt_get_bool(opts, "delay", true);
> >      is_unix        = qemu_opt_get(opts, "path") != NULL;
> >      if (!is_listen)
> >          is_waitconnect = 0;
> 
> While we're at it, all the is_* variables themselves should be made
> bool instead of int too.
> 

right,

Thanks!
diff mbox

Patch

diff --git a/qemu-char.c b/qemu-char.c
index d04b429..8092eb8 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -2767,10 +2767,10 @@  static CharDriverState *qemu_chr_open_socket(QemuOpts *opts)
     int is_unix;
     int is_telnet;
 
-    is_listen      = qemu_opt_get_bool(opts, "server", 0);
-    is_waitconnect = qemu_opt_get_bool(opts, "wait", 1);
-    is_telnet      = qemu_opt_get_bool(opts, "telnet", 0);
-    do_nodelay     = !qemu_opt_get_bool(opts, "delay", 1);
+    is_listen      = qemu_opt_get_bool(opts, "server", false);
+    is_waitconnect = qemu_opt_get_bool(opts, "wait", true);
+    is_telnet      = qemu_opt_get_bool(opts, "telnet", false);
+    do_nodelay     = !qemu_opt_get_bool(opts, "delay", true);
     is_unix        = qemu_opt_get(opts, "path") != NULL;
     if (!is_listen)
         is_waitconnect = 0;