----- Original Message ----- > From: "Federico Simoncelli" <[email protected]> > To: [email protected] > Cc: [email protected], [email protected], [email protected], > [email protected], "Federico Simoncelli" > <[email protected]> > Sent: Wednesday, February 29, 2012 1:28:21 PM > Subject: [PATCHv3] Add blkmirror block driver > > Mirrored writes are used by live block copy. > > Signed-off-by: Marcelo Tosatti <[email protected]> > Signed-off-by: Federico Simoncelli <[email protected]> > --- > Makefile.objs | 2 +- > block/blkmirror.c | 255 > ++++++++++++++++++++++++++++++++++++++++++++++++++++ > cutils.c | 30 ++++++ > docs/blkmirror.txt | 15 +++ > qemu-common.h | 1 + > 5 files changed, 302 insertions(+), 1 deletions(-) > create mode 100644 block/blkmirror.c > create mode 100644 docs/blkmirror.txt > > diff --git a/block/blkmirror.c b/block/blkmirror.c > new file mode 100644 > index 0000000..c98b162 > --- /dev/null > +++ b/block/blkmirror.c [...] > + if (!drv1 || !drv2) { > + ret = -EINVAL; > + goto out; > + } > + > + ret = bdrv_open(m->bs[0], tok[1], flags, drv1); > + if (ret < 0) { > + goto out; > + } > + > + ret = bdrv_open(m->bs[0], tok[3], flags, drv2); > + if (ret < 0) { > + goto out; > + }
There's a small mistake here, the second one is m->bs[1]. -- Federico
