Revision 587da2c3 hmp.c
b/hmp.c | ||
---|---|---|
22 | 22 |
#include "qemu/sockets.h" |
23 | 23 |
#include "monitor/monitor.h" |
24 | 24 |
#include "ui/console.h" |
25 |
#include "qemu-io.h" |
|
25 | 26 |
|
26 | 27 |
static void hmp_handle_error(Monitor *mon, Error **errp) |
27 | 28 |
{ |
... | ... | |
1425 | 1426 |
qmp_chardev_remove(qdict_get_str(qdict, "id"), &local_err); |
1426 | 1427 |
hmp_handle_error(mon, &local_err); |
1427 | 1428 |
} |
1429 |
|
|
1430 |
void hmp_qemu_io(Monitor *mon, const QDict *qdict) |
|
1431 |
{ |
|
1432 |
BlockDriverState *bs; |
|
1433 |
const char* device = qdict_get_str(qdict, "device"); |
|
1434 |
const char* command = qdict_get_str(qdict, "command"); |
|
1435 |
Error *err = NULL; |
|
1436 |
|
|
1437 |
bs = bdrv_find(device); |
|
1438 |
if (bs) { |
|
1439 |
qemuio_command(bs, command); |
|
1440 |
} else { |
|
1441 |
error_set(&err, QERR_DEVICE_NOT_FOUND, device); |
|
1442 |
} |
|
1443 |
|
|
1444 |
hmp_handle_error(mon, &err); |
|
1445 |
} |
Also available in: Unified diff