diff options
author | Mao Zhongyi <maozhongyi@cmss.chinamobile.com> | 2020-06-03 16:09:01 +0800 |
---|---|---|
committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2020-06-17 17:48:39 +0100 |
commit | ac9c95b13fc1ccd097834b29d846f25795bd76de (patch) | |
tree | 33c5abc0e9070f40734062de067b64a5e426de24 /monitor | |
parent | 0705ecc4ade74f03df00e8528987e7876a293f3b (diff) |
monitor/hmp-cmds: add 'goto end' to reduce duplicate code.
Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Message-Id: <20200603080904.997083-7-maozhongyi@cmss.chinamobile.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'monitor')
-rw-r--r-- | monitor/hmp-cmds.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 504796d6e9..00e3362cb0 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -1502,8 +1502,7 @@ void hmp_change(Monitor *mon, const QDict *qdict) read_only, BLOCKDEV_CHANGE_READ_ONLY_MODE_RETAIN, &err); if (err) { - hmp_handle_error(mon, err); - return; + goto end; } } @@ -1512,6 +1511,7 @@ void hmp_change(Monitor *mon, const QDict *qdict) &err); } +end: hmp_handle_error(mon, err); } @@ -1630,13 +1630,13 @@ void hmp_object_add(Monitor *mon, const QDict *qdict) opts = qemu_opts_from_qdict(qemu_find_opts("object"), qdict, &err); if (err) { - hmp_handle_error(mon, err); - return; + goto end; } obj = user_creatable_add_opts(opts, &err); qemu_opts_del(opts); +end: hmp_handle_error(mon, err); if (obj) { |