77a5a000 | 16-May-2011 |
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> |
qed: support for growing images
The .bdrv_truncate() operation resizes images and growing is easy to implement in QED. Simply check that the new size is valid and then update the image_size header
qed: support for growing images
The .bdrv_truncate() operation resizes images and growing is easy to implement in QED. Simply check that the new size is valid and then update the image_size header field to reflect the new size.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
6f321e93 | 09-May-2011 |
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 when opening image files is to ensure that the file is marked dirty for as little time a
qed: Periodically flush and clear need check bit
One strategy to limit the startup delay of consistency check when opening image files is to ensure that the file is marked dirty for as little time as possible.
QED currently marks the image dirty when the first allocating write request is issued and clears the dirty bit again when the image is cleanly closed. In practice that means the image is marked dirty for most of a guest's lifetime and prone to being in a dirty state upon crash or power failure.
It is safe to clear the dirty bit after all allocating write requests have completed and a flush has been performed. This patch adds a timer after the last allocating write request completes. When the timer fires it will flush and then clear the dirty bit. The timer is set to 5 seconds and is cancelled upon arrival of a new allocating write request.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
a1c7273b | 28-Apr-2011 |
Stefan Weil <weil@mail.berlios.de> |
Fix typos in comments and code (occured -> occurred and related)
The code changed here is an unused data type name (evt_flush_occurred).
Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off
Fix typos in comments and code (occured -> occurred and related)
The code changed here is an unused data type name (evt_flush_occurred).
Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
show more ...
|
ebabb67a | 26-Apr-2011 |
Stefan Weil <weil@mail.berlios.de> |
Fix typo in code and comments
Replace writeable -> writable
Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> |
d2d979c6 | 28-Apr-2011 |
Nick Thomas <nick@bytemark.co.uk> |
NBD: Avoid leaking a couple of strings when the NBD device is closed
Signed-off-by: Nick Thomas <nick@bytemark.co.uk> Signed-off-by: Kevin Wolf <kwolf@redhat.com> |
19dfc44a | 24-Apr-2011 |
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> |
qed: Fix consistency check on 32-bit hosts
The qed_bytes_to_clusters() function is normally used with size_t lengths. Consistency check used it with file size length and therefore failed on 32-bit
qed: Fix consistency check on 32-bit hosts
The qed_bytes_to_clusters() function is normally used with size_t lengths. Consistency check used it with file size length and therefore failed on 32-bit hosts when the image file is 4 GB or more.
Make qed_bytes_to_clusters() explicitly 64-bit and update consistency check to keep 64-bit cluster counts.
Reported-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
2d56a546 | 13-Apr-2011 |
Mitnick Lyu <mitnick.lyu@gmail.com> |
vpc.c: Use get_option_parameter() does the search
Use get_option_parameter() to instead of duplicating the loop, and use BDRV_SECTOR_SIZE to instead of 512
Signed-off-by: Mitnick Lyu <mitnick.lyu@g
vpc.c: Use get_option_parameter() does the search
Use get_option_parameter() to instead of duplicating the loop, and use BDRV_SECTOR_SIZE to instead of 512
Signed-off-by: Mitnick Lyu <mitnick.lyu@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
21df65b6 | 17-Dec-2010 |
Anthony Liguori <aliguori@us.ibm.com> |
qed: Add support for zero clusters
Zero clusters are similar to unallocated clusters except instead of reading their value from a backing file when one is available, the cluster is always read as ze
qed: Add support for zero clusters
Zero clusters are similar to unallocated clusters except instead of reading their value from a backing file when one is available, the cluster is always read as zero.
This implements read support only. At this stage, QED will never write a zero cluster.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
33897dc7 | 22-Feb-2011 |
Nick Thomas <nick@bytemark.co.uk> |
NBD device: Separate out parsing configuration and opening sockets.
We also change the way the file parameter is parsed so IPv6 IP addresses can be used, e.g.: "drive=nbd:[::1]:5000"
Signed-off-by:
NBD device: Separate out parsing configuration and opening sockets.
We also change the way the file parameter is parsed so IPv6 IP addresses can be used, e.g.: "drive=nbd:[::1]:5000"
Signed-off-by: Nick Thomas <nick@bytemark.co.uk> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
4ff9786c | 13-Mar-2011 |
Stefan Weil <weil@mail.berlios.de> |
Fix trivial "endianness bugs"
Replace endianess -> endianness.
Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> |
8cffde73 | 10-Mar-2011 |
Michael Tokarev <mjt@tls.msk.ru> |
get rid of private bitmap functions in block/sheepdog.c, use generic ones
qemu now has generic bitmap functions, so don't redefine them in sheepdog.c, use common header instead. A small cleanup.
H
get rid of private bitmap functions in block/sheepdog.c, use generic ones
qemu now has generic bitmap functions, so don't redefine them in sheepdog.c, use common header instead. A small cleanup.
Here's only one function which is actually used in sheepdog and gets replaced with a generic one (simplified):
- static inline int test_bit(int nr, const volatile unsigned long *addr) + static inline int test_bit(int nr, const unsigned long *addr) { - return ((1UL << (nr % BITS_PER_LONG)) & ((unsigned long*)addr)[nr / BITS_PER_LONG])) != 0; + return 1UL & (addr[nr / BITS_PER_LONG] >> (nr & (BITS_PER_LONG-1))); }
The body is equivalent, but the argument is not: there's "volatile" in there. Why it is used for - I'm not sure.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Acked-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
show more ...
|
5614c188 | 19-Feb-2011 |
Stefan Weil <weil@mail.berlios.de> |
block/qcow: Don't ignore immediate read/write and other failures
This patch is similar to 171e3d6b9997c98a97d0c525867f7cd9b640cadd which fixed qcow2:
Returning -EIO is far from optimal, but at leas
block/qcow: Don't ignore immediate read/write and other failures
This patch is similar to 171e3d6b9997c98a97d0c525867f7cd9b640cadd which fixed qcow2:
Returning -EIO is far from optimal, but at least it's an error code.
In addition to read/write failures, -EIO is also returned when decompress_cluster failed.
Cc: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
40a892b7 | 19-Feb-2011 |
Stefan Weil <weil@mail.berlios.de> |
block/vdi: Don't ignore immediate read/write failures
This patch is similar to 171e3d6b9997c98a97d0c525867f7cd9b640cadd which fixed qcow2:
Returning -EIO is far from optimal, but at least it's an e
block/vdi: Don't ignore immediate read/write failures
This patch is similar to 171e3d6b9997c98a97d0c525867f7cd9b640cadd which fixed qcow2:
Returning -EIO is far from optimal, but at least it's an error code.
Cc: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
16fde5f2 | 09-Feb-2011 |
Kevin Wolf <kwolf@redhat.com> |
qcow2: Fix order in L2 table COW
When copying L2 tables (this happens only with internal snapshots), the order wasn't completely safe, so that after a crash you could end up with a L2 table that has
qcow2: Fix order in L2 table COW
When copying L2 tables (this happens only with internal snapshots), the order wasn't completely safe, so that after a crash you could end up with a L2 table that has too low refcount, possibly leading to corruption in the long run.
This patch puts the operations in the right order: First allocate the new L2 table and replace the reference, and only then decrease the refcount of the old table.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
10b758e8 | 09-Feb-2011 |
Kevin Wolf <kwolf@redhat.com> |
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 jus
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 help.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Acked-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
show more ...
|
e8cdcec1 | 09-Feb-2011 |
Kevin Wolf <kwolf@redhat.com> |
qcow2: Report error for version > 2
The qcow2 driver is now declared responsible for any QCOW image that has version 2 or greater (before this, version 3 would be detected as raw).
For everything n
qcow2: Report error for version > 2
The qcow2 driver is now declared responsible for any QCOW image that has version 2 or greater (before this, version 3 would be detected as raw).
For everything newer than version 2, an error is reported.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
show more ...
|
8af36488 | 09-Feb-2011 |
Kevin Wolf <kwolf@redhat.com> |
qcow2: Fix error handling for reading compressed clusters
When reading a compressed cluster failed, qcow2 falsely returned success.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Markus
qcow2: Fix error handling for reading compressed clusters
When reading a compressed cluster failed, qcow2 falsely returned success.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
3ab4c7e9 | 08-Feb-2011 |
Kevin Wolf <kwolf@redhat.com> |
qcow2: Fix error handling for immediate backing file read failure
Requests could return success even though they failed when bdrv_aio_readv returned NULL for a backing file read.
Reported-by: Chunq
qcow2: Fix error handling for immediate backing file read failure
Requests could return success even though they failed when bdrv_aio_readv returned NULL for a backing file read.
Reported-by: Chunqiang Tang <ctang@us.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
e0d9c6f9 | 03-Feb-2011 |
Chunqiang Tang <ctang@us.ibm.com> |
QCOW2: bug fix - read base image beyond its size
This patch fixes the following bug in QCOW2. For a QCOW2 image that is larger than its base image, when handling a read request straddling over the e
QCOW2: bug fix - read base image beyond its size
This patch fixes the following bug in QCOW2. For a QCOW2 image that is larger than its base image, when handling a read request straddling over the end of the base image, the QCOW2 driver attempts to read beyond the end of the base image and the request would fail.
This bug was found by Fast Virtual Disk (FVD)'s fully automated testing tool. The following test triggered the bug.
dd if=/dev/zero of=/var/ramdisk/truth.raw count=0 bs=1 seek=1098561536 dd if=/dev/zero of=/var/ramdisk/zero-500M.raw count=0 bs=1 seek=593099264 ./qemu-img create -f qcow2 -ocluster_size=65536,backing_fmt=blksim -b /var/ramdisk/zero-500M.raw /var/ramdisk/test.qcow2 1098561536 ./qemu-io --auto --seed=30477694 --truth=/var/ramdisk/truth.raw --format=qcow2 --test=blksim:/var/ramdisk/test.qcow2 --verify_write=true --compare_before=false --compare_after=true --round=100000 --parallel=100 --io_size=10485760 --fail_prob=0 --cancel_prob=0 --instant_qemubh=true
Signed-off-by: Chunqiang Tang <ctang@us.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
4f3669ea | 04-Feb-2011 |
Stefan Weil <weil@mail.berlios.de> |
block/vdi: Fix wrong size in conditionally used memset, memcmp
Error report from cppcheck: block/vdi.c:122: error: Using sizeof for array given as function argument returns the size of pointer. bloc
block/vdi: Fix wrong size in conditionally used memset, memcmp
Error report from cppcheck: block/vdi.c:122: error: Using sizeof for array given as function argument returns the size of pointer. block/vdi.c:128: error: Using sizeof for array given as function argument returns the size of pointer.
Fix both by setting the correct size.
The buggy code is only used when QEMU is build without uuid support. The bug is not critical, so there is no urgent need to apply it to old versions of QEMU.
Cc: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
e1a7107f | 27-Jan-2011 |
Kevin Wolf <kwolf@redhat.com> |
qcow2: Really use cache=unsafe for image creation
For cache=unsafe we also need to set BDRV_O_CACHE_WB, otherwise we have some strange unsafe writethrough mode.
Signed-off-by: Kevin Wolf <kwolf@red
qcow2: Really use cache=unsafe for image creation
For cache=unsafe we also need to set BDRV_O_CACHE_WB, otherwise we have some strange unsafe writethrough mode.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
show more ...
|
1869a653 | 29-Jan-2011 |
Blue Swirl <blauwirbel@gmail.com> |
qcow2-refcount: remove write-only variables
Variables l2_modified and l2_size are not really used, remove them. Spotted by GCC 4.6.0: CC block/qcow2-refcount.o /src/qemu/block/qcow2-refcount.c:
qcow2-refcount: remove write-only variables
Variables l2_modified and l2_size are not really used, remove them. Spotted by GCC 4.6.0: CC block/qcow2-refcount.o /src/qemu/block/qcow2-refcount.c: In function 'qcow2_update_snapshot_refcount': /src/qemu/block/qcow2-refcount.c:708:37: error: variable 'l2_modified' set but not used [-Werror=unused-but-set-variable] /src/qemu/block/qcow2-refcount.c:708:9: error: variable 'l2_size' set but not used [-Werror=unused-but-set-variable]
CC: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
1b40bbd1 | 28-Jan-2011 |
Kevin Wolf <kwolf@redhat.com> |
raw-win32: Fix bdrv_flush return value
Signed-off-by: Kevin Wolf <kwolf@redhat.com> |
0d09c797 | 28-Jan-2011 |
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> |
qed: Images with backing file do not require QED_F_NEED_CHECK
The consistency check on open is necessary in order to fix inconsistent table offsets left as a result of a crash mid-operation. Images
qed: Images with backing file do not require QED_F_NEED_CHECK
The consistency check on open is necessary in order to fix inconsistent table offsets left as a result of a crash mid-operation. Images with a backing file actually flush before updating table offsets and are therefore guaranteed to be consistent. Do not mark these images dirty.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
5ea929e3 | 26-Jan-2011 |
Kevin Wolf <kwolf@redhat.com> |
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, but the space
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, but the space can be reused by future writes to the image.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
show more ...
|