All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: lampahome <pahome.chen@mirlab.org>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Any tutorial to read/write in qcow2 format by programming way?
Date: Tue, 31 Jul 2018 07:16:26 -0500	[thread overview]
Message-ID: <ac7d377c-db69-c4ee-3d90-94700259db56@redhat.com> (raw)
In-Reply-To: <CAB3eZfuTdzecv2ParQmbiO6sjrUJ7tpV0HEo_2=2cYC890mOCg@mail.gmail.com>

On 07/31/2018 04:44 AM, lampahome wrote:
> As titled
> 
> I learn some info about qcow2 and tried to write some data and make it
> qualified for qcow2 format.
> 
> I do it and mount through qemu-nbd successfully.
> 
> But I don't know how taking snapshot and backing file works in programming
> way.
> 
> Can someone tell me some tutorial to know or code snippets to learn?

No real tutorial other than reading the code and the file format 
specification (it's open source, after all).  See:
block/qcow2*
docs/interop/qcow2.txt

Other potential resources to study:

https://github.com/jnsnow/qcheck.git

implements a rudimentary qcow2 image checker, although it still does not 
handle incremental snapshots. Then again, if you want to learn the qcow2 
image format, enhancing that tool would be a great asset in your quest.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

  reply	other threads:[~2018-07-31 12:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-31  9:44 [Qemu-devel] Any tutorial to read/write in qcow2 format by programming way? lampahome
2018-07-31 12:16 ` Eric Blake [this message]
2018-08-02  6:57   ` lampahome
2018-08-02 12:58     ` Eric Blake

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=ac7d377c-db69-c4ee-3d90-94700259db56@redhat.com \
    --to=eblake@redhat.com \
    --cc=pahome.chen@mirlab.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.