mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 10:34:58 -06:00
block: Use CAFs for debug breakpoints
When looking for a blkdebug node (which implements debug breakpoints), use bdrv_primary_bs() to iterate through the graph, because that is where a blkdebug node would be. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
c8af87573f
commit
f706a92f24
1 changed files with 3 additions and 13 deletions
16
block.c
16
block.c
|
@ -5568,17 +5568,7 @@ void bdrv_debug_event(BlockDriverState *bs, BlkdebugEvent event)
|
||||||
static BlockDriverState *bdrv_find_debug_node(BlockDriverState *bs)
|
static BlockDriverState *bdrv_find_debug_node(BlockDriverState *bs)
|
||||||
{
|
{
|
||||||
while (bs && bs->drv && !bs->drv->bdrv_debug_breakpoint) {
|
while (bs && bs->drv && !bs->drv->bdrv_debug_breakpoint) {
|
||||||
if (bs->file) {
|
bs = bdrv_primary_bs(bs);
|
||||||
bs = bs->file->bs;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bs->drv->is_filter && bs->backing) {
|
|
||||||
bs = bs->backing->bs;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bs && bs->drv && bs->drv->bdrv_debug_breakpoint) {
|
if (bs && bs->drv && bs->drv->bdrv_debug_breakpoint) {
|
||||||
|
@ -5613,7 +5603,7 @@ int bdrv_debug_remove_breakpoint(BlockDriverState *bs, const char *tag)
|
||||||
int bdrv_debug_resume(BlockDriverState *bs, const char *tag)
|
int bdrv_debug_resume(BlockDriverState *bs, const char *tag)
|
||||||
{
|
{
|
||||||
while (bs && (!bs->drv || !bs->drv->bdrv_debug_resume)) {
|
while (bs && (!bs->drv || !bs->drv->bdrv_debug_resume)) {
|
||||||
bs = bs->file ? bs->file->bs : NULL;
|
bs = bdrv_primary_bs(bs);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bs && bs->drv && bs->drv->bdrv_debug_resume) {
|
if (bs && bs->drv && bs->drv->bdrv_debug_resume) {
|
||||||
|
@ -5626,7 +5616,7 @@ int bdrv_debug_resume(BlockDriverState *bs, const char *tag)
|
||||||
bool bdrv_debug_is_suspended(BlockDriverState *bs, const char *tag)
|
bool bdrv_debug_is_suspended(BlockDriverState *bs, const char *tag)
|
||||||
{
|
{
|
||||||
while (bs && bs->drv && !bs->drv->bdrv_debug_is_suspended) {
|
while (bs && bs->drv && !bs->drv->bdrv_debug_is_suspended) {
|
||||||
bs = bs->file ? bs->file->bs : NULL;
|
bs = bdrv_primary_bs(bs);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bs && bs->drv && bs->drv->bdrv_debug_is_suspended) {
|
if (bs && bs->drv && bs->drv->bdrv_debug_is_suspended) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue