|
From: | Alberto Garcia |
Subject: | Re: [Qemu-devel] [PATCH v2 1/6] block: skip implicit nodes in snapshots, blockjobs |
Date: | Mon, 21 Aug 2017 16:44:43 +0200 |
User-agent: | Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Tue 15 Aug 2017 03:50:12 PM CEST, Manos Pitsidianakis wrote: >>> +static inline BlockDriverState *child_bs(BlockDriverState *bs) >>> +{ >>> + BdrvChild *child = QLIST_FIRST(&bs->children); >>> + assert(child && !QLIST_NEXT(child, next)); >>> + return child->bs; >>> +} >> >>This aborts if the bs has a number of children != 1. That's not >>something that I would expect from a function named like that. >> >>Considering that you're only using it in bdrv_get_first_explicit(), >>why don't you simply move the code there? > > It felt useful to have a function that also returns file->bs (we have > backing_bs() already) instead of doing backing_bs(bs) ? : file_bs(bs) >> >>The other question is of course whether we can rely for the future on >>the assumption that implicit nodes only have one children. > > This is only to get either bs->backing or bs->file (we can't have both > anyway). You can have other children (see Quorum for example). Berto
[Prev in Thread] | Current Thread | [Next in Thread] |