On 11/19/20 7:16 AM, Vladimir Sementsov-Ogievskiy wrote: > Add function for debugging: we already have x-debug-query-block-graph > qmp command and scripts/render_block_graph.py which can dump > block-layer graph for running vm using qmp command. But when debug > block layer code, its often needed to dump some intermediate state > during some operation, so separate qmp command doesn't help. > > So, let's introduce a function which can dump needed information into > json file. > > In next commit we'll update scripts/render_block_graph.py so that it > will be able to parse json files. > > For new function to not crash if we have mirror_top filter node not yet > bdrv_append()ed (to debug why it can't be appended), make > bdrv_get_allocated_file_size() and bdrv_refresh_filename() not crash on > filters without a child. > > Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> > ---
> +++ b/qapi/block-core.json > @@ -1908,6 +1908,19 @@ > ## > { 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph' } > > +## > +# @XDbgBlockLayerDump: > +# > +# Unite query-named-block-nodes, query-block-jobs and > +# x-debug-query-block-graph results into one structure for block_layer_dump() > +# function. > +# > +# Since: 5.3 The next release will be numbered 6.0, not 5.3. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org