qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V4 3/4] Add backing drive while performing backu


From: Fam Zheng
Subject: Re: [Qemu-devel] [PATCH V4 3/4] Add backing drive while performing backup.
Date: Fri, 19 Jul 2013 09:13:39 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, 07/18 15:13, Paolo Bonzini wrote:
> Il 18/07/2013 08:39, Fam Zheng ha scritto:
> > On Wed, 07/17 13:04, Ian Main wrote:
> >> This patch adds the original source drive as a backing drive to our target
> >> image so that the target image will appear complete during backup.  This
> >> is especially useful for SYNC_MODE_NONE as it allows export via NBD to
> >> have a complete point-in-time snapshot available for export.
> >>
> >> Signed-off-by: Ian Main <address@hidden>
> >> ---
> >>  block/backup.c | 13 +++++++++++++
> >>  1 file changed, 13 insertions(+)
> >>
> >> diff --git a/block/backup.c b/block/backup.c
> >> index 68abd23..e086e76 100644
> >> --- a/block/backup.c
> >> +++ b/block/backup.c
> >> @@ -323,6 +323,10 @@ static void coroutine_fn backup_run(void *opaque)
> >>  
> >>      hbitmap_free(job->bitmap);
> >>  
> >> +    /* Set the target backing drive back to NULL before calling delete or
> >> +     * it will also delete the underlying drive. */
> >> +    target->backing_hd = NULL;
> >> +
> >>      bdrv_iostatus_disable(target);
> >>      bdrv_delete(target);
> >>  
> >> @@ -362,6 +366,15 @@ void backup_start(BlockDriverState *bs, 
> >> BlockDriverState *target,
> >>          return;
> >>      }
> >>  
> >> +    /* Manually set the backing hd to be the backup source drive so
> >> +     * that all reads done while we are backing up will be passed
> >> +     * on to the original source drive.  This allows reading from the
> >> +     * image while the backup is in progress, or in the case of
> >> +     * SYNC_MODE_NONE allows a complete image to be present for export.
> >> +     * Note that we do this for all modes including SYNC_MODE_TOP as
> >> +     * even then it allows on-the-fly reading. */
> >> +    target->backing_hd = bs;
> >> +
> > 
> > Also set target->backing_file and target->backing_format here? Paolo?
> 
> I don't think so, it is temporary while the job runs so that the NBD
> server can already return the actual data.

OK.

For NBD export, it's also going to have a name, to be used with
nbd_server_add. So should we call bdrv_set_in_use() here to protect
target from being used elsewhere?

-- 
Fam



reply via email to

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