mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
qdev: Collect HMP handlers command handlers in qdev-monitor.c
Move hmp_device_add(), hmp_device_del() from monitor/hmp-cmds.c to qdev-monitor.c, where they are covered by MAINTAINERS section "QOM", just like qapi/qdev.json. hmp_info_qtree() and hmp_info_qdm() are already there. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190709185936.31335-1-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
This commit is contained in:
parent
ffaee83bcb
commit
d94bd0927e
2 changed files with 18 additions and 19 deletions
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include "qemu/osdep.h"
|
||||
#include "hw/sysbus.h"
|
||||
#include "monitor/hmp.h"
|
||||
#include "monitor/monitor.h"
|
||||
#include "monitor/qdev.h"
|
||||
#include "sysemu/arch_init.h"
|
||||
|
@ -844,6 +845,23 @@ void qmp_device_del(const char *id, Error **errp)
|
|||
}
|
||||
}
|
||||
|
||||
void hmp_device_add(Monitor *mon, const QDict *qdict)
|
||||
{
|
||||
Error *err = NULL;
|
||||
|
||||
qmp_device_add((QDict *)qdict, NULL, &err);
|
||||
hmp_handle_error(mon, &err);
|
||||
}
|
||||
|
||||
void hmp_device_del(Monitor *mon, const QDict *qdict)
|
||||
{
|
||||
const char *id = qdict_get_str(qdict, "id");
|
||||
Error *err = NULL;
|
||||
|
||||
qmp_device_del(id, &err);
|
||||
hmp_handle_error(mon, &err);
|
||||
}
|
||||
|
||||
BlockBackend *blk_by_qdev_id(const char *id, Error **errp)
|
||||
{
|
||||
DeviceState *dev;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue