From 4cc70e933731ebf4309e1f1ce90973a0de04f28f Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Wed, 20 Nov 2013 10:01:54 +0800 Subject: blkdebug: add "remove_break" command This adds "remove_break" command which is the reverse of blkdebug command "break": it removes all breakpoints with given tag and resumes all the requests. Signed-off-by: Fam Zheng Signed-off-by: Stefan Hajnoczi --- qemu-io-cmds.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'qemu-io-cmds.c') diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c index 7e9fecb34f..85e4982bd8 100644 --- a/qemu-io-cmds.c +++ b/qemu-io-cmds.c @@ -1956,6 +1956,18 @@ static int break_f(BlockDriverState *bs, int argc, char **argv) return 0; } +static int remove_break_f(BlockDriverState *bs, int argc, char **argv) +{ + int ret; + + ret = bdrv_debug_remove_breakpoint(bs, argv[1]); + if (ret < 0) { + printf("Could not remove breakpoint %s: %s\n", argv[1], strerror(-ret)); + } + + return 0; +} + static const cmdinfo_t break_cmd = { .name = "break", .argmin = 2, @@ -1966,6 +1978,15 @@ static const cmdinfo_t break_cmd = { "request as tag", }; +static const cmdinfo_t remove_break_cmd = { + .name = "remove_break", + .argmin = 1, + .argmax = 1, + .cfunc = remove_break_f, + .args = "tag", + .oneline = "remove a breakpoint by tag", +}; + static int resume_f(BlockDriverState *bs, int argc, char **argv) { int ret; @@ -2126,6 +2147,7 @@ static void __attribute((constructor)) init_qemuio_commands(void) qemuio_add_command(&alloc_cmd); qemuio_add_command(&map_cmd); qemuio_add_command(&break_cmd); + qemuio_add_command(&remove_break_cmd); qemuio_add_command(&resume_cmd); qemuio_add_command(&wait_break_cmd); qemuio_add_command(&abort_cmd); -- cgit v1.2.3