diff mbox

[6/9] QMP: check_opts(): Minor cleanup

Message ID 1275424897-32253-7-git-send-email-lcapitulino@redhat.com
State New
Headers show

Commit Message

Luiz Capitulino June 1, 2010, 8:41 p.m. UTC
We couldn't do it before, otherwise we would break the intention
of the previous checker, which was to ensure that opts_list wasn't
a NULL before checking it.

Debug code, pretty minor, still I decided to maintain its original
behavior.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 monitor.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/monitor.c b/monitor.c
index d2a510e..1875731 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4084,6 +4084,7 @@  static int monitor_can_read(void *opaque)
 
 static int check_opts(QemuOptsList *opts_list, QDict *args)
 {
+    assert(opts_list);
     assert(!opts_list->desc->name);
     return 0;
 }
@@ -4188,7 +4189,6 @@  static void check_mandatory_args(const char *cmd_arg_name,
 
     if (qstring_get_str(type)[0] == 'O') {
         QemuOptsList *opts_list = qemu_find_opts(cmd_arg_name);
-        assert(opts_list);
         res->result = check_opts(opts_list, res->qdict);
         res->skip = 1;
     } else if (qstring_get_str(type)[0] != '-' &&