Re: [Qemu-block] [PATCH v2 1/1] block: add gluster ifdef guard checks for SEEK_DATA/SEEK_HOLE support

2016-10-07 Thread Eric Blake
On 10/07/2016 04:48 PM, Jeff Cody wrote: > Add checks to see if the system compiling QEMU has support for > SEEK_HOLE/SEEK_DATA. If the system does not, we will flag that seek > data is unsupported in gluster. > > Note: this is not a check on whether the gluster server itself supports >

[Qemu-block] [PATCH v2 1/1] block: add gluster ifdef guard checks for SEEK_DATA/SEEK_HOLE support

2016-10-07 Thread Jeff Cody
Add checks to see if the system compiling QEMU has support for SEEK_HOLE/SEEK_DATA. If the system does not, we will flag that seek data is unsupported in gluster. Note: this is not a check on whether the gluster server itself supports SEEK_DATA (that is already done during runtime), but rather

Re: [Qemu-block] [PATCH 22/22] specs/qcow2: do not use wording 'bitmap header'

2016-10-07 Thread Eric Blake
On 09/30/2016 05:53 AM, Vladimir Sementsov-Ogievskiy wrote: > For now bitmap directory entry some times called 'bitmap header'. This Awkward wording; maybe: A bitmap directory entry is sometimes called a 'bitmap header'. > patch leaves only one name - 'bitmap directory entry'. The name 'bitmap

Re: [Qemu-block] [PATCH 21/22] specs/qcow2: fix bitmap granularity qemu-specific note

2016-10-07 Thread Eric Blake
On 09/30/2016 05:53 AM, Vladimir Sementsov-Ogievskiy wrote: > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > docs/specs/qcow2.txt | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/docs/specs/qcow2.txt b/docs/specs/qcow2.txt > index

Re: [Qemu-block] [PATCH 15/22] qcow2-bitmap: add autoclear bit

2016-10-07 Thread Max Reitz
On 30.09.2016 12:53, Vladimir Sementsov-Ogievskiy wrote: > Add autoclear bit for handling rewriting image by old qemu version. "Add support for the autoclear bit [...]"? > > If autoclear bit is not set, but bitmaps extension is found it > would not be loaded and warning will be generated. "If

Re: [Qemu-block] [PATCH 14/22] qcow2: delete bitmaps on truncate

2016-10-07 Thread Max Reitz
On 30.09.2016 12:53, Vladimir Sementsov-Ogievskiy wrote: > This will not touch loaded bitmaps, as they are alredy removed from the > image. Well, yes, and I don't think that's ideal. :-) I think marking them in_use instead of deleting them would be better. Also, I'm not so sure whether this

Re: [Qemu-block] [PATCH 13/22] qcow2-bitmap: check constraints

2016-10-07 Thread Max Reitz
On 30.09.2016 12:53, Vladimir Sementsov-Ogievskiy wrote: > Check bitmap header constraints as specified in docs/specs/qcow2.txt > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/qcow2-bitmap.c | 39 +++ > 1 file changed,

Re: [Qemu-block] [PATCH 17/22] qmp: add autoload parameter to block-dirty-bitmap-add

2016-10-07 Thread Eric Blake
On 09/30/2016 05:53 AM, Vladimir Sementsov-Ogievskiy wrote: > Optional. Default is false. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > Signed-off-by: Denis V. Lunev > --- > blockdev.c | 22 -- > qapi/block-core.json

Re: [Qemu-block] [PATCH 16/22] qmp: add persistent flag to block-dirty-bitmap-add

2016-10-07 Thread Eric Blake
On 09/30/2016 05:53 AM, Vladimir Sementsov-Ogievskiy wrote: > Add optional 'persistent' flag to qmp command block-dirty-bitmap-add. > Default is false. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > Signed-off-by: Denis V. Lunev > --- > blockdev.c

Re: [Qemu-block] [PATCH 12/22] qcow2-bitmap: add IN_USE flag

2016-10-07 Thread Max Reitz
On 30.09.2016 12:53, Vladimir Sementsov-Ogievskiy wrote: > This flag means that the bitmap is now in use by the software or was not > successfully saved. In any way, with this flag set the bitmap data must > be considered inconsistent and should not be loaded. > > With current implementation this

Re: [Qemu-block] [PATCH 07/22] qcow2-bitmap: introduce auto-loading bitmaps

2016-10-07 Thread Max Reitz
On 30.09.2016 12:53, Vladimir Sementsov-Ogievskiy wrote: > Auto loading bitmaps are bitmaps in Qcow2, with AUTO flag set. They are > loaded at image open and becomes BdrvDirtyBitmap's for corresponding > drive. These bitmaps are deleted from Qcow2 image after loading to avoid > conflicts. > >

Re: [Qemu-block] [PATCH 11/22] qcow2-bitmap: add qcow2_store_persistent_bitmaps()

2016-10-07 Thread Max Reitz
On 30.09.2016 12:53, Vladimir Sementsov-Ogievskiy wrote: > Realize block bitmap stroing interface, to allow qcow2 images store > persistent bitmaps. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/qcow2-bitmap.c | 241 >

Re: [Qemu-block] [Qemu-devel] [PATCH v2 10/11] blockjob: refactor backup_start as backup_job_create

2016-10-07 Thread John Snow
On 09/30/2016 06:00 PM, John Snow wrote: Refactor backup_start as backup_job_create, which only creates the job, but does not automatically start it. The old interface, 'backup_start', is not kept in favor of limiting the number of nearly-identical iterfaces that would have to be edited to

Re: [Qemu-block] [PATCH 10/22] block/dirty-bitmap: add bdrv_dirty_bitmap_next()

2016-10-07 Thread Max Reitz
On 30.09.2016 12:53, Vladimir Sementsov-Ogievskiy wrote: > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/dirty-bitmap.c | 7 +++ > include/block/dirty-bitmap.h | 3 +++ > 2 files changed, 10 insertions(+) Reviewed-by: Max Reitz

Re: [Qemu-block] [PATCH 09/22] block: introduce persistent dirty bitmaps

2016-10-07 Thread Max Reitz
On 30.09.2016 12:53, Vladimir Sementsov-Ogievskiy wrote: > New field BdrvDirtyBitmap.persistent means, that bitmap should be saved > on bdrv_close, using format driver. Format driver should maintain bitmap > storing. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > ---

Re: [Qemu-block] [PATCH 08/22] block/dirty-bitmap: add autoload field to BdrvDirtyBitmap

2016-10-07 Thread Max Reitz
On 30.09.2016 12:53, Vladimir Sementsov-Ogievskiy wrote: > Mirror AUTO flag from Qcow2 bitmap in BdrvDirtyBitmap. This will be > needed in future, to save this flag back to Qcow2 for persistent > bitmaps. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- >

Re: [Qemu-block] [PATCH] block: Remove "options" indirection from blockdev-add

2016-10-07 Thread Eric Blake
On 10/07/2016 10:38 AM, Kevin Wolf wrote: > Now that QAPI supports boxed types, we can have unions at the top level > of a command, so let's put our real options directly there for > blockdev-add instead of having a single "options" dict that contains the > real arguments. > > blockdev-add is

[Qemu-block] [PATCH 0/3] block: new bdrv_drain implementation

2016-10-07 Thread Paolo Bonzini
Another tiny bit from the multiqueue series. This takes care of reimplementing bdrv_drain to process each BDS in the tree in order. A side effect is to separate draining of data writes from draining of metadata writes, which allows us to reinstate QED's .bdrv_drain implementation. A couple words

[Qemu-block] [PATCH 3/3] qed: Implement .bdrv_drain

2016-10-07 Thread Paolo Bonzini
From: Fam Zheng The "need_check_timer" is used to clear the "NEED_CHECK" flag in the image header after a grace period once metadata update has finished. To comply with the bdrv_drain semantics, we should make sure it remains deleted once .bdrv_drain is called. The change to

[Qemu-block] [PATCH 2/3] block: change drain to look only at one child at a time

2016-10-07 Thread Paolo Bonzini
bdrv_requests_pending is checking children to also wait until internal requests (such as metadata writes) have completed. However, checking children is in general overkill. Children requests can be of two kinds: - requests caused by an operation on bs, e.g. a bdrv_aio_write to bs causing a

