History | View | Annotate | Download (46 kB)
block: Add options QDict to bdrv_file_open() prototypes
The new parameter is unused yet.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>
block: Add options QDict to .bdrv_open()
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block: Use error code EMEDIUMTYPE for wrong format in some block drivers
This improves error reports for bochs, cow, qcow, qcow2, qed and vmdkwhen a file with the wrong format is selected.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Reviewed-by: Eric Blake <eblake@redhat.com>...
misc: move include files to include/qemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
migration: move include files to include/migration/
qapi: move include files to include/qobject/
aio: rename AIOPool to AIOCBInfo
Now that AIOPool no longer keeps a freelist, it isn't really a "pool" anymore. Rename it to AIOCBInfo and make it const since it no longerneeds to be modified.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: qed image file reopen
These are the stubs for the file reopen drivers for the qed format.
There is currently nothing that needs to be done by the qed driverin reopen.
Signed-off-by: Jeff Cody <jcody@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qed: refuse unaligned zero writes with a backing file
Zero writes have cluster granularity in QED. Therefore they can only beused to zero entire clusters.
If the zero write request leaves sectors untouched, zeroing the entirecluster would obscure the backing file. Instead return -ENOTSUP, which...
qed: mark image clean after repair succeeds
The dirty bit is cleared after image repair succeeds in qed_open().Move this into qed_check() so that all callers benefit from thisbehavior when fix=true.
This is necessary so qemu-img check can call .bdrv_check() and mark the...
block: add BLOCK_O_CHECK for qemu-img check
Image formats with a dirty bit, like qed and qcow2, repair dirty imagefiles upon open with BDRV_O_RDWR. Performing automatic repair whenqemu-img check runs is not ideal because the bdrv_open() call repairsthe image before the actual bdrv_check() call from qemu-img.c....
Merge remote-tracking branch 'mjt/mjt-iov2' into staging
blkdebug: remove sync i/o events
These are unused, except (by mistake more or less) in QED.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-img check -r for repairing images
The QED block driver already provides the functionality to not onlydetect inconsistencies in images, but also fix them. However, thisfunctionality cannot be manually invoked with qemu-img, but thecheck happens only automatically during bdrv_open()....
consolidate qemu_iovec_copy() and qemu_iovec_concat() and make them consistent
qemu_iovec_concat() is currently a wrapper forqemu_iovec_copy(), use the former (with extra"0" arg) in a few places where it is used.
Change skip argument of qemu_iovec_copy() from...
consolidate qemu_iovec_memset{,_skip}() into single function and use existing iov_memset()
This patch combines two functions into one, and replacesthe implementation with already existing iov_memset() fromiov.c.
The new prototype of qemu_iovec_memset():...
block: fix snapshot on QED
QED's opaque data includes a pointer back to the BlockDriverState.This breaks when bdrv_append shuffles data between bs_new and bs_top.To avoid this, add a "rebind" function that tells the driver aboutthe new relationship between the BlockDriverState and its opaque....
qed: remove incoming live migration blocker
Signed-off-by: Benoit Canet <benoit.canet@gmail.com>Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qed: honor BDRV_O_INCOMING for incoming live migration
From original commit with Patchwork-id: 31108 byStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
"The QED image format includes a file header bit to mark images dirty.QED normally checks dirty images on open and fixes inconsistent...
qed: add bdrv_invalidate_cache to be called after incoming live migration
The QED image is reopened to flush metadata and check consistency.
qed: track dirty flag status
Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: push recursive flushing up from drivers
qed: replace is_write with flags field
Per-request attributes like read/write are currently implemented as boolfields in the QEDAIOCB struct. This becomes unwiedly as the number ofattributes grows. For example, the qed_aio_setup() function would have...
qed: add .bdrv_co_write_zeroes() support
Zero writes are a dedicated interface for writing regions of zeroes intothe image file. If clusters are not yet allocated it is possible to usean efficient metadata representation which keeps the image file compact...
block: bdrv_aio_* do not return NULL
Initially done with the following semantic patch:
rule1 expression E;statement S;@@ E =( bdrv_aio_readv | bdrv_aio_writev | bdrv_aio_flush | bdrv_aio_discard | bdrv_aio_ioctl) (...);(- if (E == NULL) { ... }...
rule1
qed: convert to .bdrv_co_is_allocated()
The bdrv_qed_is_allocated() function is a synchronous wrapper aroundqed_find_cluster(), which performs the cluster lookup. In order toconvert the synchronous function to a coroutine function we yieldinstead of using qemu_aio_wait(). Note that QED's cache is already safe...
qed: add migration blocker (v2)
Now when you try to migrate with qed, you get:
(qemu) migrate tcp:localhost:1025Block format 'qed' used by device 'ide0-hd0' does not support feature 'live migration'(qemu)
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
qed: don't pass NULL to memcpy
Spotted by Clang Analyzer
[Note this memcpy call has always been safe because the length will be 0when the pointer is NULL]
Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qed: remove unneeded variable assignment
'ret' is unconditionally overwitten by qed_read_l1_table_sync()
block: drop redundant bdrv_flush implementation
Block drivers now only need to provide either of .bdrv_co_flush,.bdrv_aio_flush() or for legacy drivers .bdrv_flush(). Removethe redundant .bdrv_flush() implementations.
[Paolo Bonzini: change raw driver to bdrv_co_flush]...
qed: fix use-after-free during l2 cache commit
QED's metadata caching strategy allows two parallel requests to race formetadata lookup. The first one to complete will populate the metadatacache and the second one will drop the data it just read in favor of the...
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
async: Remove AsyncContext
The purpose of AsyncContexts was to protect qcow and qcow2 against reentrancyduring an emulated bdrv_read/write (which includes a qemu_aio_wait() call andcan run AIO callbacks of different requests if it weren't for AsyncContexts)....
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...
qed: support for growing images
The .bdrv_truncate() operation resizes images and growing is easy toimplement in QED. Simply check that the new size is valid and thenupdate the image_size header field to reflect the new size.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
qed: Periodically flush and clear need check bit
One strategy to limit the startup delay of consistency check whenopening image files is to ensure that the file is marked dirty for aslittle time as possible.
QED currently marks the image dirty when the first allocating write...
qed: Add support for zero clusters
Zero clusters are similar to unallocated clusters except instead of readingtheir value from a backing file when one is available, the cluster is alwaysread as zero.
This implements read support only. At this stage, QED will never write a...
qed: Report error for unsupported features
Instead of just returning -ENOTSUP, generate a more detailed error.
Unfortunately we don't have a helpful text for features that we don't know yet,so just print the feature mask. It might be useful at least if someone asks for...
qed: Images with backing file do not require QED_F_NEED_CHECK
The consistency check on open is necessary in order to fix inconsistenttable offsets left as a result of a crash mid-operation. Images with abacking file actually flush before updating table offsets and are...
qed: Refuse to create images on block devices
QED relies on the underlying filesystem to extend the file and maintainits size. Check that images are not created on a block device.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qed: Add QEMU Enhanced Disk image format
This patch introduces the qed on-disk layout and implements imagecreation. Later patches add read/write and other functionality.
qed: Table, L2 cache, and cluster functions
This patch adds code to look up data cluster offsets in the image viathe L1/L2 tables. The L2 tables are writethrough cached in memory forperformance (each read/write requires a lookup so it is essential tocache the tables)....
qed: Read/write support
This patch implements the read/write state machine. Operations arefully asynchronous and multiple operations may be active at any time.
Allocating writes lock tables to ensure metadata updates do notinterfere with each other. If two allocating writes need to update the...
qed: Consistency check support
This patch adds support for the qemu-img check command. It alsointroduces a dirty bit in the qed header to mark modified images asneeding a check. This bit is cleared when the image file is closedcleanly.
If an image file is opened and it has the dirty bit set, a consistency...