Patchwork [v2,3/5] qemu-char: use bool in qemu_chr_open_socket

login
register
mail settings
Submitter liguang
Date June 18, 2013, 3:45 a.m.
Message ID <1371527137-16949-3-git-send-email-lig.fnst@cn.fujitsu.com>
Download mbox | patch
Permalink /patch/252107/
State New
Headers show

Comments

liguang - June 18, 2013, 3:45 a.m.
local variables is_* should be bool by usage,
and last parameter of qemu_opt_get_bool is bool,
so pass true/false for it.

Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
---
 qemu-char.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

Patch

diff --git a/qemu-char.c b/qemu-char.c
index 2c3cfe6..0d695e0 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -2679,16 +2679,16 @@  static CharDriverState *qemu_chr_open_socket(QemuOpts *opts)
     CharDriverState *chr = NULL;
     Error *local_err = NULL;
     int fd = -1;
-    int is_listen;
-    int is_waitconnect;
-    int do_nodelay;
-    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);
+    bool is_listen;
+    bool is_waitconnect;
+    bool do_nodelay;
+    bool is_unix;
+    bool is_telnet;
+
+    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;