[Qemu-block] [PATCH 1/3] block: add BDS field to count in-flight requests

2016-10-07 Thread Paolo Bonzini
Unlike tracked_requests, this field also counts throttled requests, and remains non-zero if an AIO operation needs a BH to be "really" completed. With this change, it is no longer necessary to have a dummy BdrvTrackedRequest for requests that are never serialising, and it is no longer necessary

[Qemu-block] [PATCH 2/2] qemu-img: change opening method for the output in dd

2016-10-07 Thread Reda Sallahi
The subcommand dd was creating an output image regardless of whether there was one already created. With this patch we try to check first if the output image exists and resize it if necessary. Signed-off-by: Reda Sallahi --- qemu-img.c | 124

[Qemu-block] [PATCH 1/2] qemu-img: make img_open() able to surpress file opening errors

2016-10-07 Thread Reda Sallahi
Previously img_open() always printed file opening errors even if the intended action is just to check the file existence as is sometimes the case in qemu-img dd. This adds an argument (openerror) to img_open() that specifies whether to print an opening error or not. Signed-off-by: Reda Sallahi

[Qemu-block] [PATCH] block: Remove "options" indirection from blockdev-add

2016-10-07 Thread Kevin Wolf
Now that QAPI supports boxed types, we can have unions at the top level of a command, so let's put our real options directly there for blockdev-add instead of having a single "options" dict that contains the real arguments. blockdev-add is still experimental and we already made substantial

[Qemu-block] [PATCH 0/2] qemu-img: change img_open() and opening method in dd

2016-10-07 Thread Reda Sallahi
The patch series include the previously submitted patch: [PATCH v5] qemu-img: change opening method for the output in dd Changes from v5: * Replace access() with a modified version of img_open() in img_dd() Depends on: [PATCH v3] qemu-img: add conv=notrunc option to dd Reda Sallahi (2):

Re: [Qemu-block] [PATCH 1/1] block: add gluster ifdef guard checks for SEEK_DATA/SEEK_HOLE support

2016-10-07 Thread Jeff Cody
On Fri, Oct 07, 2016 at 09:20:54AM -0500, Eric Blake wrote: > On 10/06/2016 10:53 PM, Jeff Cody wrote: > > Add checks to see if the system compiling QEMU has support for > > SEEK_HOLE/SEEK_DATA. If the system does not, we will flag that seek > > data is unsupported in gluster. > > > > Note: this

Re: [Qemu-block] [Qemu-devel] [PATCH v14 03/21] qapi: add trace events for visitor

2016-10-07 Thread Daniel P. Berrange
On Fri, Oct 07, 2016 at 03:59:07PM +0200, Markus Armbruster wrote: > "Daniel P. Berrange" writes: > > > Allow tracing of the operation of visitors > > > > Signed-off-by: Daniel P. Berrange > > --- > > Makefile.objs | 1 + > >

Re: [Qemu-block] [PATCH 1/1] block: add gluster ifdef guard checks for SEEK_DATA/SEEK_HOLE support

2016-10-07 Thread Eric Blake
On 10/06/2016 10:53 PM, Jeff Cody wrote: > Add checks to see if the system compiling QEMU has support for > SEEK_HOLE/SEEK_DATA. If the system does not, we will flag that seek > data is unsupported in gluster. > > Note: this is not a check on whether the gluster server itself supports >

Re: [Qemu-block] [Qemu-devel] [PATCH v14 03/21] qapi: add trace events for visitor

2016-10-07 Thread Markus Armbruster
"Daniel P. Berrange" writes: > Allow tracing of the operation of visitors > > Signed-off-by: Daniel P. Berrange > --- > Makefile.objs | 1 + > qapi/qapi-visit-core.c | 27 +++ > qapi/trace-events | 33

Re: [Qemu-block] [PATCH] qcow2: Optimize L2 table cache size based on image and cluster sizes

2016-10-07 Thread Frank Myhr
On 10/07/2016 06:56 AM, Alberto Garcia wrote: I would like to know what's the use case you (Frank, Ed) are thinking about: - Are we talking about command-line options, QMP, or both? Command-line options alone are sufficient for my use case, which is configuring and starting VMs using

