From: Eric Blake <eblake@redhat.com>
To: Max Reitz <mreitz@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 12/21] block: Use BlockBackend more
Date: Thu, 29 Jan 2015 18:12:43 -0700 [thread overview]
Message-ID: <54CADA8B.8010707@redhat.com> (raw)
In-Reply-To: <1422300468-16216-13-git-send-email-mreitz@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2554 bytes --]
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 <mreitz@redhat.com>
> ---
> 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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2015-01-30 1:12 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-26 19:27 [Qemu-devel] [PATCH 00/20] block: Rework bdrv_close_all() Max Reitz
2015-01-26 19:27 ` [Qemu-devel] [PATCH 01/21] block: Guard remaining unsafe blk_bs() callers Max Reitz
2015-01-28 22:14 ` Eric Blake
2015-01-26 19:27 ` [Qemu-devel] [PATCH 02/21] quorum: Fix close path Max Reitz
2015-01-28 22:16 ` Eric Blake
2015-01-26 19:27 ` [Qemu-devel] [PATCH 03/21] block: Add bdrv_close_all() notifiers Max Reitz
2015-01-28 22:24 ` Eric Blake
2015-01-26 19:27 ` [Qemu-devel] [PATCH 04/21] block: Add bdrv_close_all() handlers Max Reitz
2015-01-26 20:40 ` Paolo Bonzini
2015-01-26 20:43 ` Max Reitz
2015-01-26 21:10 ` Paolo Bonzini
2015-01-26 21:13 ` Max Reitz
2015-01-26 21:22 ` Paolo Bonzini
2015-01-28 22:05 ` Eric Blake
2015-01-28 22:56 ` Max Reitz
2015-01-29 10:59 ` Paolo Bonzini
2015-01-28 22:44 ` Eric Blake
2015-01-28 22:51 ` Max Reitz
2015-01-26 19:27 ` [Qemu-devel] [PATCH 05/21] block: Remove per-BDS close notifiers Max Reitz
2015-01-29 23:44 ` Eric Blake
2015-01-26 19:27 ` [Qemu-devel] [PATCH 06/21] block: Use blk_remove_bs() in blk_delete() Max Reitz
2015-01-29 23:45 ` Eric Blake
2015-01-26 19:27 ` [Qemu-devel] [PATCH 07/21] blockdev: Use blk_remove_bs() in do_drive_del() Max Reitz
2015-01-29 23:46 ` Eric Blake
2015-01-26 19:27 ` [Qemu-devel] [PATCH 08/21] block: Make bdrv_close() static Max Reitz
2015-01-29 23:47 ` Eric Blake
2015-01-26 19:27 ` [Qemu-devel] [PATCH 09/21] block: Add blk_name_taken() Max Reitz
2015-01-29 23:51 ` Eric Blake
2015-01-26 19:27 ` [Qemu-devel] [PATCH 10/21] block: Add blk_next_inserted() Max Reitz
2015-01-29 23:52 ` Eric Blake
2015-01-26 19:27 ` [Qemu-devel] [PATCH 11/21] block: Add blk_commit_all() and blk_invalidate_cache_all() Max Reitz
2015-01-29 23:54 ` Eric Blake
2015-01-26 19:27 ` [Qemu-devel] [PATCH 12/21] block: Use BlockBackend more Max Reitz
2015-01-30 1:12 ` Eric Blake [this message]
2015-02-06 21:43 ` Max Reitz
2015-01-26 19:27 ` [Qemu-devel] [PATCH 13/21] blockdev: Add list of monitor-owned BlockBackends Max Reitz
2015-01-30 17:43 ` Eric Blake
2015-01-26 19:27 ` [Qemu-devel] [PATCH 14/21] blockdev: Remove blk_hide_on_behalf_of_do_drive_del() Max Reitz
2015-01-30 17:44 ` Eric Blake
2015-01-26 19:27 ` [Qemu-devel] [PATCH 15/21] block: Make bdrv_drain_one() public Max Reitz
2015-01-30 17:45 ` Eric Blake
2015-01-26 19:27 ` [Qemu-devel] [PATCH 16/21] block: Move some bdrv_*_all() functions to BB Max Reitz
2015-01-26 19:27 ` [Qemu-devel] [PATCH 17/21] block: Remove bdrv_states Max Reitz
2015-01-26 19:27 ` [Qemu-devel] [PATCH 18/21] blockdev: Keep track of monitor-owned BDS Max Reitz
2015-01-26 19:27 ` [Qemu-devel] [PATCH 19/21] block: Strip down bdrv_close_all() Max Reitz
2015-01-26 19:27 ` [Qemu-devel] [PATCH 20/21] iotests: Add "wait" functionality to _cleanup_qemu Max Reitz
2015-01-26 19:27 ` [Qemu-devel] [PATCH 21/21] iotests: Add test for multiple BB on BDS tree Max Reitz
2015-01-26 19:29 ` [Qemu-devel] [PATCH 00/20] block: Rework bdrv_close_all() Max Reitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54CADA8B.8010707@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).