[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 08/14] blockdev: Remove blk_hide_on_behalf_of
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v3 08/14] blockdev: Remove blk_hide_on_behalf_of_hmp_drive_del() |
Date: |
Wed, 17 Feb 2016 15:18:35 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 16.02.2016 um 19:08 hat Max Reitz geschrieben:
> This function first removed the BlockBackend from the blk_backends list
> and cleared its name so it would no longer be found by blk_name(); since
> blk_next() now iterates through monitor_block_backends (which the BB is
> removed from in hmp_drive_del()), this is no longer necessary.
Not clearing the name any more means that you can't create a new
BlockBackend with the same ID until the hidden BB finally goes away.
As it happens, you already can't do that with drive_add, because we also
keep the ID reserved in the QemuOpts, so it's already broken today.
However, before this patch, you can still use blockdev-add to create a
new BB with the ID of a BB that drive_del removed; after it, you get an
error:
{"error": {"class": "GenericError", "desc": "Device with id 'disk'
already exists"}}
In order to fix this, I suggested on IRC that we view the BB name as
belonging to the monitor reference logically, i.e. we add a name with
monitor_add_blk() (which would get a new ID parameter) and clear it
again in monitor_remove_blk().
> Second, bdrv_make_anon() was called on the BDS. This was intended for
> cases where the BDS was owned by that BB alone; in which case the BDS
> will no longer exist at this point thanks to the blk_remove_bs() in
> hmp_drive_del().
>
> Therefore, this function does nothing useful anymore. Remove it.
>
> Signed-off-by: Max Reitz <address@hidden>
Kevin
- [Qemu-devel] [PATCH v3 02/14] block: Use blk_next() where appropriate, (continued)
- [Qemu-devel] [PATCH v3 02/14] block: Use blk_next() where appropriate, Max Reitz, 2016/02/16
- [Qemu-devel] [PATCH v3 01/14] monitor: Use BB list for BB name completion, Max Reitz, 2016/02/16
- [Qemu-devel] [PATCH v3 03/14] block: Add blk_all_next(), Max Reitz, 2016/02/16
- [Qemu-devel] [PATCH v3 04/14] block: Add blk_name_taken(), Max Reitz, 2016/02/16
- [Qemu-devel] [PATCH v3 06/14] block: Use blk_{commit, flush}_all() consistently, Max Reitz, 2016/02/16
- [Qemu-devel] [PATCH v3 08/14] blockdev: Remove blk_hide_on_behalf_of_hmp_drive_del(), Max Reitz, 2016/02/16
- Re: [Qemu-devel] [PATCH v3 08/14] blockdev: Remove blk_hide_on_behalf_of_hmp_drive_del(),
Kevin Wolf <=
- [Qemu-devel] [PATCH v3 05/14] block: Add blk_commit_all(), Max Reitz, 2016/02/16
- [Qemu-devel] [PATCH v3 09/14] block: Move some bdrv_*_all() functions to BB, Max Reitz, 2016/02/16
- [Qemu-devel] [PATCH v3 07/14] blockdev: Add list of monitor-owned BlockBackends, Max Reitz, 2016/02/16