[Qemu-block] [PULL 09/10] module: Don't load the same module if requested multiple times

2016-10-07 Thread Kevin Wolf
From: Fam Zheng Use a hash table to keep record of all loaded modules, and return early if the requested module is already loaded. Signed-off-by: Fam Zheng Message-id: 1473043845-13197-3-git-send-email-f...@redhat.com Reviewed-by: Stefan Hajnoczi

[Qemu-block] [PULL 05/10] block: Add node name to BLOCK_IO_ERROR event

2016-10-07 Thread Kevin Wolf
The event currently only contains the BlockBackend name. However, with anonymous BlockBackends, this is always the empty string. Add the node name so that the user can still see which block device caused the event. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz

[Qemu-block] [PULL 10/10] dmg: Move libbz2 code to dmg-bz2.so

2016-10-07 Thread Kevin Wolf
From: Fam Zheng dmg.o was moved to block-obj-m in 5505e8b76 to become a separate module, so that its reference to libbz2, since 6b383c08c, doesn't add an extra library to the main executable. Until recently, commit 06e60f70a (blockdev: Add dynamic module loading for block

[Qemu-block] [PULL 08/10] scripts: Allow block module to not define BlockDriver

2016-10-07 Thread Kevin Wolf
From: Fam Zheng Signed-off-by: Fam Zheng Message-id: 1473043845-13197-2-git-send-email-f...@redhat.com Reviewed-by: Stefan Hajnoczi Signed-off-by: Max Reitz --- scripts/modules/module_block.py | 7 --- 1 file

[Qemu-block] [PULL 07/10] block: Add qdev ID to DEVICE_TRAY_MOVED

2016-10-07 Thread Kevin Wolf
The event currently only contains the BlockBackend name. However, with anonymous BlockBackends, this is always the empty string. Add the qdev ID (or if none was given, the QOM path) so that the user can still see which device caused the event. Event generation has to be moved from bdrv_eject() to

[Qemu-block] [PULL 01/10] block: use bdrv_add_before_write_notifier

2016-10-07 Thread Kevin Wolf
From: Paolo Bonzini Register the notifier using the specific API for block devices. Signed-off-by: Paolo Bonzini Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf

[Qemu-block] [PULL 03/10] block: use aio_bh_schedule_oneshot

2016-10-07 Thread Kevin Wolf
From: Paolo Bonzini This simplifies bottom half handlers by removing calls to qemu_bh_delete and thus removing the need to stash the bottom half pointer in the opaque datum. Signed-off-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi

[Qemu-block] [PULL 02/10] async: add aio_bh_schedule_oneshot

2016-10-07 Thread Kevin Wolf
From: Paolo Bonzini qemu_bh_delete is already clearing bh->scheduled at the same time as it's setting bh->deleted. Since it's not using any memory barriers, there is no synchronization going on for bh->deleted, and this makes the bh->deleted checks superfluous in

[Qemu-block] [PULL 00/10] Block layer patches

2016-10-07 Thread Kevin Wolf
The following changes since commit e902754e3d0890945ddcc1b33748ed73762ddb8d: Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.8-20161006' into staging (2016-10-06 13:34:00 +0100) are available in the git repository at: git://repo.or.cz/qemu/kevin.git block for you to fetch

[Qemu-block] [PULL 04/10] block: Add bdrv_runtime_opts to query-command-line-options

2016-10-07 Thread Kevin Wolf
Recently we moved a few options from QemuOptsLists in blockdev.c to bdrv_runtime_opts in block.c in order to make them accissble using blockdev-add. However, this has the side effect that these options are missing from query-command-line-options now, and libvirt consequently disables the

[Qemu-block] [PULL 06/10] block-backend: Remember if attached device is non-qdev

2016-10-07 Thread Kevin Wolf
Almost all block devices are qdevified by now. This allows us to go back from the BlockBackend to the DeviceState. xen_disk is the last device that is missing. We'll remember in the BlockBackend if a xen_disk is attached and can then disable any features that require going from a BB to the

Re: [Qemu-block] [PATCH 05/22] qcow2-bitmap: structs and consts

