History | View | Annotate | Download (7.8 kB)
qcow2: implement bdrv_invalidate_cache (v2)
We don't reopen the actual file, but instead invoke the close and open routines.We specifically ignore the backing file since it's contents are read-only andtherefore immutable.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qcow2: removed unused depends_on field
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qcow2: remove unused qcow2_create_refcount_update function
qcow2: Use coroutines
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qcow2: Use Qcow2Cache in writeback mode during loadvm/savevm
In snapshotting there is no guest involved, so we can safely use a writebackmode and do the flushes in the right place (i.e. at the very end). Thisimproves the time that creating/restoring an internal snapshot takes with an...
qemu-img create: Fix displayed default cluster size
When not specifying a cluster size on the command line, qemu-img printeda cluster size of 0:
Formatting '/tmp/test.qcow2', fmt=qcow2 size=67108864 encryption=off cluster_size=0
This patch adds the default cluster size to the QEMUOptionParameter list, so...
qcow2: Add bdrv_discard support
This adds a bdrv_discard function to qcow2 that frees the discarded clusters.It does not yet pass the discard on to the underlying file system driver, butthe space can be reused by future writes to the image.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
qcow2: Use QcowCache
Use the new functions of qcow2-cache.c for everything that works on refcountblock and L2 tables.
qcow2: Batch flushes for COW
qcow2 calls bdrv_flush() after performing COW in order to ensure that theL2 table change is never written before the copy is safe on disk. Now that theL2 table is cached, we can wait with flushing until we write out the next L2...
qcow2: Add QcowCache
This adds some new cache functions to qcow2 which can be used for cachingrefcount blocks and L2 tables. When used with cache=writethrough they worklike the old caching code which is spread all over qcow2, so for this case wehave merely a cleanup....
block: Remove unused s->hd in various drivers
All drivers use bs->file instead of s->hd for quite a while now, so it's timeto remove s->hd.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qcow2: Support exact L1 table growth
The L1 table grow operation includes a size calculation that bumps upthe new L1 table size in order to anticipate the size needs of vmstatedata. This helps reduce the number of times that the L1 table has to begrown when vmstate data is appended....
Copy snapshots out of QCOW2 disk
In order to backup snapshots, created from QCOW2 iamge, we want to copy snapshots out of QCOW2 disk to a seperate storage.The following patch adds a new option in "qemu-img": qemu-img convert -f qcow2 -O qcow2 -s snapshot_name src_img bck_img....
qcow2: Avoid bounce buffers for AIO read requests
qcow2 used to use bounce buffers for any AIO requests. This does not only implyunnecessary copying, but also unbounded allocations which should be avoided.
This patch removes bounce buffers from the normal AIO read path, and constrains...
qcow2/vdi: Change check to distinguish error cases
This distinguishes between harmless leaks and real corruption. Hopefully usersbetter understand what qemu-img check wants to tell them.
qcow2: Allow qcow2_get_cluster_offset to return errors
qcow2_get_cluster_offset() looks up a given virtual disk offset and returns theoffset of the corresponding cluster in the image file. Errors (e.g. L2 tablecan't be read) are currenctly indicated by a return value of 0, which is...
qcow2: Implement bdrv_truncate() for growing images
This patch adds the ability to grow qcow2 images in-place usingbdrv_truncate(). This enables qemu-img resize command support forqcow2.
Snapshots are not supported and bdrv_truncate() will return -ENOTSUP....
block: Open the underlying image file in generic code
Format drivers shouldn't need to bother with things like file names, but ratherjust get an open BlockDriverState for the underlying protocol. This patchintroduces this behaviour for bdrv_open implementation. For protocols which...
qcow2: Fix signedness bugs
Checking for return codes < 0 isn't really going to work with unsignedtypes. Use signed types instead.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qcow2: Return 0/-errno in qcow2_alloc_cluster_offset
Returning 0/-errno allows it to distingush different errors classes. Thecluster offset of newly allocated clusters is now returned in the QCowL2Metastruct.
Revert "qcow2: Bring synchronous read/write back to life"
It was merely a workaround and the real fix is done now.This reverts commit ef845c3bf421290153154635dc18eaa677cecb43.
qcow2: Bring synchronous read/write back to life
When the synchronous read and write functions were dropped, they were replacedby generic emulation functions. Unfortunately, these emulation functions don'tprovide the same semantics as the original functions did....
qcow2: Increase maximum cluster size to 2 MB
This patch increases the maximum qcow2 cluster size to 2 MB. Starting with 128kclusters, L2 tables span 2 GB or more of virtual disk space, causing 32 bittruncation and wraparound of signed integers. Therefore some variables need to...
Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there aresome additions and it's not entirely compatible. Because of that, there havebeen conflicts with system headers on BSD systems. Some hacks have beenintroduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...
qcow2: Order concurrent AIO requests on the same unallocated cluster
When two AIO requests write to the same cluster, and this cluster isunallocated, currently both requests allocate a new cluster and the second onemerges the first one when it is completed. This means an cluster allocation, a...
Fix QCOW2 debugging code to compile again
Updated to use C99 comments.
Signed-off-by: Filip Navara <filip.navara@gmail.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qcow2: Split out refcount handling
qcow2-refcount.c contains all functions which are related to clusterallocation and management in the image file. A large part of this is thereference counting of these clusters.
Also a header file qcow2.h is introduced which will contain the interface of...
qcow2: Split out guest cluster functions
qcow2-cluster.c contains all functions related to the management of guestclusters, i.e. what the guest sees on its virtual disk. This code is aboutmapping these guest clusters to host clusters in the image file using the...
qcow2: Split out snapshot functions
qcow2-snapshot.c contains the code related to snapshotting.
qcow2: Rename global functions
The qcow2 source is now split into several more manageable files. During theconversion quite some functions that were static before needed to be changed tobe global to make the source compile again.
We were lucky enough not to get name conflicts with these additional global...