qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 5/5] replay: introduce block devices record/r


From: Pavel Dovgalyuk
Subject: Re: [Qemu-devel] [PATCH v3 5/5] replay: introduce block devices record/replay
Date: Thu, 10 Mar 2016 09:15:36 +0300

> From: Kevin Wolf [mailto:address@hidden
> Am 01.03.2016 um 12:08 hat Pavel Dovgalyuk geschrieben:
> > This patch introduces block driver that implement recording
> > and replaying of block devices' operations.
> > All block completion operations are added to the queue.
> > Queue is flushed at checkpoints and information about processed requests
> > is recorded to the log. In replay phase the queue is matched with
> > events read from the log. Therefore block devices requests are processed
> > deterministically.
> >
> > Signed-off-by: Pavel Dovgalyuk <address@hidden>
> 
> I like this new version much better than the old one. :-)

Thanks for reviewing!

> > +static int blkreplay_open(BlockDriverState *bs, QDict *options, int flags,
> > +                          Error **errp)
> > +{
> > +    Error *local_err = NULL;
> > +    int ret;
> > +
> > +    /* Open the image file */
> > +    bs->file = bdrv_open_child(NULL, options, "image",
> > +                               bs, &child_file, false, &local_err);
> > +    if (local_err) {
> > +        ret = -EINVAL;
> > +        error_propagate(errp, local_err);
> > +        goto fail;
> > +    }
> > +
> > +    ret = 0;
> > +fail:
> > +    if (ret < 0) {
> > +        bdrv_unref_child(bs, bs->file);
> 
> This is unnecessary because in error cases, bdrv_open_child() returns
> NULL. On the other hand, bdrv_unref_child() accepts a NULL child and
> just doesn't do anything then, so it's harmless.

Right, but this may be useful in case of future changes (if something else
will be initialized here).

Pavel Dovgalyuk




reply via email to

[Prev in Thread] Current Thread [Next in Thread]