|
From: | Eric Blake |
Subject: | Re: [Qemu-devel] Any tutorial to read/write in qcow2 format by programming way? |
Date: | Thu, 2 Aug 2018 07:58:08 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
On 08/02/2018 01:57 AM, lampahome wrote:[Top-posting is difficult to read on technical lists; it's better to reply inline]
I have some questions about qcow2 If I have 2 img A & B, and A is backing file of B. Is the format(such as L1, L2, ref block...etc) different from A and B?
image A can be a completely different format from B (different cluster sizing, different refcount sizing, for that matter, image A doesn't even have to be qcow2). All that matters from B's perspective is that a read of any cluster not present in B is satisfied by reading the same range of guest-visible bytes from image A in whatever manner A serves up those bytes; and a write to a cluster not present in B causes a COW (copy-on-write) operation to pull in remaining data from A for any portion of the cluster not covered by the write itself. The entire block layer in qemu is a well-defined recursive interface of driver callbacks, where any particular operation calls through as few or as many block drivers as needed to either reach the data in question or determine that the data is not available.
-- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
[Prev in Thread] | Current Thread | [Next in Thread] |