| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
When I tried to use QCow image, I found that only each second boot is
successful. As I discovered, this is caused by wrong handling old qcow
tapdisk images. Extended header flag is not stored correctly so the
blktap tries to change endian fo L1 table on each startup.
From: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Empty QCOW images consist of only the L1 table, this results in a
file size which is not sector-aligned. Since blktap uses O_DIRECT, the
block aligned read of the L1 table will go beyond the end of file and
thus returns the actual file size and not the expected length.
This patch checks whether at least the L1 table has been read.
This should fix bug 1430.
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
|
|
|
|
|
|
|
|
|
| |
As pointed out in Xen Bugzilla 1430 in the blktap QCOW driver the
rounding function is wrong in line 824 of block-qcow.c.
This patch replaces this (and other roundings) with the already
existing ROUNDUP macro (and fixes the usual macro pitfall).
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
|
|
|
|
|
|
|
| |
Turns out that only two reads and writes in block-qcow.c need to be
fixed to work correctly with O_DIRECT.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
|
|
|
|
| |
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
|
|
|
|
|
|
|
| |
Make functions w/o a prototype static and remove redundant
declaration of xs_fire_next_watch().
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
|
|
|
|
| |
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
|
|
|
|
|
|
|
|
|
|
| |
tapdisk, part of blktap, links against libcrypto. tapdisk includes
GPLv2 (tapaio.c) and other licensed code (block-qcow.c). The license
of OpenSSL is considered incompatible with the GPL by many
people. This patch changes them to link against libgcrypt, which is
LGPL.
Signed-off-by: Bastian Blank <waldi@debian.org>
|
|
|
|
| |
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
|
|
|
|
|
|
|
|
| |
Fix tapdisk to use big endian L1 tables as used by qemu/ioemu. Old
tapdisk images with native endianess are automagically converted to
big endian when the image file is opened for the first time.
Signed-off-by: Kevin Wolf <kwolf@suse.de>
|
|
|
|
|
|
|
|
| |
With my qcow2 patch to blktap I contributed a bit to the mess, so here
an attempt to clean up and remove at least some of the code
duplication in the functions dealing with aio operations.
Signed-off-by: Kevin Wolf <kwolf@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds support for the qcow2 image format to blktap. It
consists mostly of qemu code, adapted to the blktap interfaces.
Snapshots and compressed images are supported.
The qcow2 driver may be used by either specifying tap:qcow2 or by
using tap:qcow which will detect that you have a version 2 image and
will call the qcow2 driver.
Signed-off-by: Kevin Wolf <kwolf@suse.de>
|
|
|
|
| |
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
blktap requires a xen specific kernel AIO ABI which has been vetoed by
upstream in favour of another approach. Rather than include this ABI,
Fedora has been carrying a patch which makes tap:aio use a thread to
poll for aio events and notify the main thread via a pipe.
The upstream approach of allowing io_getevents() poll normal file
descriptors via epoll is still progressing:
http://lkml.org/lkml/2007/1/3/16
but when that does make it upstream, blktap will require significant
re-working to use that approach.
In the meantime, here's a patch which uses the poll-in-a-thread
approach only if AIO poll support isn't available. It also hides the
details behind a simple abstraction and makes both tap:aio and
tap:qcow use it.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Note that some of the existing error checking for asprintf was wrong
for Linux. asprintf in glibc returns -1 on error, but leaves the
pointer uninitialized. Only the BSDs zero out the pointer on error.
Also, while fixing these warnings I saw several error paths that were
incorrect. This patch minimally fixes the warn_unused_result; more
complete error path cleanup will be a later patch.
Signed-off-by: Charles Coffing <ccoffing@novell.com>
|
|
|
|
|
|
|
| |
When compiling the various blktap drivers with warnings cranked up, I
get errors that return values are not checked.
Signed-off-by: Charles Coffing <ccoffing@novell.com>
|
|
|
|
| |
Signed-off-by: Keir Fraser <keir@xensource.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In blktap's qcow we need split up read/write requests if the requests
span multiple clusters. However, with our MAX_AIO_REQUESTS define we
assume that there is only ever a single aio request per tapdisk
request and under heavy i/o we can run out of room causing us to
cancel requests.
Dynamically allocate (based on cluster_bits) the various io request
queues the driver maintains.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
|
|
|
|
|
|
| |
fd_end was being incorrectly initialized upon open, leading to data corruption.
Signed-off-by: Jake Wires <jwires@xensource.com>
|
|
|
|
| |
Signed-off-by: Jake Wires <jwires@xensource.com>
|
|
|
|
| |
Signed-off-by: Jake Wires <jwires@xensource.com>
|
|
|
|
|
|
| |
* open all parent images read-only
* expose parent image names to tapdisk (needed for locking api)
Signed-off-by: Jake Wires <jwires@xensource.com>
|
|
|
|
|
|
|
|
| |
Enables tapdisk to chain an arbitrary number of VDIs, propagating reads of
holes in children to their parent images. Introduces two new functions to the
tapdisk interface to facilitate this. Modifies the QCoW plugin to take
advantage of these changes, thus providing support for arbitrarily long chains
of QCoW image types.
|
|
|
|
| |
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
|
|
|
|
|
|
|
|
|
|
|
| |
- Remove global QCOW flags
- rename sparseness flag to -r fore 'reserve'
- Add ROUNDUP macro
- Check for qtruncate failures
Signed-off-by: Julian Chesterfield <julian@xensource.com>
|
|
|
|
| |
Signed-off-by: Ewan Mellor <ewan@xensource.com>
|
|
|
|
|
|
|
|
| |
For environments where space must be guaranteed in advance
use the -p flag to remove sparseness from the qcow file.
Signed-off-by: Julian Chesterfield <julian@xensource.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
with I/O errors.
There are a number of flaws in the blktap userspace daemon when dealing
with I/O errors.
- The backends which use AIO check the io_events.res member to determine
if an I/O error occurred. Which is good. But when calling the callback
to signal completion of the I/O, they pass the io_events.res2 member
Now this seems fine at first glance[1]
"res is the usual result of an I/O operation: the number of bytes
transfered, or a negative error code. res2 is a second status
value which will be returned to the user"
Except that
"currently (2.6.0-test9), callers of aio_complete() within the
kernel always set res2 to zero."
And this hasn't changed anytime since 2.6.0, so by passing through
the status from 'res2', the callback thinks the I/O operation succeeded
even when it failed :-(
The fix is simple instead of passing 'res2', just pass
ep->res == io->u.c.nbytes ? 0 : 1
This would solve the error reporting to the guest, except that there
is a second flaw...
- The tapdisk I/O completion callback checks the status parameter
passed in, syslog's it and then returns. It never bothers to send
the I/O completion response back to the blktap kernel driver when
a failure occurrs.
Fortunately the fix for this is also simple. Instead of returning
from the callback when dealing with an error, we simply toggle the
status field for the pending response to BLKIF_RSP_ERROR and then
continue with the normal codepath. So the error eventually gets
back to the guest.
The scenario I used to discover the problem and test the patch is thus:
- In dom0 create a filesystem with only 200 MB of free space
- Create a 1 GB sparse file on this volume.
- Configure the guest so this sparse file appears as /dev/xvdb
- In the domU create a single partition on /dev/xvdb and format
it with ext3.
- In the DomU, mount /dev/xvdb1 on /mnt and then run
dd if=/dev/zero of=/mnt/data.bin bs=1GB count=1
Without this patch, the 'dd' command would succeed in writing 1 GB of data
even though the underlying disk in Dom0 was only 200 MB in size. More complex
tests of copying a whole directory heirarchy across resulted in catastrophic
data corruption of the filessytem itself. Manual fsck was needed to fixup
the filesystem & there were many very bad errors needing fixing.
With this patch applied the DomU sees the I/O failures and kernel logs
messages
Dec 1 11:02:53 dhcp-5-203 kernel: end_request: I/O error, dev xvdc, sector 722127
Dec 1 11:02:53 dhcp-5-203 kernel: end_request: I/O error, dev xvdc, sector 730327
Dec 1 11:02:53 dhcp-5-203 kernel: end_request: I/O error, dev xvdc, sector 738527
Dec 1 11:02:53 dhcp-5-203 kernel: end_request: I/O error, dev xvdc, sector 746727
Dec 1 11:02:53 dhcp-5-203 kernel: end_request: I/O error, dev xvdc, sector 754927
Dec 1 11:02:53 dhcp-5-203 kernel: end_request: I/O error, dev xvdc, sector 763127
Dec 1 11:02:53 dhcp-5-203 kernel: end_request: I/O error, dev xvdc, sector 771327
Dec 1 11:02:53 dhcp-5-203 kernel: end_request: I/O error, dev xvdc, sector 779527
Dec 1 11:02:53 dhcp-5-203 kernel: end_request: I/O error, dev xvdc, sector 792399
It will retry the I/O operation until it runs out of sectors to try, and then
fail the operation. The filesystem is not seriously damaged - ext3 journal
recovery will trivially cleanup if the guest is rebooted after the disk in
Dom0 is enlarged.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
[1] http://lwn.net/Articles/24366/
|
|
|
|
| |
block device.
|
|
|
|
| |
Signed-off-by: Andrew Warfield <andy@xensource.com>
|
|
|
|
| |
Signed-off-by: Andrew Warfield <andy@xensource.com>
|
|
CONFIG_XEN_BLKDEV_TAP=y) and userspace tools. The userspace deamon (blktapctrl) is enabled by default when xend is activated. For further information on using and configuring blktap see tools/blktap/README.
|