summaryrefslogtreecommitdiff
path: root/block.c
AgeCommit message (Collapse)AuthorFilesLines
2013-09-12block: Error parameter for create functionsMax Reitz1-24/+56
Add an Error ** parameter to bdrv_create and its associated functions to allow more specific error messages. Signed-off-by: Max Reitz <mreitz@redhat.com>
2013-09-12block: Error parameter for open functionsMax Reitz1-36/+64
Add an Error ** parameter to bdrv_open, bdrv_file_open and associated functions to allow more specific error messages. Signed-off-by: Max Reitz <mreitz@redhat.com>
2013-09-12bdrv: Use "Error" for creating imagesMax Reitz1-1/+1
Add an Error ** parameter to BlockDriver.bdrv_create to allow more specific error messages. Signed-off-by: Max Reitz <mreitz@redhat.com>
2013-09-12bdrv: Use "Error" for opening imagesMax Reitz1-2/+2
Add an Error ** parameter to BlockDriver.bdrv_open and BlockDriver.bdrv_file_open to allow more specific error messages. Signed-off-by: Max Reitz <mreitz@redhat.com>
2013-09-12block: Image file option amendmentMax Reitz1-0/+8
This patch adds the "amend" option to qemu-img which allows changing image options on existing image files. It also adds the generic bdrv implementation which is basically just a wrapper for the image format specific function. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-09-06block: look for zero blocks in bs->filePaolo Bonzini1-1/+15
Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-06block: add default get_block_status implementation for protocolsPaolo Bonzini1-1/+5
Protocols return raw data, so you can assume the offsets to pass through unchanged. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-06block: return BDRV_BLOCK_ZERO past end of backing filePaolo Bonzini1-2/+10
If the sectors are unallocated and we are past the end of the backing file, they will read as zero. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-06block: use bdrv_has_zero_init to return BDRV_BLOCK_ZEROPaolo Bonzini1-1/+10
Alternatively, this could use a "discard zeroes data" flag returned by bdrv_get_info. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-06block: define get_block_status return valuePaolo Bonzini1-2/+8
Define the return value of get_block_status. Bits 0, 1, 2 and 9-62 are valid; bit 63 (the sign bit) is reserved for errors. Bits 3-8 are left for future extensions. The return code is compatible with the old is_allocated API: if a driver only returns 0 or 1 (aka BDRV_BLOCK_DATA) like is_allocated used to, clients of is_allocated will not have any change in behavior. Still, we will return more precise information in the next patches and the new definition of bdrv_is_allocated is already prepared for this. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-06block: introduce bdrv_get_block_status APIPaolo Bonzini1-20/+26
For now, bdrv_get_block_status is just another name for bdrv_is_allocated. The next patches will add more flags. This also touches all block drivers with a mostly mechanical rename. The sole exception is cow; because it calls cow_co_is_allocated from the read code, we keep that function and make cow_co_get_block_status a wrapper. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-06block: make bdrv_has_zero_init return false for copy-on-write-imagesPaolo Bonzini1-0/+5
This helps implementing is_allocated on top of get_block_status. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-06block: expect errors from bdrv_co_is_allocatedPaolo Bonzini1-2/+5
Some bdrv_is_allocated callers do not expect errors, but the fallback in qcow2.c might make other callers trip on assertion failures or infinite loops. Fix the callers to always look for errors. Cc: qemu-stable@nongnu.org Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-06block: remove bdrv_is_allocated_above/bdrv_co_is_allocated_above distinctionPaolo Bonzini1-42/+4
Now that bdrv_is_allocated detects coroutine context, the two can use the same code. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-06block: do not use ->total_sectors in bdrv_co_is_allocatedPaolo Bonzini1-1/+7
This is more robust when the device has removable media. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-06block: make bdrv_co_is_allocated staticPaolo Bonzini1-9/+15
bdrv_is_allocated can detect coroutine context and go through a fast path, similar to other block layer functions. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-06block: keep bs->total_sectors up to date even for growable block devicesPaolo Bonzini1-1/+4
If a BlockDriverState is growable, after every write we need to check if bs->total_sectors might have changed. With this change, bdrv_getlength does not need anymore a system call. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-06block: make bdrv_delete() staticFam Zheng1-11/+12
Manage BlockDriverState lifecycle with refcnt, so bdrv_delete() is no longer public and should be called by bdrv_unref() if refcnt is decreased to 0. This is an identical change because effectively, there's no multiple reference of BDS now: no caller of bdrv_ref() yet, only bdrv_new() sets bs->refcnt to 1, so all bdrv_unref() now actually delete the BDS. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-06block: implement reference count for BlockDriverStateFam Zheng1-0/+21
Introduce bdrv_ref/bdrv_unref to manage the lifecycle of BlockDriverState. They are unused for now but will used to replace bdrv_delete() later. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-06block: Enable the new throttling code in the block layer.Benoît Canet1-243/+95
Signed-off-by: Benoit Canet <benoit@irqsave.net> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-30block: Remove redundant assertionKevin Wolf1-1/+0
The failing condition is checked immediately before the assertion, so keeping the assertion is kind of redundant. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-08-22aio / timers: Switch entire codebase to the new timer APIAlex Bligh1-7/+7
This is an autogenerated patch using scripts/switch-timer-api. Switch the entire code base to using the new timer API. Note this patch may introduce some line length issues. Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-22block: Produce zeros when protocols reading beyond end of fileMORITA Kazutaka1-1/+29
While Asias is debugging an issue creating qcow2 images on top of non-file protocols. It boils down to this example using NBD: $ qemu-io -c 'open -g nbd+unix:///?socket=/tmp/nbd.sock' -c 'read -v 0 512' Notice the open -g option to set bs->growable. This means you can read/write beyond end of file. Reading beyond end of file is supposed to produce zeroes. We rely on this behavior in qcow2_create2() during qcow2 image creation. We create a new file and then write the qcow2 header structure using bdrv_pwrite(). Since QCowHeader is not a multiple of sector size, block.c first uses bdrv_read() on the empty file to fetch the first sector (should be all zeroes). Here is the output from the qemu-io NBD example above: $ qemu-io -c 'open -g nbd+unix:///?socket=/tmp/nbd.sock' -c 'read -v 0 512' 00000000: ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................ 00000010: ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................ 00000020: ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................ ... We are not zeroing the buffer! As a result qcow2 image creation on top of protocols is not guaranteed to work even when file creation is supported by the protocol. [Adapted this patch to use bs->zero_beyond_eof. -- Stefan] Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Asias He <asias@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-22block: Introduce bs->zero_beyond_eofAsias He1-0/+2
In 4146b46c42e0989cb5842e04d88ab6ccb1713a48 (block: Produce zeros when protocols reading beyond end of file), we break qemu-iotests ./check -qcow2 022. This happens because qcow2 temporarily sets ->growable = 1 for vmstate accesses (which are stored beyond the end of regular image data). We introduce the bs->zero_beyond_eof to allow qcow2_load_vmstate() to disable ->zero_beyond_eof temporarily in addition to enable ->growable. [Since the broken patch "block: Produce zeros when protocols reading beyond end of file" has not been merged yet, I have applied this fix *first* and will then apply the next patch to keep the tree bisectable. -- Stefan] Suggested-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Asias He <asias@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-19block: stop relying on io_flush() in bdrv_drain_all()Stefan Hajnoczi1-10/+35
If a block driver has no file descriptors to monitor but there are still active requests, it can return 1 from .io_flush(). This is used to spin during synchronous I/O. Stop relying on .io_flush() and instead check QLIST_EMPTY(&bs->tracked_requests) to decide whether there are active requests. This is the first step in removing .io_flush() so that event loops no longer need to have the concept of synchronous I/O. Eventually we may be able to kill synchronous I/O completely by running everything in a coroutine, but that is future work. Note this patch moves bs->throttled_reqs initialization to bdrv_new() so that bdrv_requests_pending(bs) can safely access it. In practice bs is g_malloc0() so the memory is already zeroed but it's safer to initialize the queue properly. We also need to fix up block/stream.c:close_unused_images() to prevent traversing a dangling pointer while it rearranges the backing file chain. This is necessary since the new bdrv_drain_all() traverses the backing file chain. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-19block: ensure bdrv_drain_all() works during bdrv_delete()Stefan Hajnoczi1-2/+2
In bdrv_delete() make sure to call bdrv_make_anon() *after* bdrv_close() so that the device is still seen by bdrv_drain_all() when iterating bdrv_states. Cc: qemu-stable@nongnu.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-07-29block: Repair the throttling code.Benoît Canet1-4/+3
The throttling code was segfaulting since commit 02ffb504485f0920cfc75a0982a602f824a9a4f4 because some qemu_co_queue_next caller does not run in a coroutine. qemu_co_queue_do_restart assume that the caller is a coroutinne. As suggested by Stefan fix this by entering the coroutine directly. Also make sure like suggested that qemu_co_queue_next() and qemu_co_queue_restart_all() can be called only in coroutines. Signed-off-by: Benoit Canet <benoit@irqsave.net> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-07-26block: Allow "driver" option on the top levelKevin Wolf1-0/+7
This is traditionally -drive format=..., which is now translated into the new driver option. This gives us a more consistent way to select the driver of BlockDriverStates that can be used in QMP context, too. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-07-19block: fix bdrv_read_unthrottled()Peter Lieven1-1/+1
Signed-off-by: Peter Lieven <pl@kamp.de> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-07-19block: add bdrv_write_zeroes()Peter Lieven1-8/+19
Signed-off-by: Peter Lieven <pl@kamp.de> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-07-15block: Add return value for bdrv_flush_all()Kevin Wolf1-2/+8
bdrv_flush() can fail, and bdrv_flush_all() should return an error as well if this happens for a block device. It returns the first error return now, but still at least tries to flush the remaining devices even in error cases. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-07-15block: Don't parse protocol from file.filenameKevin Wolf1-5/+12
One of the major reasons for doing something new for -blockdev and blockdev-add was that the old block layer code parses filenames instead of just taking them literally. So we should really leave it untouched when it's passing using the new interfaces (like -drive file.filename=...). This allows opening relative file names that contain a colon. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-07-05block: fix bdrv_flush() ordering in bdrv_close()Stefan Hajnoczi1-2/+3
Since 80ccf93b we flush the block device during close. The bdrv_drain_all() call should come before bdrv_flush() to ensure guest write requests have completed. Otherwise we may miss pending writes when flushing. Call bdrv_drain_all() again for safety as the final step after bdrv_flush(). This should not be necessary but we can be paranoid here in case bdrv_flush() left I/O pending. Cc: qemu-stable@nongnu.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
2013-06-28block: change default of .has_zero_init to 0Peter Lieven1-1/+7
.has_zero_init defaults to 1 for all formats and protocols. this is a dangerous default since this means that all new added drivers need to manually overwrite it to 0 if they do not ensure that a device is zero initialized after bdrv_create(). if a driver needs to explicitly set this value to 1 its easier to verify the correctness in the review process. during review of the existing drivers it turned out that ssh and gluster had a wrong default of 1. both protocols support host_devices as backend which are not by default zero initialized. this wrong assumption will lead to possible corruption if qemu-img convert is used to write to such a backend. vpc and vmdk also defaulted to 1 altough they support fixed respectively flat extends. this has to be addresses in separate patches. both formats as well as the mentioned ssh and gluster are turned to the default of 0 with this patch for safety. a similar problem with the wrong default existed for iscsi most likely because the driver developer did oversee the default value of 1. Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-06-28block: add bdrv_add_before_write_notifier()Stefan Hajnoczi1-11/+12
The bdrv_add_before_write_notifier() function installs a callback that is invoked before a write request is processed. This will be used to implement copy-on-write point-in-time snapshots where we need to copy out old data before overwriting it. Note that BdrvTrackedRequest is moved to block_int.h since it is passed to .notify() functions. Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-06-24block: Always enable discard on the protocol levelKevin Wolf1-1/+1
Turning on discard options in qcow2 doesn't help a lot when the discard requests that it issues are thrown away by the raw-posix layer. This patch always enables discard functionality on the protocol level so that it's the image format's responsibility to send (or not) discard requests. Requests sent by the guest will be allowed or ignored by the top level BlockDriverState, which depends on the discard=... option like before. In particular, this means that even without specifying options, the qcow2 default of discarding deleted snapshots actually takes effect now, both for qemu and qemu-img. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-06-17block: bdrv_reopen_prepare(): don't use QERR_OPEN_FILE_FAILEDLuiz Capitulino1-2/+2
The call to drv->bdrv_reopen_prepare() can fail due to reasons other than an open failure. Unfortunately, we can't use errno nor -ret, cause they are not always set. Stick to a generic error message then. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Kevin Wolf <kwolf@redhat.com>
2013-06-06blkdebug: Add BLKDBG_FLUSH_TO_OS/DISK eventsKevin Wolf1-4/+4
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-06-04block: move qmp and info dump related code to block/qapi.cWenchao Xia1-185/+0
This patch is a pure code move patch, except following modification: 1 get_human_readable_size() is changed to static function. 2 dump_human_image_info() is renamed to bdrv_image_info_dump(). 3 in qmp_query_block() and qmp_query_blockstats, use bdrv_next(bs) instead of direct traverse of global array 'bdrv_states'. 4 collect_snapshots() and collect_image_info() are renamed, unused parameter *fmt in collect_image_info() is removed. 5 code style fix. To avoid conflict and tip better, macro in header file is BLOCK_QAPI_H instead of QAPI_H. Now block.h and snapshot.h are at the same level in include path, block_int.h and qapi.h will both include them. Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-06-04block: move snapshot code in block.c to block/snapshot.cWenchao Xia1-100/+0
All snapshot related code, except bdrv_snapshot_dump() and bdrv_is_snapshot(), is moved to block/snapshot.c. bdrv_snapshot_dump() will be moved to another file later. bdrv_is_snapshot() is not related with internal snapshot. It also fixes small code style errors reported by check script. Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-06-04block: drop bs_snapshots global variableStefan Hajnoczi1-28/+0
The bs_snapshots global variable points to the BlockDriverState which will be used to save vmstate. This is really a savevm.c concept but was moved into block.c:bdrv_snapshots() when it became clear that hotplug could result in a dangling pointer. While auditing the block layer's global state I came upon bs_snapshots and realized that a variable is not necessary here. Simply find the first BlockDriverState capable of internal snapshots each time this is needed. The behavior of bdrv_snapshots() is preserved across hotplug because new drives are always appended to the bdrv_states list. This means that calling the new find_vmstate_bs() function is idempotent - it returns the same BlockDriverState unless it was hot-unplugged. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-06-04block: add block driver read only whitelistFam Zheng1-16/+27
We may want to include a driver in the whitelist for read only tasks such as diagnosing or exporting guest data (with libguestfs as a good example). This patch introduces a readonly whitelist option, and for backward compatibility, the old configure option --block-drv-whitelist is now an alias to rw whitelist. Drivers in readonly list is only permitted to open file readonly, and returns -ENOTSUP for RW opening. E.g. To include vmdk readonly, and others read+write: ./configure --target-list=x86_64-softmmu \ --block-drv-rw-whitelist=qcow2,raw,file,qed \ --block-drv-ro-whitelist=vmdk Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-05-14block: Add hint to -EFBIG error messageKevin Wolf1-2/+6
The limit of qcow2 files at least depends on the cluster size. If the image format has a cluster_size option, suggest to increase it. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-04-22block: Fix build with tracing enabledKevin Wolf1-7/+7
filename was still uninitialised when it's used as a parameter to a tracing function, so let's move the initialisation. Also, commit c2ad1b0c forgot to add a NULL check, which this patch adds while we're at it. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Tested-by: Andreas Färber <afaerber@suse.de> Message-id: 1366645720-11384-1-git-send-email-kwolf@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-22block: Allow overriding backing.file.filenameKevin Wolf1-1/+3
If a filename is passed in the driver-specific options from the command line, the backing file path from the image is ignored now. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-04-22block: Remove filename parameter from .bdrv_file_open()Kevin Wolf1-6/+2
It is unused now in all block drivers. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-04-22block: Enable filename optionKevin Wolf1-4/+27
This allows using the file.filename option instead of the string that comes from -drive file=... and is passed around as a separate parameter. The goal is to get rid of this parameter and use the options QDict more consistently. With this option you can access not only the top-level image, but specify a filename for the backing file (currently only if no backing file exists, but we'll allow overriding it later) Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-04-22block: Add driver-specific options for backing filesKevin Wolf1-4/+23
Options starting in "backing." are passed to the backing file now. If you don't need to specify the filename for the backing file, you can add it on the command line instead of in the image file: $ qemu-nbd -t /tmp/test.img $ qemu-img create -f qcow2 empty.qcow2 1G $ qemu-system-x86_64 -drive file=empty.qcow2,backing.file.driver=nbd,\ backing.file.host=localhost Note that this doesn't override the backing filename from the image. If the image has one, this will fail because NBD doesn't want the options and a filename at the same time. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-04-22block: Fail gracefully when using a format driver on protocol levelKevin Wolf1-0/+7
Specifying the wrong driver could fail an assertion: $ qemu-system-x86_64 -drive file.driver=qcow2,file=x qemu-system-x86_64: block.c:721: bdrv_open_common: Assertion `file != ((void *)0)' failed. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-04-15block: Introduce bdrv_pwritev() for qcow2_save_vmstateKevin Wolf1-22/+58
Directly pass the QEMUIOVector on instead of linearising it. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>