qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Zhi Hui Li <zhihuili@linux.vnet.ibm.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	zhihuili@cn.ibm.com,
	Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
	QEMU-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] About the snapshot
Date: Tue, 6 Dec 2011 09:40:26 +0000	[thread overview]
Message-ID: <CAJSP0QWnt2At2-wcXCi82ugZmry4wHe=ZpSYtJbRwh09B5bjUw@mail.gmail.com> (raw)
In-Reply-To: <4EDDDB5A.8020102@linux.vnet.ibm.com>

On Tue, Dec 6, 2011 at 9:07 AM, Zhi Hui Li <zhihuili@linux.vnet.ibm.com> wrote:
>
> 1) :
>
> for example:
>
> BDRVQcowState *s = bs->opaque;
>
> s->snapshots
> s->nb_snapshots
>
>
> 1:use the command:   qemu-img snapshot ./test.qcow2  -c aa
> the memory of the s->snapshot don't free,
> if the s->nb_snapshots is large, Does it have some problems.
>
> 2: use the command:  qemu-system-x86_64  ./test.qcow2 -snapshot
> when the program ends, Does it need to free the s->snapshots ?

These two commands are unrelated.  QEMU uses the term "snapshot" for
several different features:

1. qemu-img snapshot refers to "internal snapshots" that are contained
within qcow2 image files.  The savevm/loadvm/delvm monitor commands
operate on internal snapshots.

2. qemu -snapshot refers to a temporary qcow2 image file created to
buffer any data that the guest writes.  When QEMU exits your disk
image is not modified and the temporary qcow2 file is deleted.  You
can also apply the buffer to the disk image using the "commit" monitor
command.

> 2):
> in the function of
> qcow2_update_snapshot_refcount
>
> it has some "  goto fail  ";
> if the function runs some times, then something makes it goto fail,
> I am not sure whether it will make the refcount  incorrect.

When an error occurs its possible that refcount leaks are introduced
(the refcount was increment but will never be used), but we should
never decrement a reference that is still in use.

Please be more specific about the problem so that Kevin or I can take a look.

Stefan

  reply	other threads:[~2011-12-06  9:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-06  9:07 [Qemu-devel] About the snapshot Zhi Hui Li
2011-12-06  9:40 ` Stefan Hajnoczi [this message]
2011-12-06 10:01   ` Zhi Hui Li
2011-12-06 10:33     ` Stefan Hajnoczi
2011-12-06 14:55       ` Zhi Hui Li
2011-12-06 15:35         ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJSP0QWnt2At2-wcXCi82ugZmry4wHe=ZpSYtJbRwh09B5bjUw@mail.gmail.com' \
    --to=stefanha@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@linux.vnet.ibm.com \
    --cc=zhihuili@cn.ibm.com \
    --cc=zhihuili@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).