History | View | Annotate | Download (33.8 kB)
qcow2: Store exact backing format length
Currently qcow2 unnecessarily rounds up the length of the backing format stringto the next multiple of 8. At the same time, the array in BlockDriverState canonly hold 15 characters, so in effect backing formats with 9 characters or more...
qcow2: Allow qcow2 disk images with size zero
Images with disk size 0 may be used forVM snapshots, but not to save normal block data.
It is possible to create such images usingqemu-img, but opening them later fails.
So even "qemu-img info image.qcow2" is not...
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.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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....
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: Fix metadata preallocation
The wrong version of the preallocation patch has been applied, so this is theremaining diff.
We can't use truncate to grow the image file to the right size because we don'tknow if metadata has been written after the last data cluster. In this case...
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 gcc 3 warning about uninitialized variable
If nb_sectors is 0, cluster_offset will not be initialized.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
qcow2: Metadata preallocation
This introduces a qemu-img create option for qcow2 which allows the metadata tobe preallocated, i.e. clusters are reserved in the refcount table and L1/L2tables, but no data is written to them. Metadata is quite small, so this...
replace bdrv_{get, put}_buffer with bdrv_{load, save}_vmstate
The VM state offset is a concept internal to the image format. Replacethe old bdrv_{get,put}_buffer method that require an index into theimage file that is constructed from the VM state offset and an offset...
qcow2: Fix L1 table memory allocation
Contrary to what one could expect, the size of L1 tables is not clusteraligned. So as we're writing whole sectors now instead of single entries,we need to ensure that the L1 table in memory is large enough; otherwise...
qcow2: Make cache=writethrough default
The performance of qcow2 has improved meanwhile, so we don't need tospecial-case it any more. Switch the default to write-through cachinglike all other block drivers.
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: Change default cluster size to 64k
Larger cluster sizes mean less metadata. This has been discussion a few times,let's do it now. This turns 64k clusters on by default for new images.
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...
qemu-img: Print available options with -o ?
This patch adds a small help text to each of the options in the block driverswhich can be displayed by using qemu-img create -f fmt -o ?
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
fully split aio_pool from BlockDriver
Now that we have a separate aio pool structure we can remove thoseaio pool details from BlockDriver.
Every driver supporting AIO now needs to declare a static AIOPoolwith the aiocb size and the cancellation method. This cleans up the...
qcow2: Update multiple refcounts at once
Don't write each single changed refcount block entry to the disk after it iswritten, but update all entries of the block and write all of them at once.
qcow2: Refactor update_refcount
This is a preparation patch with no functional changes. It moves the allocationof new refcounts block to a new function and makes update_cluster_refcount (forone cluster) call update_refcount (for multiple clusters) instead the other way...
qcow/qcow2: Drop synchronous qcow_write()
There is only one (internal) user left and it can be switched to the normalemulation provided in block.c
qcow2: Allow different cluster sizes
Add an option to specify the cluster size of a newly created qcow2 image.Default is 4k which is the same value that was hard-coded before.
Convert all block drivers to new bdrv_create
Now we can make use of the newly introduced option structures. Instead ofhaving bdrv_create carry more and more parameters (which are format specific inmost cases), just pass a option structure as defined by the driver itself....
Do not attempt to allocate sn_tab when there are no snapshots
This was caught by a7d27b536ffc0773028a90f14580552c0c3ddb2a whichaborted on this attempt, thanks to Alex Ivanov for report.
Signed-off-by: malc <av1474@comtv.ru>
Move block drivers into their own directory
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>