History | View | Annotate | Download (88.9 kB)
implement qemu_blockalign (Stefano Stabellini)
this patch adds a buffer_alignment field to BlockDriverState andimplements a qemu_blockalign function that uses that field to allocate amemory aligned buffer to be used by the block driver.buffer_alignment is initialized to 512 but each block driver can set...
qcow2: Add plausibility check for L1/L2 entries (Kevin Wolf)
From: Kevin Wolf <kwolf@redhat.com>
All L1 and L2 entries must point at the start of a cluster. If there is someoffset into the cluster, the entry is corrupted.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
qcow2: Refcount checking code cleanup (Kevin Wolf)
This is purely cosmetical changes to make the code easier to read. Move L2table processing from a deeply nested block to its own function, add somecomments.
Patch v2: Fix misplaced bracket causing false positives...
Introduce bdrv_check (Kevin Wolf)
Introduce a new bdrv_check function pointer for block drivers. Modify qcow2 toreturn an error status in check_refcounts(), so it can implement bdrv_check.
qcow2: Fix warnings in check_refcount() (Kevin Wolf)
This code is currently only compiled when DEBUG_ALLOC is defined, so youusually don't see compiler warnings on it. This patch series wants to enablethe code, so fix the format string warnings first....
qcow2 corruption: Fix alloc_cluster_link_l2 (Kevin Wolf)
This patch fixes a qcow2 corruption bug introduced in SVN Rev 5861. L2 tablesare big endian, so entries must be converted before being passed to functions.
This bug is easy to trigger. The following script will create and destroy a...
Fix OpenSolaris gcc4 warnings: iovec type mismatches, missing 'static'
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7103 c046a42c-6fe2-441c-8c8c-71466251a162
push down vector linearization to posix-aio-compat.c (Christoph Hellwig)
Make all AIO requests vectored and defer linearization until the actualI/O thread. This prepares for using native preadv/pwritev.
Also enables asynchronous direct I/O by handling that case in the I/O thread....
remove bdrv_aio_read/bdrv_aio_write (Christoph Hellwig)
Always use the vectored APIs to reduce code churn once we switch the BlockDriverAPI to be vectored.
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
Fix savevm after BDRV_FILE size enforcement
We now enforce that you cannot write beyond the end of a non-growable file.qcow2 files are not growable but we rely on them being growable to dosavevm/loadvm. Temporarily allow them to be growable by introducing a new...
qcow2: fix image creation for large, > ~2TB, images (Chris Wright)
When creating large disk images w/ qcow2 format, qcow2_create is hardcoded to creating a single refcount block. This is insufficient forlarge images, and will cause qemu-img to segfault as it walks off the...
Fix (at least one cause of) qcow2 corruption. (Nolan Leake)
qcow2's get_cluster_offset() scans forward in the l2 table to find otherclusters that have the same allocation status as the first cluster.This is used by (among others) qcow_is_allocated().
Unfortunately, it was not checking to be sure that it didn't fall off...
fix format string warnings in block-qcow2.c (Christoph Hellwig)
Recent patches added two compiler warnings about the format stringusage in qcow_read_extensions. One is printing a uint64_t using%lu which is incorrect on many platforms as it can be a unsigned...
block-qcow2: keep backing file format in a qcow2 extension (Uri Lublin)
Use a qcow2 extension to keep the backing file format.
By keeping the backing file format, we can:1. Provide a way to know the backing file format without probing it (setting the format at creation time)....
Introducing qcow2 extensions (Uri Lublin)
Qcow2 extensions are build of magic (id) len (in bytes) and data.They reside right after the qcow2 header.If a backing filename exists it follows the qcow2 extension (if exist)
Qcow2 extensions are read upon image open....
Revert r6404
This series is broken by design as it requires expensive IO operations atopen time causing very long delays when starting a virtual machine for thefirst time.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6816 c046a42c-6fe2-441c-8c8c-71466251a162
Revert r6405
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6815 c046a42c-6fe2-441c-8c8c-71466251a162
Revert r6407
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6813 c046a42c-6fe2-441c-8c8c-71466251a162
Use C99 initializers for BlockDriver methods
Consistently use the C99 named initializer format for the BlockDrivermethods to make the method table more readable and more easilyextensible.
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>...
block: remove error handling from qemu_malloc() callers (Avi Kivity)
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6527 c046a42c-6fe2-441c-8c8c-71466251a162
qcow2 format: keep 'num_free_bytes', and show it upon 'info blockstats' (Uri Lublin)
'num_free_bytes' is the number of non-allocated bytes below highest-allocation.It's useful, together with the highest-allocation, to figure out howfragmented the image is, and how likely it will run out-of-space soon....
block-qcow2: export highest_allocated through BlockDriverInfo and get_info() (Uri Lublin)
Signed-off-by: Uri Lublin <uril@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6405 c046a42c-6fe2-441c-8c8c-71466251a162
block-qcow2: keep highest allocated byte (Uri Lublin)
We want to know the highest written offset for qcow2 images.This gives a pretty good (and easy to calculate) estimation to howmuch more allocation can be done for the block device.
It can be usefull for allocating more diskspace for that image...
Avoid calling qemu_mallocz with zero size
Currently qemu_mallocz calls malloc and handling of zero by malloc isimplementation defined behaviour:http://www.opengroup.org/onlinepubs/7990989775/xsh/malloc.html
malloc(0) on AIX returns NULL1 and qcow2 images without snapshots...
qcow2: free old snapshots array upon creation of a new one (Uri Lublin)
Don't leak memory
Rebased for qemu tree.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6245 c046a42c-6fe2-441c-8c8c-71466251a162
qcow2: Fix cluster allocation (Kevin Wolf)
When allocating multiple clusters at once, the qcow2 implementationtries to find as many physically contiguous clusters as possible toallow larger writes. This search includes allocated clusters which arein the right place and still free clusters. If the range to allocate...
Fix compressed qcow2 (Gleb Natapov)
Correctly calculate number of contiguous clusters.
Acked-by: Kevin Wolf <kwolf@suse.de>Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6212 c046a42c-6fe2-441c-8c8c-71466251a162
Use writeback caching by default with qcow2
qcow2 writes a cluster reference count on every cluster update. This causesperformance to crater when using anything but cache=writeback. This is mostnoticeable when using savevm. Right now, qcow2 isn't a reliable format...
Change order of metadata update to prevent loosing guest data because of unexpected exit (Gleb Natapov)
Currently the order is this (during cow since it's the interesting case):1. Decrement refcount of old clusters2. Increment refcount for newly allocated clusters...
Cleanup {alloc|get}_cluster_offset() (Gleb Natapov)
Move duplicated code into helper functions.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5860 c046a42c-6fe2-441c-8c8c-71466251a162
Write table offset and size in one syscall (Gleb Natapov)
Otherwise if VM is killed between two writes data may be lost.But if offset and size fields are at the same disk block onewrite should update them both simultaneously.
Signed-off-by: Gleb Natapov <gleb@redhat.com>...
Introduce new helper function qcow_shedule_bh() (Gleb Natapov)
Use it to remove code duplications from qcow_aio_read_cb().
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5858 c046a42c-6fe2-441c-8c8c-71466251a162
Remove tabs from qcow_aio_read_cb(). (Gleb Natapov)
Fix indentation.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5857 c046a42c-6fe2-441c-8c8c-71466251a162
fix bdrv_aio_read API breakage in qcow2 (Andrea Arcangeli)
I noticed the qemu_aio_flush was doing nothing at all. And a flood ofcmd_writeb commands leading to a noop-invocation of qemu_aio_flushwere executed.
In short all 'memset;goto redo' places must be fixed to use the bh and...
fix bug in block-qcow2.c:alloc_cluster_offset() (Shahar Frank)
During the debugging of the new revision of the zero dedup patch Istepped on the following bug in block-qcow2.c:alloc_cluster_offset(). Iam not sure what the exact damage this bug can do, but it may be very...
Move offsetof to osdep.h, remove local defintions.
With this container_of can actually be used without causing build errors.Reformat container_of.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5234 c046a42c-6fe2-441c-8c8c-71466251a162
qcow2: Try to aggregate free clusters and freed clusters (Laurent Vivier)
In alloc_cluster_offset(), try to aggregate free clusters and freed clusters.
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
qcow2: Make sure to return an error when L2 table loading fails
This was suggested by Kevin Wolf since this is, in fact, an error condition.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5007 c046a42c-6fe2-441c-8c8c-71466251a162
qcow2: Aggregate same type clusters (Laurent Vivier)
Modify get_cluster_offset(), alloc_cluster_offset() to specify how many clusterswe want.
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
...
Extract compressing part from alloc_cluster_offset() (Laurent Vivier)
Divide alloc_cluster_offset() into alloc_cluster_offset() andalloc_compressed_cluster_offset().Common parts are moved to free_any_clusters() and get_cluster_table();
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>...
Divide get_cluster_offset() (Laurent Vivier)
Divide get_cluster_offset() into get_cluster_offset() andalloc_cluster_offset().
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5004 c046a42c-6fe2-441c-8c8c-71466251a162
qcow2: Extract code from get_cluster_offset() (Laurent Vivier)
Extract code from get_cluster_offset() into new functions:
- seek_l2_table()
Search an l2 offset in the l2_cache table.
- l2_load()
Read the l2 entry from disk
- l2_allocate()
Allocate a new l2 entry....
Revert fix for CVE-2008-0928. Will be fixed in a different way later.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4041 c046a42c-6fe2-441c-8c8c-71466251a162
Fix CVE-2008-0928 - insufficient block device address range checking
Qemu 0.9.1 and earlier does not perform range checks for block deviceread or write requests, which allows guest host users with rootprivileges to access arbitrary memory and escape the virtual machine....
Split block API from vl.h.Remove QEMU_TOOL. Replace with QEMU_IMG and NEED_CPU_H.Avoid linking qemu-img against whole system emulatior.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3578 c046a42c-6fe2-441c-8c8c-71466251a162
find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in the regex.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3177 c046a42c-6fe2-441c-8c8c-71466251a162
vmdk compatibility level 6 images, by Soren Hansen.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3175 c046a42c-6fe2-441c-8c8c-71466251a162
find -type f | xargs sed -i 's/[\t ]$//g' # on most files
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162
Qcow2: Release refcount table clusters after growing the refcount table,by Juergen Keil.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2586 c046a42c-6fe2-441c-8c8c-71466251a162
Qcow2 corruption fix, by Juergen Keil.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2578 c046a42c-6fe2-441c-8c8c-71466251a162
Dynamically allocate AIO Completion Blocks.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2098 c046a42c-6fe2-441c-8c8c-71466251a162
handle read outside the backing file
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2093 c046a42c-6fe2-441c-8c8c-71466251a162
fixed disk image creation
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2089 c046a42c-6fe2-441c-8c8c-71466251a162
new qcow2 disk image format
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2083 c046a42c-6fe2-441c-8c8c-71466251a162