[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2 v2] Add blkmirror block driver
From: |
Federico Simoncelli |
Subject: |
Re: [Qemu-devel] [PATCH 1/2 v2] Add blkmirror block driver |
Date: |
Mon, 27 Feb 2012 04:17:12 -0500 (EST) |
----- Original Message -----
> From: "Luiz Capitulino" <address@hidden>
> To: "Federico Simoncelli" <address@hidden>
> Cc: address@hidden, address@hidden, address@hidden, address@hidden,
> address@hidden
> Sent: Friday, February 24, 2012 7:17:22 PM
> Subject: Re: [PATCH 1/2 v2] Add blkmirror block driver
>
> On Fri, 24 Feb 2012 16:49:03 +0000
> Federico Simoncelli <address@hidden> wrote:
>
> > + /* Parse the raw image filename */
> > + filename2 = g_malloc(strlen(filename)+1);
> > + escape = 0;
> > + for (i = n = 0; i < strlen(filename); i++) {
> > + if (!escape && filename[i] == ':') {
> > + break;
> > + }
> > + if (!escape && filename[i] == '\\') {
> > + escape = 1;
> > + } else {
> > + escape = 0;
> > + }
> > +
> > + if (!escape) {
> > + filename2[n++] = filename[i];
> > + }
> > + }
> > + filename2[n] = '\0';
>
> You're escaping only the first image name string, is that
> intentional?
Yes, it was also documented here by Marcelo:
> > diff --git a/docs/blkmirror.txt b/docs/blkmirror.txt
> > new file mode 100644
> > index 0000000..cf73f3f
> > --- /dev/null
> > +++ b/docs/blkmirror.txt
> > @@ -0,0 +1,16 @@
> > +Block mirror driver
> > +-------------------
> > +
> > +This driver will mirror writes to two distinct images.
> > +It's used internally by live block copy.
> > +
> > +Format
> > +------
> > +
> > +blkmirror:/image1.img:/image2.img
> > +
> > +'\' (backslash) can be used to escape colon processing
> > +as a separator, in the first image filename.
> > +Backslashes themselves also can be escaped as '\\'.
> > +
> > +
Anyway this format is encapsulated by blockdev-migrate.
--
Federico