2016-10-07 Thread Vladimir Sementsov-Ogievskiy
On 01.10.2016 17:34, Max Reitz wrote: On 30.09.2016 12:53, Vladimir Sementsov-Ogievskiy wrote: Create block/qcow2-bitmap.c Add data structures and constraints accordingly to docs/specs/qcow2.txt Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/Makefile.objs |

Re: [Qemu-block] [PATCH 2/2] quorum: do not allocate multiple iovecs for FIFO strategy

2016-10-07 Thread Alberto Garcia
On Wed 05 Oct 2016 06:35:27 PM CEST, Paolo Bonzini wrote: > In FIFO mode there are no parallel reads, hence there is no need to > allocate separate buffers and clone the iovecs. > > The two cases of quorum_aio_cb are now even more different, and > most of quorum_aio_finalize is only needed in one

Re: [Qemu-block] [PATCH 1/2] quorum: change child_iter to children_read

2016-10-07 Thread Alberto Garcia
On Wed 05 Oct 2016 06:35:26 PM CEST, Paolo Bonzini wrote: > This simplifies a bit the code by using the usual C "inclusive start, > exclusive end" pattern for ranges. > > Signed-off-by: Paolo Bonzini Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [PATCH] qcow2: Optimize L2 table cache size based on image and cluster sizes

2016-10-07 Thread Alberto Garcia
On Fri 07 Oct 2016 10:14:32 AM CEST, Kevin Wolf wrote: >> Maybe pass a negative integer to indicate percentage, so string is not >> required?: >> l2-cache-size=-100(l2-cache-size=max, covers entire drive) >> l2-cache-size=-50 (l2-cache-size=50% of max, covers half of drive) >>

Re: [Qemu-block] [Qemu-devel] [PATCH] block: Add bdrv_runtime_opts to query-command-line-options

2016-10-07 Thread Gerd Hoffmann
On Do, 2016-10-06 at 11:40 +0200, Kevin Wolf wrote: > Recently we moved a few options from QemuOptsLists in blockdev.c to > bdrv_runtime_opts in block.c in order to make them accissble using > blockdev-add. However, this has the side effect that these options are > missing from

Re: [Qemu-block] [Qemu-devel] [PULL 10/18] block: Move 'discard' option to bdrv_open_common()

2016-10-07 Thread Kevin Wolf
Am 07.10.2016 um 11:01 hat Gerd Hoffmann geschrieben: > On Di, 2016-09-27 at 15:53 +0200, Kevin Wolf wrote: > > This enables its use for nested child nodes. The compatibility > > between the 'discard' and 'detect-zeroes' setting is checked in > > bdrv_open_common() now as the former setting isn't

Re: [Qemu-block] [Qemu-devel] [PULL 10/18] block: Move 'discard' option to bdrv_open_common()

2016-10-07 Thread Gerd Hoffmann
On Di, 2016-09-27 at 15:53 +0200, Kevin Wolf wrote: > This enables its use for nested child nodes. The compatibility > between the 'discard' and 'detect-zeroes' setting is checked in > bdrv_open_common() now as the former setting isn't available before > calling bdrv_open() any more. Seems this

Re: [Qemu-block] [PATCH] qcow2: Optimize L2 table cache size based on image and cluster sizes

2016-10-07 Thread Kevin Wolf
[ Restoring the CC list, adding Eric for QAPI ] Am 06.10.2016 um 20:36 hat Frank Myhr geschrieben: > Thanks Alberto for pointing me to Ed Swierk's patch and this discussion. > > On Wed 05 Oct 2016 16:57:57 +0200, Alberto Garcia wrote: > > > Frank Myhr's suggestion (in bugzilla) is that we allow

Re: [Qemu-block] [Qemu-devel] [PATCH v2 04/11] blockjobs: Always use block_job_get_aio_context

2016-10-07 Thread Paolo Bonzini
On 06/10/2016 22:22, John Snow wrote: > Calls .complete(), for which the only implementation is > mirror_complete. Uh, this actually seems messy. Looks like there's > nothing to prevent us from calling this after we've already told it to > complete once. Yeah, it should have an if