Commit ac9c95b1 authored by Mao Zhongyi's avatar Mao Zhongyi Committed by Dr. David Alan Gilbert
Browse files

monitor/hmp-cmds: add 'goto end' to reduce duplicate code.



Signed-off-by: default avatarMao Zhongyi <maozhongyi@cmss.chinamobile.com>
Message-Id: <20200603080904.997083-7-maozhongyi@cmss.chinamobile.com>
Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
parent 0705ecc4
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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) {