From: Stefan Hajnoczi <stefanha@redhat.com>
To: Manos Pitsidianakis <el13635@mail.ntua.gr>,
Stefan Hajnoczi <stefanha@gmail.com>,
qemu-devel <qemu-devel@nongnu.org>, Kevin Wolf <kwolf@redhat.com>,
qemu-block <qemu-block@nongnu.org>,
Alberto Garcia <berto@igalia.com>
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v2 1/2] block: use internal filter node in backup
Date: Thu, 17 Aug 2017 15:06:49 +0100 [thread overview]
Message-ID: <20170817140649.GA3677@stefanha-x1.localdomain> (raw)
In-Reply-To: <20170816201144.x3uvqrmptacuvubz@postretch>
[-- Attachment #1: Type: text/plain, Size: 2752 bytes --]
On Wed, Aug 16, 2017 at 11:11:44PM +0300, Manos Pitsidianakis wrote:
> On Wed, Aug 16, 2017 at 02:25:44PM +0100, Stefan Hajnoczi wrote:
> > On Tue, Aug 15, 2017 at 11:18:53AM +0300, Manos Pitsidianakis wrote:
> > > @@ -3142,7 +3174,7 @@ static bool should_update_child(BdrvChild *c, BlockDriverState *to)
> > > return false;
> > > }
> > >
> > > - if (c->role == &child_backing) {
> > > + if (c->role == &child_backing || c->role == &child_file) {
> > > /* If @from is a backing file of @to, ignore the child to avoid
> > > * creating a loop. We only want to change the pointer of other
> > > * parents. */
> >
> > This may have unwanted side-effects. I think you're using is so that
> > bdrv_set_file() + bdrv_replace_node() does not create a loop in the
> > graph. That is okay if there is only one parent with child_file. If
> > there are multiple parents with that role then it's not clear to me that
> > they should all be skipped.
>
> I am afraid I don't understand what you're saying. What is the difference
> with the child_backing scenario here? In both cases we should update all
> from->parents children unless they also happen to be a child of `to`. If
> there are multiple parents with child_file, they are not skipped except for
> the ones where `to` is the parent.
Okay, I'll have to look at this again. Thanks!
> > > +static BlockDriver backup_top = {
> > > + .format_name = "backup-top",
> > > + .instance_size = sizeof(BackupBlockJob *),
> > > +
> > > + .bdrv_open = backup_top_open,
> >
> > .bdrv_open may be NULL. There's no need to define this function.
> >
> > > + .bdrv_close = backup_top_close,
> > > +
> > > + .bdrv_co_flush = backup_top_co_flush,
> > > + .bdrv_co_preadv = backup_top_co_preadv,
> > > + .bdrv_co_pwritev = backup_top_co_pwritev,
> > > + .bdrv_co_pwrite_zeroes = backup_top_co_pwrite_zeroes,
> > > + .bdrv_co_pdiscard = backup_top_co_pdiscard,
> > > +
> > > + .bdrv_getlength = backup_top_getlength,
> > > + .bdrv_child_perm = bdrv_filter_default_perms,
> > > + .bdrv_recurse_is_first_non_filter = backup_recurse_is_first_non_filter,
> >
> > I think this is dead code since .is_filter = true. It will not be
> > called.
>
> bdrv_recurse_is_first_non_filter() is only called if is_filter is true and
> the driver implements it to allow recursion to its children.
You are right, I misread the code.
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
next prev parent reply other threads:[~2017-08-17 14:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-15 8:18 [Qemu-devel] [PATCH v2 0/2] add internal backup job and write-threshold filter drivers Manos Pitsidianakis
2017-08-15 8:18 ` [Qemu-devel] [PATCH v2 1/2] block: use internal filter node in backup Manos Pitsidianakis
2017-08-16 13:25 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-08-16 20:11 ` Manos Pitsidianakis
2017-08-17 14:06 ` Stefan Hajnoczi [this message]
2017-10-02 12:45 ` [Qemu-devel] " Kevin Wolf
2017-08-15 8:18 ` [Qemu-devel] [PATCH v2 2/2] block: add filter driver to block/write-threshold.c Manos Pitsidianakis
2017-10-02 12:52 ` 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=20170817140649.GA3677@stefanha-x1.localdomain \
--to=stefanha@redhat.com \
--cc=berto@igalia.com \
--cc=el13635@mail.ntua.gr \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.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).