mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
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>
This commit is contained in:
parent
0705ecc4ad
commit
ac9c95b13f
1 changed files with 4 additions and 4 deletions
|
@ -1502,8 +1502,7 @@ void hmp_change(Monitor *mon, const QDict *qdict)
|
||||||
read_only,
|
read_only,
|
||||||
BLOCKDEV_CHANGE_READ_ONLY_MODE_RETAIN, &err);
|
BLOCKDEV_CHANGE_READ_ONLY_MODE_RETAIN, &err);
|
||||||
if (err) {
|
if (err) {
|
||||||
hmp_handle_error(mon, err);
|
goto end;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1512,6 +1511,7 @@ void hmp_change(Monitor *mon, const QDict *qdict)
|
||||||
&err);
|
&err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
end:
|
||||||
hmp_handle_error(mon, err);
|
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);
|
opts = qemu_opts_from_qdict(qemu_find_opts("object"), qdict, &err);
|
||||||
if (err) {
|
if (err) {
|
||||||
hmp_handle_error(mon, err);
|
goto end;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
obj = user_creatable_add_opts(opts, &err);
|
obj = user_creatable_add_opts(opts, &err);
|
||||||
qemu_opts_del(opts);
|
qemu_opts_del(opts);
|
||||||
|
|
||||||
|
end:
|
||||||
hmp_handle_error(mon, err);
|
hmp_handle_error(mon, err);
|
||||||
|
|
||||||
if (obj) {
|
if (obj) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue