All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, berto@igalia.com, qemu-devel@nongnu.org,
	jcody@redhat.com, armbru@redhat.com, mreitz@redhat.com,
	stefanha@redhat.com, famz@redhat.com
Subject: [Qemu-devel] [PATCH v3 12/16] block: Introduce parents list
Date: Fri,  9 Oct 2015 14:15:37 +0200	[thread overview]
Message-ID: <1444392941-28704-13-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1444392941-28704-1-git-send-email-kwolf@redhat.com>

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
---
 block.c                   | 3 +++
 include/block/block_int.h | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/block.c b/block.c
index a2d6238..980437f 100644
--- a/block.c
+++ b/block.c
@@ -1090,6 +1090,7 @@ static BdrvChild *bdrv_attach_child(BlockDriverState *parent_bs,
     };
 
     QLIST_INSERT_HEAD(&parent_bs->children, child, next);
+    QLIST_INSERT_HEAD(&child_bs->parents, child, next_parent);
 
     return child;
 }
@@ -1097,6 +1098,7 @@ static BdrvChild *bdrv_attach_child(BlockDriverState *parent_bs,
 void bdrv_detach_child(BdrvChild *child)
 {
     QLIST_REMOVE(child, next);
+    QLIST_REMOVE(child, next_parent);
     g_free(child);
 }
 
@@ -2038,6 +2040,7 @@ static void bdrv_move_reference_fields(BlockDriverState *bs_dest,
     /* keep the same entry in bdrv_states */
     bs_dest->device_list = bs_src->device_list;
     bs_dest->blk = bs_src->blk;
+    bs_dest->parents = bs_src->parents;
 
     memcpy(bs_dest->op_blockers, bs_src->op_blockers,
            sizeof(bs_dest->op_blockers));
diff --git a/include/block/block_int.h b/include/block/block_int.h
index cfcae52..52ea7c0 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -339,6 +339,7 @@ struct BdrvChild {
     BlockDriverState *bs;
     const BdrvChildRole *role;
     QLIST_ENTRY(BdrvChild) next;
+    QLIST_ENTRY(BdrvChild) next_parent;
 };
 
 /*
@@ -445,6 +446,7 @@ struct BlockDriverState {
      * parent node of this node. */
     BlockDriverState *inherits_from;
     QLIST_HEAD(, BdrvChild) children;
+    QLIST_HEAD(, BdrvChild) parents;
 
     QDict *options;
     BlockdevDetectZeroesOptions detect_zeroes;
-- 
1.8.3.1

  parent reply	other threads:[~2015-10-09 12:16 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-09 12:15 [Qemu-devel] [PATCH v3 00/16] block: Get rid of bdrv_swap() Kevin Wolf
2015-10-09 12:15 ` [Qemu-devel] [PATCH v3 01/16] block: Introduce BDS.file_child Kevin Wolf
2015-10-13  0:43   ` Jeff Cody
2015-10-09 12:15 ` [Qemu-devel] [PATCH v3 02/16] vmdk: Use BdrvChild instead of BDS for references to extents Kevin Wolf
2015-10-13  0:55   ` Jeff Cody
2015-10-09 12:15 ` [Qemu-devel] [PATCH v3 03/16] blkverify: Convert s->test_file to BdrvChild Kevin Wolf
2015-10-13  0:57   ` Jeff Cody
2015-10-09 12:15 ` [Qemu-devel] [PATCH v3 04/16] quorum: Convert " Kevin Wolf
2015-10-13  0:58   ` Jeff Cody
2015-10-09 12:15 ` [Qemu-devel] [PATCH v3 05/16] block: Convert bs->file " Kevin Wolf
2015-10-13  1:33   ` Jeff Cody
2015-10-13  8:59     ` Kevin Wolf
2015-10-09 12:15 ` [Qemu-devel] [PATCH v3 06/16] block: Remove bdrv_open_image() Kevin Wolf
2015-10-13  1:33   ` Jeff Cody
2015-10-09 12:15 ` [Qemu-devel] [PATCH v3 07/16] block: Convert bs->backing_hd to BdrvChild Kevin Wolf
2015-10-12 13:07   ` Alberto Garcia
2015-10-12 16:55   ` Max Reitz
2015-10-13  1:53   ` Jeff Cody
2015-10-13  8:31     ` Kevin Wolf
2015-10-09 12:15 ` [Qemu-devel] [PATCH v3 08/16] block: Manage backing file references in bdrv_set_backing_hd() Kevin Wolf
2015-10-12 13:29   ` Alberto Garcia
2015-10-12 17:13   ` Max Reitz
2015-10-09 12:15 ` [Qemu-devel] [PATCH v3 09/16] block: Split bdrv_move_feature_fields() Kevin Wolf
2015-10-12 13:47   ` Alberto Garcia
2015-10-09 12:15 ` [Qemu-devel] [PATCH v3 10/16] block/io: Make bdrv_requests_pending() public Kevin Wolf
2015-10-09 12:15 ` [Qemu-devel] [PATCH v3 11/16] block-backend: Add blk_set_bs() Kevin Wolf
2015-10-09 12:15 ` Kevin Wolf [this message]
2015-10-09 12:15 ` [Qemu-devel] [PATCH v3 13/16] block: Implement bdrv_append() without bdrv_swap() Kevin Wolf
2015-10-12 14:27   ` Alberto Garcia
2015-10-13  8:39     ` Kevin Wolf
2015-10-13  9:01       ` Alberto Garcia
2015-10-09 12:15 ` [Qemu-devel] [PATCH v3 14/16] blockjob: Store device name at job creation Kevin Wolf
2015-10-09 12:15 ` [Qemu-devel] [PATCH v3 15/16] block: Add and use bdrv_replace_in_backing_chain() Kevin Wolf
2015-10-09 12:15 ` [Qemu-devel] [PATCH v3 16/16] block: Remove bdrv_swap() Kevin Wolf
2015-10-13 10:25 ` [Qemu-devel] [PATCH v3 00/16] block: Get rid of bdrv_swap() Stefan Hajnoczi
2015-10-13 11:18 ` Kevin Wolf

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=1444392941-28704-13-git-send-email-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berto@igalia.com \
    --cc=famz@redhat.com \
    --cc=jcody@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.