[Qemu-block] [PULL 23/29] util - add automated ID generation utility

2015-10-16 Thread Kevin Wolf
this: #block076 The caller of id_generate() is responsible for freeing the generated node name string with g_free(). Reviewed-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia Signed-off-by: Jeff Cody Signed-off-by: Kevin Wolf --- include/qemu-common.h | 8

[Qemu-block] [PULL 24/29] block: auto-generated node-names

2015-10-16 Thread Kevin Wolf
From: Jeff Cody If a node-name is not specified, automatically generate the node-name. Generated node-names will use the "block" sub-system identifier. Signed-off-by: Jeff Cody Signed-off-by: Kevin Wolf --- block.c | 19 --- tests/qemu-i

[Qemu-block] [PULL 11/29] block: Convert bs->backing_hd to BdrvChild

2015-10-16 Thread Kevin Wolf
the pointer in there is enough for changing edges in the graph. Signed-off-by: Kevin Wolf Reviewed-by: Alberto Garcia Reviewed-by: Max Reitz Reviewed-by: Stefan Hajnoczi --- block.c | 105 +++--- block/io.c|

[Qemu-block] [PULL 27/29] qemu-nbd: always compile in --aio=MODE option

2015-10-16 Thread Kevin Wolf
unconditionally compile the option into qemu-nbd. After this patch qemu-nbd --aio=native works on Windows. Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- qemu-nbd.c | 8 1 file changed, 8 deletions(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index 6428c15..422a607 100644 --- a/qemu

[Qemu-block] [PULL 15/29] block-backend: Add blk_set_bs()

2015-10-16 Thread Kevin Wolf
It allows changing the BlockDriverState that a BlockBackend points to. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi --- block/block-backend.c | 17 + include/block/block_int.h | 2 ++ 2

[Qemu-block] [PULL 12/29] block: Manage backing file references in bdrv_set_backing_hd()

2015-10-16 Thread Kevin Wolf
this ugliness shortly. Signed-off-by: Kevin Wolf Reviewed-by: Alberto Garcia Reviewed-by: Max Reitz Reviewed-by: Stefan Hajnoczi --- block.c | 68 ++- block/mirror.c| 16 +--- block/stream.c

[Qemu-block] [PULL 18/29] blockjob: Store device name at job creation

2015-10-16 Thread Kevin Wolf
ing else identifying the job. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi --- block/mirror.c | 3 +-- blockjob.c | 15 --- include/block/blockjob.h | 8 3 files

[Qemu-block] [PULL 29/29] blkdebug: Don't confuse image as backing file

2015-10-16 Thread Kevin Wolf
ic Blake Signed-off-by: Kevin Wolf --- block/blkdebug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index c1cb3cb..6860a2b 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -426,7 +426,7 @@ static int blkdebug_open(BlockDriver

[Qemu-block] [PULL 21/29] block: Allow bdrv_unref_child(bs, NULL)

2015-10-16 Thread Kevin Wolf
bdrv_unref() can be called with a NULL argument and doesn't do anything then. Make bdrv_unref_child() consistent with it. Signed-off-by: Kevin Wolf Reviewed-by: Jeff Cody --- block.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c index f3

[Qemu-block] [PULL 19/29] block: Add and use bdrv_replace_in_backing_chain()

2015-10-16 Thread Kevin Wolf
-img must change its code accordingly (which makes it easier to understand); the other callers stays unchanged because after completion they don't do anything with the BDS, but just with the job, and the job is still owned by the source BDS. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Rev

[Qemu-block] [PULL 25/29] raw-posix: warn about BDRV_O_NATIVE_AIO if libaio is unavailable

2015-10-16 Thread Kevin Wolf
that does not support libaio. There are probably users using aio=native who would be inconvenienced if QEMU suddenly refused to start their guests. In the future this will become an error. Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block/raw-posix.c | 11 ++- 1 file

[Qemu-block] [PULL 26/29] blockdev: always compile in -drive aio= parsing

2015-10-16 Thread Kevin Wolf
From: Stefan Hajnoczi CONFIG_LINUX_AIO is an implementation detail of raw-posix.c. Don't mention CONFIG_LINUX_AIO in blockdev.c. Let block drivers decide what to do with BDRV_O_NATIVE_AIO. They may print an error if it is unsupported. Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin

[Qemu-block] [PULL 20/29] block: Remove bdrv_swap()

2015-10-16 Thread Kevin Wolf
bdrv_swap() is unused now. Remove it and all functions that have no other users than bdrv_swap(). In particular, this removes the .bdrv_rebind callbacks from block drivers. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia Reviewed-by: Fam Zheng Reviewed-by: Stefan

[Qemu-block] [PULL 28/29] qcow2: Remove forward declaration of QCowAIOCB

2015-10-16 Thread Kevin Wolf
This struct doesn't exist any more since commit 3fc48d09 in August 2011, it's about time to remove its forward declaration. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- block/qcow2.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/block/qcow2.h b/block/qcow2.h ind

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Kevin Wolf
Am 16.10.2015 um 17:10 hat Paul Durrant geschrieben: > > -Original Message- > > From: Kevin Wolf [mailto:kw...@redhat.com] > > Sent: 16 October 2015 16:02 > > To: Paul Durrant > > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Kevin Wolf
Am 16.10.2015 um 18:20 hat Paul Durrant geschrieben: > > -Original Message- > > From: Kevin Wolf [mailto:kw...@redhat.com] > > Sent: 16 October 2015 17:12 > > To: Paul Durrant > > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Kevin Wolf
Am 16.10.2015 um 18:53 hat Paul Durrant geschrieben: > > > > > > Just tell your admin what virtual hardware you really need. (Or tell > > > > > > them to give you a proper interface to configure your VMs yourself.) > > > > > > > > > > > > > > > > My point is that the virtual hardware that the OS us

Re: [Qemu-block] [PATCH 0/3] Add 'blockdev-del' command

2015-10-19 Thread Kevin Wolf
Am 13.10.2015 um 15:48 hat Alberto Garcia geschrieben: > Here's my first attempt at the 'blockdev-del' command. > > This series goes on top of Max's "BlockBackend and media" v6: > > https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg02810.html > > With Max's code, 'blockdev-add' can now cr

Re: [Qemu-block] [Qemu-devel] Question about odd snapshot behaviour

2015-10-19 Thread Kevin Wolf
[ CC: qemu-block ] Am 19.10.2015 um 07:27 hat Sam Bobroff geschrieben: > Hi all, > > While working through the QEMU code that saves and loads snapshots, I've > noticed some confusing behaviour when using named VM snapshots that may need > to > be fixed somehow. This is what I've noticed: > > *

Re: [Qemu-block] [PATCH v6 18/39] block: Add BlockBackendRootState

2015-10-19 Thread Kevin Wolf
Am 12.10.2015 um 22:00 hat Max Reitz geschrieben: > This structure will store some of the state of the root BDS if the BDS > tree is removed, so that state can be restored once a new BDS tree is > inserted. > > Signed-off-by: Max Reitz Random thought, not directly related to this series: We cur

Re: [Qemu-block] [PATCH v6 18/39] block: Add BlockBackendRootState

2015-10-19 Thread Kevin Wolf
Am 19.10.2015 um 16:32 hat Max Reitz geschrieben: > On 19.10.2015 16:18, Kevin Wolf wrote: > > Am 12.10.2015 um 22:00 hat Max Reitz geschrieben: > >> This structure will store some of the state of the root BDS if the BDS > >> tree is removed, so that state can be rest

Re: [Qemu-block] [PATCH 0/3] Add 'blockdev-del' command

2015-10-19 Thread Kevin Wolf
Am 19.10.2015 um 16:15 hat Alberto Garcia geschrieben: > On Mon 19 Oct 2015 01:27:45 PM CEST, Kevin Wolf wrote: > > I've been thinking a bit about the creation and deletion of > > BlockBackends a bit last week, and honestly it still feels a bit messy > > (or maybe I just

Re: [Qemu-block] [PATCH v7 27/39] block: Add blk_remove_bs()

2015-10-20 Thread Kevin Wolf
Am 19.10.2015 um 17:53 hat Max Reitz geschrieben: > This function removes the BlockDriverState associated with the given > BlockBackend from that BB and sets the BDS pointer in the BB to NULL. > > Signed-off-by: Max Reitz > --- > block/block-backend.c | 12 > include/sysemu

Re: [Qemu-block] [PATCH v7 00/39] blockdev: BlockBackend and media

2015-10-20 Thread Kevin Wolf
Am 19.10.2015 um 17:53 hat Max Reitz geschrieben: > This series reworks a lot regarding BlockBackend and media. Basically, > it allows empty BlockBackends, that is BBs without a BDS tree. > > Before this series, empty drives are represented by a BlockBackend with > an empty BDS attached to it (a B

Re: [Qemu-block] [PATCH v4 00/12] block: Protect nested event loop with bdrv_drained_begin and bdrv_drained_end

2015-10-20 Thread Kevin Wolf
Am 20.10.2015 um 07:16 hat Fam Zheng geschrieben: > v4: Rebase on to master so fix the "bdrv_move_feature_fields" issue. > > v3: Call bdrv_drain unconditionally in bdrv_drained_begin. > Document the internal I/O implications between bdrv_drain_begin and end. > > The nested aio_poll()'s in blo

Re: [Qemu-block] [PATCH v5 00/12] block: Protect nested event loop with bdrv_drained_begin and bdrv_drained_end

2015-10-21 Thread Kevin Wolf
ications between bdrv_drain_begin and end. > > The nested aio_poll()'s in block layer has a bug that new r/w requests from > ioeventfds and nbd exports are processed, which might break the caller's > semantics (qmp_transaction) or even pointers (bdrv_reopen). Patches 1-8 and 10-12: Reviewed-by: Kevin Wolf

Re: [Qemu-block] [PATCH v5 09/12] block: Add "drained begin/end" for internal snapshot

2015-10-21 Thread Kevin Wolf
Am 21.10.2015 um 04:06 hat Fam Zheng geschrieben: > This ensures the atomicity of the transaction by avoiding processing of > external requests such as those from ioeventfd. > > state->bs is assigned right after bdrv_drained_begin. Because it was > used as the flag for deletion or not in abort, no

Re: [Qemu-block] [PATCH] throttle: Remove throttle_group_lock/unlock()

2015-10-22 Thread Kevin Wolf
Am 21.10.2015 um 20:36 hat Alberto Garcia geschrieben: > The group throttling code was always meant to handle its locking > internally. However, bdrv_swap() was touching the ThrottleGroup > structure directly and therefore needed an API for that. > > Now that bdrv_swap() no longer exists there's n

Re: [Qemu-block] [PATCH 0/2] Fix werror=enospc for qcow2 on iscsi

2015-10-22 Thread Kevin Wolf
Am 22.10.2015 um 10:45 hat Paolo Bonzini geschrieben: > On 22/10/2015 10:17, Fam Zheng wrote: > > When qcow2 is created on iscsi target with a virtual size greater than > > physical > > capacity of the LUN, over time it's possible that guest fills too much data > > and > > at that point, new clus

Re: [Qemu-block] [PATCH 1/2] iscsi: Translate scsi sense into error code

2015-10-22 Thread Kevin Wolf
Am 22.10.2015 um 10:17 hat Fam Zheng geschrieben: > Previously we return -EIO blindly when anything goes wrong. Add a helper > function to parse sense fields and try to make the return code more > meaningful. > > Signed-off-by: Fam Zheng > --- > block/iscsi.c | 56 +++

Re: [Qemu-block] [PATCH v6 09/12] block: Add "drained begin/end" for internal snapshot

2015-10-22 Thread Kevin Wolf
Am 22.10.2015 um 08:32 hat Fam Zheng geschrieben: > This ensures the atomicity of the transaction by avoiding processing of > external requests such as those from ioeventfd. > > state->bs is assigned right after bdrv_drained_begin. Because it was > used as the flag for deletion or not in abort, no

Re: [Qemu-block] [PATCH 0/3] Add 'blockdev-del' command

2015-10-22 Thread Kevin Wolf
Am 20.10.2015 um 17:02 hat Alberto Garcia geschrieben: > On Mon 19 Oct 2015 05:04:50 PM CEST, Kevin Wolf wrote: > >> > So we seem to have two criteria to distinguish BDSes: > >> > > >> > 1. Does/Doesn't have a BlockBackend on top. > >> >

Re: [Qemu-block] [PATCH v6 11/12] qed: Implement .bdrv_drain

2015-10-22 Thread Kevin Wolf
Am 22.10.2015 um 08:32 hat Fam Zheng geschrieben: > 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. In > compliance to the bdrv_drain semantics we should make sure it remains > deleted once .bdrv_drain is ca

Re: [Qemu-block] [PATCH 0/3] Add 'blockdev-del' command

2015-10-22 Thread Kevin Wolf
Am 22.10.2015 um 13:08 hat Alberto Garcia geschrieben: > >> I'm currently thinking about d), which tries to maintain the symmetry > >> with blockdev-add: > >> > >> - blockdev-del would have two parameters, 'id' and 'node-name', and only > >> one of them can be set, so you must choose whether you

Re: [Qemu-block] [PATCH 0/3] Add 'blockdev-del' command

2015-10-22 Thread Kevin Wolf
Am 22.10.2015 um 13:31 hat Alberto Garcia geschrieben: > On Thu 22 Oct 2015 01:25:05 PM CEST, Kevin Wolf wrote: > >> But there's this case that is not so obvious. It involves the new > >> 'blockdev-snapshot' command I'm working on: > >> > &

Re: [Qemu-block] [PATCH v7 00/10] block: Protect nested event loop with bdrv_drained_begin and bdrv_drained_end

2015-10-23 Thread Kevin Wolf
Am 23.10.2015 um 05:08 hat Fam Zheng geschrieben: > v7: Exclude bdrv_drain and bdrv_qed_drain patches, they'll follow the > bdrv_drain fix for bdrv_aio_flush. > Fix internal snapshot clean. > > v6: Add Kevin's rev-by in patches 1-3, 6-8, 10, 12. > Add Jeff's rev-by in patches 1, 2, 6-8

Re: [Qemu-block] [PATCH v7 28/39] blockdev: Add blockdev-open-tray

2015-10-23 Thread Kevin Wolf
Am 19.10.2015 um 17:53 hat Max Reitz geschrieben: > Signed-off-by: Max Reitz > --- > blockdev.c | 49 + > qapi/block-core.json | 23 +++ > qmp-commands.hx | 39 +++ > 3 files cha

Re: [Qemu-block] [PATCH v7 28/39] blockdev: Add blockdev-open-tray

2015-10-23 Thread Kevin Wolf
Am 19.10.2015 um 17:53 hat Max Reitz geschrieben: > Signed-off-by: Max Reitz > --- > blockdev.c | 49 + > qapi/block-core.json | 23 +++ > qmp-commands.hx | 39 +++ > 3 files cha

Re: [Qemu-block] [PATCH v7 30/39] blockdev: Add blockdev-remove-medium

2015-10-23 Thread Kevin Wolf
Am 19.10.2015 um 17:53 hat Max Reitz geschrieben: > Signed-off-by: Max Reitz I assume that you'll fix the bdrv_states issues in blk_insert/remove_bs, so the blk_remove_bs() call in this patch will take care of it. If so, you can add: Reviewed-by: Kevin Wolf

Re: [Qemu-block] [PATCH v7 31/39] blockdev: Add blockdev-insert-medium

2015-10-23 Thread Kevin Wolf
Am 21.10.2015 um 15:47 hat Max Reitz geschrieben: > On 21.10.2015 13:49, Alberto Garcia wrote: > > On Mon 19 Oct 2015 05:53:37 PM CEST, Max Reitz wrote: > >> And a helper function for that, which directly takes a pointer to the > >> BDS to be inserted instead of its node-name (which will be used fo

Re: [Qemu-block] [PATCH v7 29/39] blockdev: Add blockdev-close-tray

2015-10-23 Thread Kevin Wolf
Am 19.10.2015 um 17:53 hat Max Reitz geschrieben: > Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf

Re: [Qemu-block] [PATCH v7 32/39] blockdev: Implement eject with basic operations

2015-10-23 Thread Kevin Wolf
Am 19.10.2015 um 17:53 hat Max Reitz geschrieben: > Implement 'eject' by calling blockdev-open-tray and > blockdev-remove-medium. > > Signed-off-by: Max Reitz > --- > blockdev.c | 11 +-- > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/blockdev.c b/blockdev.c > index

Re: [Qemu-block] [PATCH v7 31/39] blockdev: Add blockdev-insert-medium

2015-10-23 Thread Kevin Wolf
Am 19.10.2015 um 17:53 hat Max Reitz geschrieben: > And a helper function for that, which directly takes a pointer to the > BDS to be inserted instead of its node-name (which will be used for > implementing 'change' using blockdev-insert-medium). > > Signed-off-by: Max Reitz > --- > blockdev.c

Re: [Qemu-block] [PATCH v7 34/39] block: Inquire tray state before tray-moved events

2015-10-23 Thread Kevin Wolf
d it again (or it might have been possible, at least). This is > no longer possible, though. > > Signed-off-by: Max Reitz > Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf

Re: [Qemu-block] [PATCH v7 33/39] blockdev: Implement change with basic operations

2015-10-23 Thread Kevin Wolf
Am 19.10.2015 um 17:53 hat Max Reitz geschrieben: > Implement 'change' on block devices by calling blockdev-open-tray, > blockdev-remove-medium, blockdev-insert-medium (a variation of that > which does not need a node-name) and blockdev-close-tray. > > Signed-off-by: Max Reitz > --- > blockdev.c

Re: [Qemu-block] [PATCH v7 35/39] qmp: Introduce blockdev-change-medium

2015-10-23 Thread Kevin Wolf
Am 19.10.2015 um 17:53 hat Max Reitz geschrieben: > Introduce a new QMP command 'blockdev-change-medium' which is intended > to replace the 'change' command for block devices. The existing function > qmp_change_blockdev() is accordingly renamed to > qmp_blockdev_change_medium(). > > Signed-off-by:

Re: [Qemu-block] [PATCH v7 28/39] blockdev: Add blockdev-open-tray

2015-10-23 Thread Kevin Wolf
Am 23.10.2015 um 16:26 hat Max Reitz geschrieben: > On 23.10.2015 15:26, Kevin Wolf wrote: > > Am 19.10.2015 um 17:53 hat Max Reitz geschrieben: > >> Signed-off-by: Max Reitz > >> --- > >> blockdev.c | 49 > >> +

Re: [Qemu-block] [PATCH v7 31/39] blockdev: Add blockdev-insert-medium

2015-10-23 Thread Kevin Wolf
Am 23.10.2015 um 16:35 hat Max Reitz geschrieben: > On 23.10.2015 15:42, Kevin Wolf wrote: > > Am 19.10.2015 um 17:53 hat Max Reitz geschrieben: > >> And a helper function for that, which directly takes a pointer to the > >> BDS to be inserted instead of its node-n

Re: [Qemu-block] [PATCH v7 28/39] blockdev: Add blockdev-open-tray

2015-10-23 Thread Kevin Wolf
Am 23.10.2015 um 17:25 hat Max Reitz geschrieben: > On 23.10.2015 16:45, Kevin Wolf wrote: > > Am 23.10.2015 um 16:26 hat Max Reitz geschrieben: > >> On 23.10.2015 15:26, Kevin Wolf wrote: > >>> Am 19.10.2015 um 17:53 hat Max Reitz geschrieben: &

[Qemu-block] [PULL 03/37] blockdev: Allow creation of BDS trees without BB

2015-10-23 Thread Kevin Wolf
sible. Many BDS options which are not parsed by bdrv_open() (like caching) cannot be specified for these BB-less BDS trees yet. A future patch will remove this limitation. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf Reviewed-by: Alberto Garcia Signed-off-b

[Qemu-block] [PULL 02/37] block: Set BDRV_O_INCOMING in bdrv_fill_options()

2015-10-23 Thread Kevin Wolf
From: Max Reitz This flag should not be set for the root BDS only, but for any BDS that is being created while incoming migration is pending, so setting it is moved from blockdev_init() to bdrv_fill_options(). Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf Reviewed

[Qemu-block] [PULL 09/37] block: Invoke change media CB before NULLing drv

2015-10-23 Thread Kevin Wolf
() (invoked by blk_is_inserted()) always returns false for BDS with drv set to NULL, blk_dev_change_media_cb() should therefore be called before drv is set to NULL. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block.c

[Qemu-block] [PULL 05/37] block: Make bdrv_is_inserted() return a bool

2015-10-23 Thread Kevin Wolf
From: Max Reitz Make bdrv_is_inserted(), blk_is_inserted(), and the callback BlockDriver.bdrv_is_inserted() return a bool. Suggested-by: Eric Blake Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block.c

[Qemu-block] [PULL 01/37] block: Remove host floppy support

2015-10-23 Thread Kevin Wolf
From: Max Reitz It has been deprecated as of 2.3, so we can now remove it. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/raw-posix.c| 222 ++- qapi/block-core.json | 9

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

2015-10-23 Thread Kevin Wolf
The following changes since commit 1e700f4c6cddaf29ce1d205f0f8e8b9255481930: Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2015-10-23-tag' into staging (2015-10-23 15:55:50 +0100) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for yo

[Qemu-block] [PULL 04/37] iotests: Only create BB if necessary

2015-10-23 Thread Kevin Wolf
d-off-by: Max Reitz Signed-off-by: Kevin Wolf --- tests/qemu-iotests/071 | 54 ++ tests/qemu-iotests/071.out | 12 +++ tests/qemu-iotests/081 | 18 +--- tests/qemu-iotests/081.out | 5 +++-- 4 files changed, 71 insertions(+

[Qemu-block] [PULL 08/37] block/raw_bsd: Drop raw_is_inserted()

2015-10-23 Thread Kevin Wolf
From: Max Reitz With the new automatically-recursive implementation of bdrv_is_inserted() checking by default whether all the children of a BDS are inserted, we can drop raw's own implementation. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf Reviewed-by: Al

[Qemu-block] [PULL 16/37] block: Move I/O status and error actions into BB

2015-10-23 Thread Kevin Wolf
From: Max Reitz These options are only relevant for the user of a whole BDS tree (like a guest device or a block job) and should thus be moved into the BlockBackend. Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf --- block.c| 125

[Qemu-block] [PULL 06/37] block: Add blk_is_available()

2015-10-23 Thread Kevin Wolf
Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/block-backend.c | 7 ++- include/sysemu/block-backend.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/block/block-backend.c b/block/block-backend.c

[Qemu-block] [PULL 07/37] block: Make bdrv_is_inserted() recursive

2015-10-23 Thread Kevin Wolf
From: Max Reitz If bdrv_is_inserted() is called on the top level BDS, it should make sure all nodes in the BDS tree are actually inserted. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block.c | 12 +--- 1 file changed, 9

[Qemu-block] [PULL 14/37] block: Remove wr_highest_sector from BlockAcctStats

2015-10-23 Thread Kevin Wolf
s tried to calculate the volume usage by (wr_highest_offset + 512) / volume_size, after this patch they will just assume the volume to be full slightly earlier than before. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf Signed-off-by:

[Qemu-block] [PULL 11/37] hw/usb-storage: Check whether BB is inserted

2015-10-23 Thread Kevin Wolf
From: Max Reitz Only call bdrv_add_key() on the BlockDriverState if it is not NULL. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- hw/usb/dev-storage.c | 30 -- 1 file changed

[Qemu-block] [PULL 20/37] block: Fail requests to empty BlockBackend

2015-10-23 Thread Kevin Wolf
, any request on the same BlockBackend as the guest uses should fail. If the BDS tree is supposed to be usable even after ejecting it from the guest, a different BlockBackend must be used. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/

[Qemu-block] [PULL 22/37] block: Add blk_insert_bs()

2015-10-23 Thread Kevin Wolf
From: Max Reitz This function associates the given BlockDriverState with the given BlockBackend. Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/block-backend.c | 11 +++ include/sysemu/block-backend.h | 1 + 2 files changed, 12

[Qemu-block] [PULL 21/37] block: Prepare remaining BB functions for NULL BDS

2015-10-23 Thread Kevin Wolf
: Max Reitz Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/block-backend.c | 72 +++ 1 file changed, 56 insertions(+), 16 deletions(-) diff --git a/block/block-backend.c b/block/block-backend.c index 2779c22..a5c58c5 100644 --- a/block

[Qemu-block] [PULL 10/37] hw/block/fdc: Implement tray status

2015-10-23 Thread Kevin Wolf
From: Max Reitz The tray of an FDD is open iff there is no medium inserted (there are only two states for an FDD: "medium inserted" or "no medium inserted"). Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- h

[Qemu-block] [PULL 18/37] block: Add BlockBackendRootState

2015-10-23 Thread Kevin Wolf
From: Max Reitz This structure will store some of the state of the root BDS if the BDS tree is removed, so that state can be restored once a new BDS tree is inserted. Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/block-backend.c | 40

[Qemu-block] [PULL 17/37] block/throttle-groups: Make incref/decref public

2015-10-23 Thread Kevin Wolf
ThrottleState pointer, respectively, instead of a ThrottleGroup pointer. Functionally, they are equivalent, but since ThrottleGroup is not meant to be used outside of block/throttle-groups.c, ThrottleState is easier to handle. Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf Signed-off-by: Kevin

[Qemu-block] [PULL 23/37] block: Prepare for NULL BDS

2015-10-23 Thread Kevin Wolf
From: Max Reitz blk_bs() will not necessarily return a non-NULL value any more (unless blk_is_available() is true or it can be assumed to otherwise, e.g. because it is called immediately after a successful blk_new_with_bs() or blk_new_open()). Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf

[Qemu-block] [PULL 24/37] blockdev: Do not create BDS for empty drive

2015-10-23 Thread Kevin Wolf
From: Max Reitz Do not use "rudimentary" BDSs for empty drives any longer (for freshly created drives). After a follow-up patch, empty drives will generally use a NULL BDS, not only the freshly created drives. Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf --- block

[Qemu-block] [PULL 15/37] block: Move BlockAcctStats into BlockBackend

2015-10-23 Thread Kevin Wolf
: Kevin Wolf Signed-off-by: Kevin Wolf --- block.c | 11 --- block/block-backend.c | 5 - block/io.c| 6 +- block/qapi.c | 24 ++-- include/block/block.h | 2 -- include/block/block_int.h | 3 --- 6

[Qemu-block] [PULL 25/37] blockdev: Pull out blockdev option extraction

2015-10-23 Thread Kevin Wolf
From: Max Reitz Extract some of the blockdev option extraction code from blockdev_init() into its own function. This simplifies blockdev_init() and will allow reusing the code in a different function added in a follow-up patch. Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf

[Qemu-block] [PULL 13/37] block: Move guest_block_size into BlockBackend

2015-10-23 Thread Kevin Wolf
From: Max Reitz guest_block_size is a guest device property so it should be moved into the interface between block layer and guest devices, which is the BlockBackend. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf Signed-off-by: Kevin

[Qemu-block] [PULL 26/37] blockdev: Allow more options for BB-less BDS tree

2015-10-23 Thread Kevin Wolf
From: Max Reitz Most of the options which blockdev_init() parses for both the BlockBackend and the root BDS are valid for just the root BDS as well (e.g. read-only). This patch allows specifying these options even if not creating a BlockBackend. Signed-off-by: Max Reitz Signed-off-by: Kevin

[Qemu-block] [PULL 19/37] block: Make some BB functions fall back to BBRS

2015-10-23 Thread Kevin Wolf
From: Max Reitz If there is no BDS tree attached to a BlockBackend, functions that can do so should fall back to the BlockBackendRootState structure. Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/block-backend.c | 28 1

[Qemu-block] [PULL 12/37] block: Fix BB AIOCB AioContext without BDS

2015-10-23 Thread Kevin Wolf
arcia Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/block-backend.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/block/block-backend.c b/block/block-backend.c index 74642dc..c7e0f7b 100644 --- a/block/block-backend.c +++ b/block/block-back

[Qemu-block] [PULL 35/37] block: Add "drained begin/end" for transactional blockdev-backup

2015-10-23 Thread Kevin Wolf
From: Fam Zheng Similar to the previous patch, make sure that external events are not dispatched during transaction operations. Signed-off-by: Fam Zheng Reviewed-by: Jeff Cody Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- blockdev.c | 9 - 1 file changed, 8 insertions(+), 1

[Qemu-block] [PULL 32/37] block: Introduce "drained begin/end" API

2015-10-23 Thread Kevin Wolf
From: Fam Zheng The semantics is that after bdrv_drained_begin(bs), bs will not get new external requests until the matching bdrv_drained_end(bs). Signed-off-by: Fam Zheng Signed-off-by: Kevin Wolf --- block/io.c| 17 + include/block/block.h | 19

[Qemu-block] [PULL 36/37] block: Add "drained begin/end" for internal snapshot

2015-10-23 Thread Kevin Wolf
lag - InternalSnapshotState.created. Signed-off-by: Fam Zheng Signed-off-by: Kevin Wolf --- blockdev.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 52f44b2..18712d2 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1370,6 +1370,7 @@ typedef str

[Qemu-block] [PULL 37/37] tests: Add test case for aio_disable_external

2015-10-23 Thread Kevin Wolf
From: Fam Zheng Signed-off-by: Fam Zheng Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/test-aio.c | 24 1 file changed, 24 insertions(+) diff --git a/tests/test-aio.c b/tests/test-aio.c index 03cd45d..1623803 100644 --- a/tests/test-aio.c +++ b/tests

[Qemu-block] [PULL 31/37] aio: introduce aio_{disable, enable}_external

2015-10-23 Thread Kevin Wolf
From: Fam Zheng Signed-off-by: Fam Zheng Signed-off-by: Kevin Wolf --- aio-posix.c | 3 ++- aio-win32.c | 3 ++- include/block/aio.h | 38 ++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/aio-posix.c b/aio-posix.c index

[Qemu-block] [PULL 27/37] throttle: Remove throttle_group_lock/unlock()

2015-10-23 Thread Kevin Wolf
) API anymore. Signed-off-by: Alberto Garcia Signed-off-by: Kevin Wolf --- block/throttle-groups.c | 31 +-- include/block/throttle-groups.h | 3 --- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/block/throttle-groups.c b/block/throttle-gro

[Qemu-block] [PULL 29/37] nbd: Mark fd handlers client type as "external"

2015-10-23 Thread Kevin Wolf
From: Fam Zheng So we could distinguish it from internal used fds, thus avoid handling unwanted events in nested aio polls. Signed-off-by: Fam Zheng Reviewed-by: Jeff Cody Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- nbd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[Qemu-block] [PULL 30/37] dataplane: Mark host notifiers' client type as "external"

2015-10-23 Thread Kevin Wolf
From: Fam Zheng They will be excluded by type in the nested event loops in block layer, so that unwanted events won't be processed there. Signed-off-by: Fam Zheng Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- hw/block/dataplane/virtio-blk.c | 5 ++--- hw/scsi/virtio

[Qemu-block] [PULL 34/37] block: Add "drained begin/end" for transactional backup

2015-10-23 Thread Kevin Wolf
gt;job and state->job, so it's OK. Signed-off-by: Fam Zheng Reviewed-by: Jeff Cody Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- blockdev.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index e4a5eb4..0a7848b 100644 --- a/bl

[Qemu-block] [PULL 33/37] block: Add "drained begin/end" for transactional external snapshot

2015-10-23 Thread Kevin Wolf
From: Fam Zheng This ensures the atomicity of the transaction by avoiding processing of external requests such as those from ioeventfd. Signed-off-by: Fam Zheng Reviewed-by: Jeff Cody Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- blockdev.c | 11 +-- 1 file changed, 9

[Qemu-block] [PULL 28/37] aio: Add "is_external" flag for event handlers

2015-10-23 Thread Kevin Wolf
From: Fam Zheng All callers pass in false, and the real external ones will switch to true in coming patches. Signed-off-by: Fam Zheng Reviewed-by: Jeff Cody Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- aio-posix.c | 6 - aio-win32.c

Re: [Qemu-block] [PATCH v7 38/39] hmp: Add read-only-mode option to change command

2015-10-26 Thread Kevin Wolf
ead-only-mode' is invalid for VNC"); Missing \n. > +return; > +} > if (strcmp(target, "passwd") == 0 || > strcmp(target, "password") == 0) { > if (!arg) { With that fixed: Reviewed-by: Kevin Wolf

Re: [Qemu-block] [PATCH v7 36/39] hmp: Use blockdev-change-medium for change command

2015-10-26 Thread Kevin Wolf
> > Signed-off-by: Max Reitz > Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf

Re: [Qemu-block] [PATCH v7 37/39] blockdev: read-only-mode for blockdev-change-medium

2015-10-26 Thread Kevin Wolf
can be set read-only or writable independently of > the drive. Some users may find it useful to be able to therefore change > the read-only status of a block device when changing the medium. > > Signed-off-by: Max Reitz > Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf

Re: [Qemu-block] [PATCH v7 35/39] qmp: Introduce blockdev-change-medium

2015-10-26 Thread Kevin Wolf
nge_medium(). > > Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf

Re: [Qemu-block] [PATCH v7 39/39] iotests: Add test for change-related QMP commands

2015-10-26 Thread Kevin Wolf
Am 19.10.2015 um 17:53 hat Max Reitz geschrieben: > Signed-off-by: Max Reitz > Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf

Re: [Qemu-block] [PATCH] block: Don't call blk_bs() twice in bdrv_lookup_bs()

2015-10-26 Thread Kevin Wolf
Am 26.10.2015 um 15:46 hat Alberto Garcia geschrieben: > Signed-off-by: Alberto Garcia Thanks, applied to the block branch. Kevin

Re: [Qemu-block] [PATCH v5 2/6] block: Avoid BlockDriverState.filename

2015-10-26 Thread Kevin Wolf
Am 19.10.2015 um 20:49 hat Max Reitz geschrieben: > In places which directly pass a filename to the OS, we should not use > the filename field at all but exact_filename instead (although the > former currently equals the latter if that is set). > > In raw_open_common(), we do not need to access BD

Re: [Qemu-block] [PATCH v5 3/6] block: Add bdrv_filename()

2015-10-26 Thread Kevin Wolf
is > only temporary). > > Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf

Re: [Qemu-block] [PATCH v5 4/6] qemu-img: Use bdrv_filename() for map

2015-10-26 Thread Kevin Wolf
Am 19.10.2015 um 20:49 hat Max Reitz geschrieben: > Replaces bs->filename by the result of bdrv_filename() in the > qemu-img map subcommand. Since that value is queried relatively often, > however, it should be cached. > > Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf

Re: [Qemu-block] [PATCH v5 1/6] block: Change bdrv_get_encrypted_filename()

2015-10-26 Thread Kevin Wolf
Am 19.10.2015 um 20:49 hat Max Reitz geschrieben: > Instead of returning a pointer to the filename, g_strdup() it. This will > become necessary once we do not have BlockDriverState.filename anymore. > > Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf

Re: [Qemu-block] [PATCH v5 5/6] block: Drop BlockDriverState.filename

2015-10-27 Thread Kevin Wolf
me)) is replaced by > bdrv_refresh_filename(bs) > (these were introduced by the patch before the previous patch) > - anywhere else bdrv_filename(..., NULL, 0) is used, any access to > BlockDriverState.filename is then replaced by the buffer returned, and > it is freed when it is no l

Re: [Qemu-block] [PATCH v5 6/6] iotests: Test changed Quorum filename

2015-10-27 Thread Kevin Wolf
> > Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf

Re: [Qemu-block] [PATCH v2 1/3] qemu-io: fix cvtnum lval types

2015-10-27 Thread Kevin Wolf
Am 27.10.2015 um 00:45 hat John Snow geschrieben: > cvtnum() returns int64_t: we should not be storing this > result inside of an int. > > In a few cases, we need an extra sprinkling of error handling > where we expect to pass this number on towards a function that > expects something smaller than

<    1   2   3   4   5   6   7   8   9   10   >