summaryrefslogtreecommitdiffstats
path: root/block
Commit message (Collapse)AuthorAgeFilesLines
* block/curl: Don't finish AIOCBs too earlyNick Thomas2011-09-211-19/+49
| | | | | | | | | | | | | | The previous behaviour was to finish AIOCBs inside curl_aio_readv() if the data was cached. This caused the following failed assertion at hw/ide/pci.c:314: bmdma_cmd_writeb "Assertion `bm->bus->dma->aiocb == ((void *)0)' failed." By scheduling a QEMUBH and performing the completion inside the callback, we avoid this problem. Signed-off-by: Nick Thomas <nick@bytemark.co.uk> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block/curl: Implement a flush function on the fd handlersNick Thomas2011-09-211-4/+22
| | | | | Signed-off-by: Nick Thomas <nick@bytemark.co.uk> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* rbd: allow escaping in config stringSage Weil2011-09-201-2/+27
| | | | | | | | The config string is variously delimited by =, @, and /, depending on the field. Allow these characters to be escaped by preceeding them with \. Signed-off-by: Sage Weil <sage@newdream.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* rbd: call flush, if availableSage Weil2011-09-201-0/+12
| | | | | | | | librbd recently added async writeback and flush support. If the new rbd_flush() call is available, call it. Signed-off-by: Sage Weil <sage@newdream.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* rbd: update comment headingSage Weil2011-09-201-15/+13
| | | | | | | | Properly document the configuration string syntax and semantics. Remove (out of date) details about the librbd implementation. Signed-off-by: Sage Weil <sage@newdream.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* rbd: ignore failures when reading from default conf locationSage Weil2011-09-201-10/+4
| | | | | | | | | If we are reading from the default config location, ignore any failures. It is perfectly legal for the user to specify exactly the options they need and to not rely on any config file. Signed-off-by: Sage Weil <sage@newdream.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* VMDK: fix leak of extent_fileFam Zheng2011-09-201-4/+10
| | | | | | | | Release extent_file on error in vmdk_parse_extents. Added closing files in freeing extents. Signed-off-by: Fam Zheng <famcool@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* raw-posix: Fix bdrv_flush error return valuesKevin Wolf2011-09-191-1/+8
| | | | | | bdrv_flush is supposed to use 0/-errno return values Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* nbd: support feature negotiationPaolo Bonzini2011-09-191-2/+2
| | | | | | | | | nbd supports writing flags in bytes 24...27 of the header, and uses that for the read-only flag. Add support for it in qemu-nbd. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* Remove blanks before \n in output stringsStefan Weil2011-09-161-1/+1
| | | | | | | | | | | | | | Those blanks violate the coding conventions, see scripts/checkpatch.pl. Blanks missing after colons in the changed lines were added. This patch does not try to fix tabs, long lines and other problems in the changed lines, therefore checkpatch.pl reports many violations. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qcow2: fix range checkFrediano Ziglio2011-09-121-7/+7
| | | | | | | | | | | QCowL2Meta::offset is not cluster aligned but only sector aligned however nb_clusters count cluster from cluster start. This fix range check. Note that old code have no corruption issues related to this check cause it only cause intersection to occur when shouldn't. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: align cluster_data to block to improve performance using O_DIRECTFrediano Ziglio2011-09-121-7/+7
| | | | | Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: initialize metadata before inserting in cluster_allocsFrediano Ziglio2011-09-121-5/+5
| | | | | | | | | | | QCow2Meta structure was inserted into list before many fields are initialized. Currently is not a problem cause all occur in a lock but if qcow2_alloc_clusters would in a future unlock this lock some issues could arise. Initializing fields before inserting fix the problem. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* nbd: Clean up use of block_int.hMarkus Armbruster2011-09-121-0/+1
| | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* rbd: fix leak in qemu_rbd_open failure pathsSage Weil2011-09-121-15/+13
| | | | | | | | | | Fix leak of s->snap in failure path. Simplify error paths for the whole function. Reported-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Sage Weil <sage@newdream.net> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* rbd: clean up, fix styleSage Weil2011-09-121-9/+8
| | | | | | | | No assignment in condition. Remove duplicate ret > 0 check. Signed-off-by: Sage Weil <sage@newdream.net> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* rbd: allow client id to be specified in config stringSage Weil2011-09-121-8/+44
| | | | | | | | | | | Allow the client id to be specified in the config string via 'id=' so that users can control who they authenticate as. Currently they are stuck with the default ('admin'). This is necessary for anyone using authentication in their environment. Signed-off-by: Sage Weil <sage@newdream.net> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Rename bdrv_set_locked() to bdrv_lock_medium()Markus Armbruster2011-09-122-7/+7
| | | | | | | While there, make the locked parameter bool. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: removed unused depends_on fieldFrediano Ziglio2011-09-122-3/+1
| | | | | Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* VMDK: bugfix, opening vSphere 4 exported imageFam Zheng2011-09-061-2/+7
| | | | | | | | | The vSphere 4 exported image is streamOptimized extent, which is not quite correctly handled. Ignore rdgOffset when RGD flag bit not set. Signed-off-by: Fam Zheng <famcool@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* VMDK: bugfix, open Haiku vmdk imageFam Zheng2011-09-061-4/+11
| | | | | | | | | | | Haiku provides a specially formed vmdk image, which let qemu abort. It a combination of sparse header and flat data (i.e. with not l1/l2 table at all). The fix is turn to descriptor when sparse header is zero in field 'capacity'. Signed-off-by: Fam Zheng <famcool@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* VMDK: creating streamOptimized subformatFam Zheng2011-09-061-6/+12
| | | | | | | | | | Creating streamOptimized subformat. Added subformat option 'streamOptimized', to create a image with compression enabled and each cluster with a GrainMarker. Signed-off-by: Fam Zheng <famcool@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* VMDK: read/write compressed extentFam Zheng2011-09-061-11/+100
| | | | | | | | Add support for reading/writing compressed extent. Signed-off-by: Fam Zheng <famcool@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* VMDK: Opening compressed extent.Fam Zheng2011-09-061-0/+16
| | | | | | | | | Added flags field for compressed/streamOptimized extents, open and save image configuration. Signed-off-by: Fam Zheng <famcool@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* VMDK: separate vmdk_read_extent/vmdk_write_extentFam Zheng2011-09-061-9/+45
| | | | | | | | | Factor out read/write extent code, since there will be more things to take care of once reading/writing compressed clusters is introduced. Signed-off-by: Fam Zheng <famcool@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* VMDK: add twoGbMaxExtentSparse supportFam Zheng2011-09-061-50/+83
| | | | | | | | Add twoGbMaxExtentSparse support. Introduce vmdk_free_last_extent. Signed-off-by: Fam Zheng <famcool@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* VMDK: enable twoGbMaxExtentFlatFam Zheng2011-09-061-1/+3
| | | | | | | | | Enable the createType 'twoGbMaxExtentFlat'. The supporting code is already in. Signed-off-by: Fam Zheng <famcool@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block/raw: Fix to forward method bdrv_media_changed()Markus Armbruster2011-09-061-0/+7
| | | | | | | | | | | | | Block driver "raw" forwards most methods to the underlying block driver. However, it doesn't implement method bdrv_media_changed(). Makes bdrv_media_changed() always return -ENOTSUP. I believe -fda /dev/fd0 gives you raw over host_floppy, and disk change detection (fdc register 7 bit 7) is broken. Testing my theory requires a computer museum, though. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: Fix error cases to run depedent requestsKevin Wolf2011-09-061-3/+4
| | | | | | | Requests depending on a failed request would end up waiting forever. This fixes the error path to continue dependent requests even when the request has failed. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: Properly initialise QcowL2MetaKevin Wolf2011-09-061-2/+3
| | | | | | | Dependency list pointers filled with random garbage from the stack aren't a good idea. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* linux aio: some commentsFrediano Ziglio2011-09-061-0/+4
| | | | | | | | Add some notes about Linux AIO explaining why we don't use AIO in some situations. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* Use new macro QEMU_PACKED for packed structuresStefan Weil2011-09-034-10/+10
| | | | | | | | | | | | | | | | | | | | | Most changes were made using these commands: git grep -la '__attribute__((packed))'|xargs perl -pi -e 's/__attribute__\(\(packed\)\)/QEMU_PACKED/' git grep -la '__attribute__ ((packed))'|xargs perl -pi -e 's/__attribute__ \(\(packed\)\)/QEMU_PACKED/' git grep -la '__attribute__((__packed__))'|xargs perl -pi -e 's/__attribute__\(\(__packed__\)\)/QEMU_PACKED/' git grep -la '__attribute__ ((__packed__))'|xargs perl -pi -e 's/__attribute__ \(\(__packed__\)\)/QEMU_PACKED/' git grep -la '__attribute((packed))'|xargs perl -pi -e 's/__attribute\(\(packed\)\)/QEMU_PACKED/' Whitespace in linux-user/syscall_defs.h was fixed manually to avoid warnings from scripts/checkpatch.pl. Manual changes were also applied to hw/pc.c. I did not fix indentation with tabs in block/vvfat.c. The patch will show 4 errors with scripts/checkpatch.pl. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* qcow2: remove unused qcow2_create_refcount_update functionFrediano Ziglio2011-08-252-20/+0
| | | | | Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: use always stderr for debuggingFrediano Ziglio2011-08-252-3/+3
| | | | | | | let all DEBUG_ALLOC2 printf goes to stderr Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* sheepdog: use coroutinesMORITA Kazutaka2011-08-241-57/+93
| | | | | | | | | | | | This makes the sheepdog block driver support bdrv_co_readv/writev instead of bdrv_aio_readv/writev. With this patch, Sheepdog network I/O becomes fully asynchronous. The block driver yields back when send/recv returns EAGAIN, and is resumed when the sheepdog network connection is ready for the operation. Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: remove memory leakFrediano Ziglio2011-08-231-0/+2
| | | | | Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: Removed QCowAIOCB entirelyFrediano Ziglio2011-08-231-127/+80
| | | | | Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: reindent and use while before the big jumpFrediano Ziglio2011-08-231-137/+135
| | | | | | | prepare to remove read/write callbacks Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: remove common from QCowAIOCBFrediano Ziglio2011-08-231-4/+4
| | | | | Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: remove cluster_offset from QCowAIOCBFrediano Ziglio2011-08-231-11/+11
| | | | | Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: remove l2meta from QCowAIOCBFrediano Ziglio2011-08-231-7/+8
| | | | | Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: removed cur_nr_sectors field in QCowAIOCBFrediano Ziglio2011-08-231-55/+43
| | | | | Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: Removed unused AIOCB fieldsFrediano Ziglio2011-08-231-7/+3
| | | | | Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow: remove old #undefined codeFrediano Ziglio2011-08-231-63/+0
| | | | | Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow: Remove QCowAIOCBFrediano Ziglio2011-08-231-168/+123
| | | | | | | Embed qcow_aio_read_cb into qcow_co_readv and qcow_aio_write_cb into qcow_co_writev Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow: move some blocks of code to avoid useless variable initializationFrediano Ziglio2011-08-231-27/+26
| | | | | Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow: QCowAIOCB field cleanupFrediano Ziglio2011-08-231-72/+65
| | | | | | | remove unused field from this structure and put some of them in qcow_aio_read_cb and qcow_aio_write_cb Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow/qcow2: Allocate QCowAIOCB structure using stackFrediano Ziglio2011-08-232-63/+27
| | | | | | | instead of calling qemi_aio_get use stack Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block/curl: Handle failed reads gracefully.Nicholas Thomas2011-08-231-1/+19
| | | | | | | | | | | | | | | | | | | Current behaviour if a read fails is for the acb to not get finished. This causes an infinite loop in bdrv_read_em (block.c). The read failure never gets reported to the guest and if the error condition clears, the process never recovers. With this patch, when curl reports a failure we finish the acb as a failure. This results in the guest receiving an I/O error (rather than the read hanging indefinitely) and if the error condition subsequently clears, retries work as expected. The simplest test is to put an ISO on a web server you have control over and open it with qemu-io. Then move the ISO out of the way and attempt to read some data - you should see behaviour matching the above. Signed-off-by: Nick Thomas <nick@bytemark.co.uk> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow: initialize coroutine mutexScott Wood2011-08-231-0/+2
| | | | | | | | | commit 52b8eb60132b27ad53476490e9d7579003390cfa added a mutex, but never initialized it. This caused a segfault. Reported-by: Alexander Graf <agraf@suse.de> Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
OpenPOWER on IntegriCloud