qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [Questions] Several questions about incremental backup
@ 2016-01-25  7:35 Rudy Zhang
  2016-01-25 19:19 ` John Snow
  0 siblings, 1 reply; 3+ messages in thread
From: Rudy Zhang @ 2016-01-25  7:35 UTC (permalink / raw)
  To: qemu-devel, qemu-block, Fam Zheng, John Snow

I am reading and testing the function: incremental backup in qemu-2.5.
But I have serveral questions about it.
1. If I want to start image backup, at first I need to start full mode backup
   and then, add a bitmap to trace io, next start incremental backup via the
   bitmap before we added. But when the first incremental backup over, it will
   abdicate the bitmap. How can I start the second incremental backup without
   the bitmap to trace io? I don't know why abdicate the bitmap.
   Is it only an incremental backup?
2. When abdicating the bitmap, it seems leak memory about bitmap->successor.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [Questions] Several questions about incremental backup
  2016-01-25  7:35 [Qemu-devel] [Questions] Several questions about incremental backup Rudy Zhang
@ 2016-01-25 19:19 ` John Snow
  2016-01-26  2:33   ` Rudy Zhang
  0 siblings, 1 reply; 3+ messages in thread
From: John Snow @ 2016-01-25 19:19 UTC (permalink / raw)
  To: Rudy Zhang, qemu-devel, qemu-block, Fam Zheng



On 01/25/2016 02:35 AM, Rudy Zhang wrote:
> I am reading and testing the function: incremental backup in qemu-2.5.
> But I have serveral questions about it.
> 1. If I want to start image backup, at first I need to start full mode backup
>    and then, add a bitmap to trace io, next start incremental backup via the
>    bitmap before we added. But when the first incremental backup over, it will
>    abdicate the bitmap. How can I start the second incremental backup without
>    the bitmap to trace io? I don't know why abdicate the bitmap.
>    Is it only an incremental backup?

Check out https://github.com/qemu/qemu/blob/master/docs/bitmaps.md for
some examples of workflow, hopefully this is useful.

When you create a new bitmap object, it's useful to sync it to a full
backup of some kind so that it's useful, you can do this several ways.
Either QMP commands while the VM is paused, or QMP transactions when the
VM is running. See /docs/bitmaps.md for more information.

When you issue a backup command using an incremental bitmap object, QEMU
actually creates a new bitmap to replace the one you are using right away.

Before a backup: [bitmap0]
During a backup: [bitmap0 <-- "successor"]

The bitmap you create is given an anonymous child bitmap (via the
successor pointer) that records new writes while the backup is in
progress. Two things can happen at this point:

(1) The backup succeeds

The "abdicate" function is run and "bitmap0" is deleted and the
anonymous child becomes the new "bitmap0."

(2) The backup fails

It's not safe to delete bitmap0, so QEMU merges the anonymous child back
into bitmap0.


This means that after the backup you'll always have "bitmap0" attached
to the same drive.

It shouldn't be necessary to manually create new incremental bitmap objects.

> 2. When abdicating the bitmap, it seems leak memory about bitmap->successor.
> 

I guess this function looks very suspicious, but what's happening in
actuality is the successor inherits the name of the parent (e.g.
"bitmap0") and then the parent is freed/deleted.

This "promotes" the successor to the new standalone bitmap object,
because both the parent and the successor are part of the list of
bitmaps attached to the drive object -- we did not lose our reference to
the successor.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [Questions] Several questions about incremental backup
  2016-01-25 19:19 ` John Snow
@ 2016-01-26  2:33   ` Rudy Zhang
  0 siblings, 0 replies; 3+ messages in thread
From: Rudy Zhang @ 2016-01-26  2:33 UTC (permalink / raw)
  To: John Snow, qemu-devel, qemu-block, Fam Zheng



On 16/1/26 上午3:19, John Snow wrote:
> 
> 
> On 01/25/2016 02:35 AM, Rudy Zhang wrote:
>> I am reading and testing the function: incremental backup in qemu-2.5.
>> But I have serveral questions about it.
>> 1. If I want to start image backup, at first I need to start full mode backup
>>    and then, add a bitmap to trace io, next start incremental backup via the
>>    bitmap before we added. But when the first incremental backup over, it will
>>    abdicate the bitmap. How can I start the second incremental backup without
>>    the bitmap to trace io? I don't know why abdicate the bitmap.
>>    Is it only an incremental backup?
> 
> Check out https://github.com/qemu/qemu/blob/master/docs/bitmaps.md for
> some examples of workflow, hopefully this is useful.
> 
> When you create a new bitmap object, it's useful to sync it to a full
> backup of some kind so that it's useful, you can do this several ways.
> Either QMP commands while the VM is paused, or QMP transactions when the
> VM is running. See /docs/bitmaps.md for more information.
> 
> When you issue a backup command using an incremental bitmap object, QEMU
> actually creates a new bitmap to replace the one you are using right away.
> 
> Before a backup: [bitmap0]
> During a backup: [bitmap0 <-- "successor"]
> 
> The bitmap you create is given an anonymous child bitmap (via the
> successor pointer) that records new writes while the backup is in
> progress. Two things can happen at this point:
> 
> (1) The backup succeeds
> 
> The "abdicate" function is run and "bitmap0" is deleted and the
> anonymous child becomes the new "bitmap0."
> 
> (2) The backup fails
> 
> It's not safe to delete bitmap0, so QEMU merges the anonymous child back
> into bitmap0.
> 
> 
> This means that after the backup you'll always have "bitmap0" attached
> to the same drive.
> 
> It shouldn't be necessary to manually create new incremental bitmap objects.
> 
>> 2. When abdicating the bitmap, it seems leak memory about bitmap->successor.
>>
> 
> I guess this function looks very suspicious, but what's happening in
> actuality is the successor inherits the name of the parent (e.g.
> "bitmap0") and then the parent is freed/deleted.
> 
> This "promotes" the successor to the new standalone bitmap object,
> because both the parent and the successor are part of the list of
> bitmaps attached to the drive object -- we did not lose our reference to
> the successor.
> 

I carefully read the code again, and understand the implementation.
Thank you very much.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-26  2:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-25  7:35 [Qemu-devel] [Questions] Several questions about incremental backup Rudy Zhang
2016-01-25 19:19 ` John Snow
2016-01-26  2:33   ` Rudy Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).