[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 12/21] block: Use BlockBackend more
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 12/21] block: Use BlockBackend more |
Date: |
Thu, 29 Jan 2015 18:12:43 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
On 01/26/2015 12:27 PM, Max Reitz wrote:
> Replace bdrv_drain_all(), bdrv_commmit_all(), bdrv_flush_all(),
> bdrv_invalidate_cache_all(), bdrv_next() and occurrences of bdrv_states
> by their BlockBackend equivalents.
>
> Signed-off-by: Max Reitz <address@hidden>
> ---
> block.c | 22 ++++++++---------
> block/block-backend.c | 8 +++----
> block/qapi.c | 13 ++++++++--
> block/snapshot.c | 3 ++-
> blockdev.c | 14 ++++++-----
> cpus.c | 7 +++---
> migration/block.c | 10 +++++---
> migration/migration.c | 4 ++--
> monitor.c | 13 ++++++----
> qemu-char.c | 3 ++-
> qemu-io.c | 2 +-
> qmp.c | 14 +++++------
> savevm.c | 66
> ++++++++++++++++++++++++++++++---------------------
> xen-mapcache.c | 3 ++-
> 14 files changed, 107 insertions(+), 75 deletions(-)
>
> +++ b/block/qapi.c
> @@ -393,15 +393,24 @@ BlockStatsList *qmp_query_blockstats(bool
> has_query_nodes,
> {
> BlockStatsList *head = NULL, **p_next = &head;
> BlockDriverState *bs = NULL;
> + BlockBackend *blk = NULL;
>
> /* Just to be safe if query_nodes is not always initialized */
> query_nodes = has_query_nodes && query_nodes;
>
> - while ((bs = query_nodes ? bdrv_next_node(bs) : bdrv_next(bs))) {
> + while (query_nodes ? (bs = bdrv_next_node(bs)) != NULL
> + : (blk = blk_next_inserted(blk)) != NULL)
Don't we still want to list empty BBs in the query (that is,
intentionally list that there are no stats because there is no medium)
rather than silently omitting them?
> @@ -348,6 +349,7 @@ static void unset_dirty_tracking(void)
> static void init_blk_migration(QEMUFile *f)
> {
> BlockDriverState *bs;
> + BlockBackend *blk = NULL;
> BlkMigDevState *bmds;
> int64_t sectors;
>
> @@ -359,7 +361,9 @@ static void init_blk_migration(QEMUFile *f)
> block_mig_state.bulk_completed = 0;
> block_mig_state.zero_blocks = migrate_zero_blocks();
>
> - for (bs = bdrv_next(NULL); bs; bs = bdrv_next(bs)) {
> + while ((blk = blk_next_inserted(blk)) != NULL) {
> + bs = blk_bs(blk);
> +
What happens if someone initiates a live migration, then inserts the
medium? It looks like this will skip over the drive that was empty at
the time the migration started.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 05/21] block: Remove per-BDS close notifiers, (continued)
- [Qemu-devel] [PATCH 05/21] block: Remove per-BDS close notifiers, Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 10/21] block: Add blk_next_inserted(), Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 02/21] quorum: Fix close path, Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 14/21] blockdev: Remove blk_hide_on_behalf_of_do_drive_del(), Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 16/21] block: Move some bdrv_*_all() functions to BB, Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 12/21] block: Use BlockBackend more, Max Reitz, 2015/01/26
- Re: [Qemu-devel] [PATCH 12/21] block: Use BlockBackend more,
Eric Blake <=
- [Qemu-devel] [PATCH 15/21] block: Make bdrv_drain_one() public, Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 11/21] block: Add blk_commit_all() and blk_invalidate_cache_all(), Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 17/21] block: Remove bdrv_states, Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 13/21] blockdev: Add list of monitor-owned BlockBackends, Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 19/21] block: Strip down bdrv_close_all(), Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 18/21] blockdev: Keep track of monitor-owned BDS, Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 20/21] iotests: Add "wait" functionality to _cleanup_qemu, Max Reitz, 2015/01/26