Re: [Qemu-devel] [PATCH v6 12/15] blockdev: Keep track of monitor-owned BDS

2015-11-09 Thread Alberto Garcia
On Mon 09 Nov 2015 05:26:38 PM CET, Kevin Wolf wrote: >> > if (blk) { >> > blk_unref(blk); >> > } else { >> > +QTAILQ_REMOVE(&monitor_bdrv_states, bs, monitor_list); >> > bdrv_unref(bs); >> > } >> >> blk_unref(blk) will also unref the BDS (if there's any),

Re: [Qemu-devel] [PATCH v6 12/15] blockdev: Keep track of monitor-owned BDS

2015-11-09 Thread Max Reitz
On 09.11.2015 16:05, Alberto Garcia wrote: > On Wed 04 Nov 2015 07:57:44 PM CET, Max Reitz wrote: >> @@ -3519,11 +3537,18 @@ void qmp_x_blockdev_del(bool has_id, const char *id, >> bdrv_get_device_or_node_name(bs)); >> goto out; >> } >> + >> +if

Re: [Qemu-devel] [PATCH v6 12/15] blockdev: Keep track of monitor-owned BDS

2015-11-09 Thread Kevin Wolf
Am 09.11.2015 um 16:05 hat Alberto Garcia geschrieben: > On Wed 04 Nov 2015 07:57:44 PM CET, Max Reitz wrote: > > @@ -3519,11 +3537,18 @@ void qmp_x_blockdev_del(bool has_id, const char *id, > > bdrv_get_device_or_node_name(bs)); > > goto out; > > } > >

Re: [Qemu-devel] [PATCH v6 12/15] blockdev: Keep track of monitor-owned BDS

2015-11-09 Thread Alberto Garcia
On Wed 04 Nov 2015 07:57:44 PM CET, Max Reitz wrote: > @@ -3519,11 +3537,18 @@ void qmp_x_blockdev_del(bool has_id, const char *id, > bdrv_get_device_or_node_name(bs)); > goto out; > } > + > +if (!blk && !bs->monitor_list.tqe_prev) { > +

[Qemu-devel] [PATCH v6 12/15] blockdev: Keep track of monitor-owned BDS

2015-11-04 Thread Max Reitz
Signed-off-by: Max Reitz --- blockdev.c | 25 + include/block/block_int.h | 4 stubs/Makefile.objs| 1 + stubs/blockdev-close-all-bdrv-states.c | 5 + 4 files changed, 35 insertions(+) create mode 10