> From: Kevin Wolf [mailto:kw...@redhat.com] > 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 <pavel.dovga...@ispras.ru> > > 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