qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 2/4] Monitor: remove unneeded checks
Date: Thu,  4 Feb 2010 18:13:14 -0200	[thread overview]
Message-ID: <1265314396-6583-3-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1265314396-6583-1-git-send-email-lcapitulino@redhat.com>

It's not needed to check the return of qobject_from_jsonf()
anymore, as an assert() has been added there.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 block.c          |    3 ---
 hw/pci-hotplug.c |    1 -
 migration.c      |    3 ---
 monitor.c        |    5 -----
 4 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/block.c b/block.c
index 1919d19..89d697e 100644
--- a/block.c
+++ b/block.c
@@ -1259,7 +1259,6 @@ void bdrv_info(Monitor *mon, QObject **ret_data)
                                     "'removable': %i, 'locked': %i }",
                                     bs->device_name, type, bs->removable,
                                     bs->locked);
-        assert(bs_obj != NULL);
 
         if (bs->drv) {
             QObject *obj;
@@ -1270,7 +1269,6 @@ void bdrv_info(Monitor *mon, QObject **ret_data)
                                      bs->filename, bs->read_only,
                                      bs->drv->format_name,
                                      bdrv_is_encrypted(bs));
-            assert(obj != NULL);
             if (bs->backing_file[0] != '\0') {
                 QDict *qdict = qobject_to_qdict(obj);
                 qdict_put(qdict, "backing_file",
@@ -1356,7 +1354,6 @@ void bdrv_info_stats(Monitor *mon, QObject **ret_data)
                                  bs->device_name,
                                  bs->rd_bytes, bs->wr_bytes,
                                  bs->rd_ops, bs->wr_ops);
-        assert(obj != NULL);
         qlist_append_obj(devices, obj);
     }
 
diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c
index ba13d2b..0fb96f0 100644
--- a/hw/pci-hotplug.c
+++ b/hw/pci-hotplug.c
@@ -285,7 +285,6 @@ void pci_device_hot_add(Monitor *mon, const QDict *qdict, QObject **ret_data)
         qobject_from_jsonf("{ 'domain': 0, 'bus': %d, 'slot': %d, "
                            "'function': %d }", pci_bus_num(dev->bus),
                            PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
-        assert(*ret_data != NULL);
     } else
         monitor_printf(mon, "failed to add %s\n", opts);
 }
diff --git a/migration.c b/migration.c
index 5b28e42..6f26028 100644
--- a/migration.c
+++ b/migration.c
@@ -183,8 +183,6 @@ static void migrate_put_status(QDict *qdict, const char *name,
     obj = qobject_from_jsonf("{ 'transferred': %" PRId64 ", "
                                "'remaining': %" PRId64 ", "
                                "'total': %" PRId64 " }", trans, rem, total);
-    assert(obj != NULL);
-
     qdict_put_obj(qdict, name, obj);
 }
 
@@ -258,7 +256,6 @@ void do_info_migrate(Monitor *mon, QObject **ret_data)
             *ret_data = qobject_from_jsonf("{ 'status': 'cancelled' }");
             break;
         }
-        assert(*ret_data != NULL);
     }
 }
 
diff --git a/monitor.c b/monitor.c
index a0ec7fc..cb7eb65 100644
--- a/monitor.c
+++ b/monitor.c
@@ -351,8 +351,6 @@ static void timestamp_put(QDict *qdict)
     obj = qobject_from_jsonf("{ 'seconds': %" PRId64 ", "
                                 "'microseconds': %" PRId64 " }",
                                 (int64_t) tv.tv_sec, (int64_t) tv.tv_usec);
-    assert(obj != NULL);
-
     qdict_put_obj(qdict, "timestamp", obj);
 }
 
@@ -897,7 +895,6 @@ static void do_info_cpus(Monitor *mon, QObject **ret_data)
         obj = qobject_from_jsonf("{ 'CPU': %d, 'current': %i, 'halted': %i }",
                                  env->cpu_index, env == mon->mon_cpu,
                                  env->halted);
-        assert(obj != NULL);
 
         cpu = qobject_to_qdict(obj);
 
@@ -4412,8 +4409,6 @@ static void monitor_control_event(void *opaque, int event)
         json_message_parser_init(&mon->mc->parser, handle_qmp_command);
 
         data = get_qmp_greeting();
-        assert(data != NULL);
-
         monitor_json_emitter(mon, data);
         qobject_decref(data);
     }
-- 
1.6.6

  parent reply	other threads:[~2010-02-04 20:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-04 20:13 [Qemu-devel] [PATCH v0 0/4]: QMP related fixes Luiz Capitulino
2010-02-04 20:13 ` [Qemu-devel] [PATCH 1/4] qjson: Improve debugging Luiz Capitulino
2010-02-04 22:31   ` Anthony Liguori
2010-02-05  9:13     ` Markus Armbruster
2010-02-05 12:13       ` Luiz Capitulino
2010-02-05 12:12     ` Luiz Capitulino
2010-02-05 15:54       ` Anthony Liguori
2010-02-05 17:14         ` Markus Armbruster
2010-02-08 11:22           ` Luiz Capitulino
2010-02-08 14:53           ` Anthony Liguori
2010-02-08 15:05             ` Luiz Capitulino
2010-02-04 20:13 ` Luiz Capitulino [this message]
2010-02-04 20:13 ` [Qemu-devel] [PATCH 3/4] QError: Don't abort on multiple faults Luiz Capitulino
2010-02-05  9:15   ` Markus Armbruster
2010-02-05 14:21     ` Markus Armbruster
2010-02-05 14:44       ` Luiz Capitulino
2010-02-05 15:15         ` Markus Armbruster
2010-02-05 17:07           ` Luiz Capitulino
2010-02-04 20:13 ` [Qemu-devel] [PATCH 4/4] QMP: Don't leak on connection close Luiz Capitulino
  -- strict thread matches above, loose matches on Subject: below --
2010-02-08 19:01 [Qemu-devel] [PATCH v1 0/4]: QMP related fixes Luiz Capitulino
2010-02-08 19:01 ` [Qemu-devel] [PATCH 2/4] Monitor: remove unneeded checks Luiz Capitulino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1265314396-6583-3-git-send-email-lcapitulino@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).