Re: [Qemu-block] [PATCH v2 00/11] aio: Introduce handler type to fix nested aio_poll for dataplane

2015-09-07 Thread Fam Zheng
On Fri, 08/28 12:53, Stefan Hajnoczi wrote: > On Wed, Jul 29, 2015 at 12:42:03PM +0800, Fam Zheng wrote: > > v2: Switch to disable/enable model. [Paolo] > > > > Most existing nested aio_poll()'s in block layer are inconsiderate of > > dispatching potential new r/w requests from ioeventfds and nbd

Re: [Qemu-block] [PATCH v2 2/2] block: add a 'blockdev-snapshot' QMP command

2015-09-07 Thread Alberto Garcia
On Fri 04 Sep 2015 04:42:17 PM CEST, Eric Blake wrote: >> @@ -1183,6 +1183,18 @@ void qmp_blockdev_snapshot_sync(bool has_device, >> const char *device, >> , errp); >> } >> >> +void qmp_blockdev_snapshot(const char *device, const char *snapshot, > >

Re: [Qemu-block] [PATCH 0/5] block: Drop drv parameter from bdrv_open()

2015-09-07 Thread Kevin Wolf
Am 26.08.2015 um 19:47 hat Max Reitz geschrieben: > We don't really need that parameter, so let's drop it. Doing so may even > fix some bugs, see > http://lists.nongnu.org/archive/html/qemu-block/2015-08/msg00171.html. > > In the course of writing this series, I had to decide whether the make >

Re: [Qemu-block] [PATCH v2 13/13] qemu-iotests: More qcow2 reopen tests

2015-09-07 Thread Kevin Wolf
Am 04.09.2015 um 21:52 hat Max Reitz geschrieben: > On 04.09.2015 19:18, Kevin Wolf wrote: > > Signed-off-by: Kevin Wolf > > --- > > tests/qemu-iotests/137 | 143 > > + > > tests/qemu-iotests/137.out | 43 ++ > >

Re: [Qemu-block] [PATCH v2 13/13] qemu-iotests: More qcow2 reopen tests

2015-09-07 Thread Kevin Wolf
Am 07.09.2015 um 14:08 hat Kevin Wolf geschrieben: > Am 04.09.2015 um 21:52 hat Max Reitz geschrieben: > > On 04.09.2015 19:18, Kevin Wolf wrote: > > > Signed-off-by: Kevin Wolf > > > --- > > > tests/qemu-iotests/137 | 143 > > >

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/6] replace qemu_fls() with pow2ceil()/pow2floor()

2015-09-07 Thread Peter Maydell
Ping? Paolo, do you want to take these, should I just apply them to master, or what? thanks -- PMM On 24 July 2015 at 13:33, Peter Maydell wrote: > We have a qemu_fls() function which is just a silly wrapper > around clz32() and which is used in only a handful of

Re: [Qemu-block] [PATCH] block/iscsi: validate block size returned from target

2015-09-07 Thread Paolo Bonzini
On 31/08/2015 10:38, Peter Lieven wrote: >> >> diff --git a/block/iscsi.c b/block/iscsi.c >> index 5002916..fac3a7a 100644 >> --- a/block/iscsi.c >> +++ b/block/iscsi.c >> @@ -1214,6 +1214,10 @@ static void iscsi_readcapacity_sync(IscsiLun >> *iscsilun, Error **errp) >> if (task == NULL

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/6] replace qemu_fls() with pow2ceil()/pow2floor()

2015-09-07 Thread Peter Maydell
On 7 September 2015 at 13:34, Paolo Bonzini wrote: > > > On 07/09/2015 13:04, Peter Maydell wrote: >> Ping? >> >> Paolo, do you want to take these, should I just apply them >> to master, or what? > > Sorry, I thought you were applying these or pulling them through your >

Re: [Qemu-block] [PATCH v4 02/38] blockdev: Allow creation of BDS trees without BB

2015-09-07 Thread Kevin Wolf
Am 20.07.2015 um 19:45 hat Max Reitz geschrieben: > If the "id" field is missing from the options given to blockdev-add, > just omit the BlockBackend and create the BlockDriverState tree alone. > > However, if "id" is missing, "node-name" must be specified; otherwise, > the BDS tree would no

Re: [Qemu-block] [PATCH v4 01/38] block: Remove host floppy support

2015-09-07 Thread Max Reitz
On 07.09.2015 17:59, Kevin Wolf wrote: > Am 20.07.2015 um 19:45 hat Max Reitz geschrieben: >> It has been deprecated as of 2.3, so we can now remove it. >> >> Signed-off-by: Max Reitz > >> @@ -2241,8 +2188,9 @@ static BlockAIOCB *hdev_aio_ioctl(BlockDriverState *bs, >>

Re: [Qemu-block] [PATCH v4 01/38] block: Remove host floppy support

2015-09-07 Thread Kevin Wolf
Am 20.07.2015 um 19:45 hat Max Reitz geschrieben: > It has been deprecated as of 2.3, so we can now remove it. > > Signed-off-by: Max Reitz > @@ -2241,8 +2188,9 @@ static BlockAIOCB *hdev_aio_ioctl(BlockDriverState *bs, > pool =

[Qemu-block] [PATCH v3 05/13] qcow2: Factor out qcow2_update_options()

2015-09-07 Thread Kevin Wolf
Eventually we want to be able to change options at runtime. As a first step towards that goal, separate some option handling code from the general initialisation code in qcow2_open(). Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Max Reitz

[Qemu-block] [PATCH v3 01/13] block: Allow specifying driver-specific options to reopen

2015-09-07 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- block.c | 42 +++--- block/commit.c| 4 ++-- include/block/block.h | 4 +++- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git

[Qemu-block] [PATCH v3 02/13] qemu-io: Remove duplicate 'open' error message

2015-09-07 Thread Kevin Wolf
qemu_opts_parse_noisily() already prints an error message with the exact reason why the parsing failed. No need to add another less specific one. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- qemu-io.c | 1 - 1 file changed, 1 deletion(-) diff --git

[Qemu-block] [PATCH v3 04/13] qcow2: Improve error message

2015-09-07 Thread Kevin Wolf
Eric says that "any" sounds better than "either", and my non-native feeling says the same, so let's change it. Suggested-by: Eric Blake Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- block/qcow2.c | 2 +- 1 file changed, 1

[Qemu-block] [PATCH v3 07/13] qcow2: Move rest of option handling to qcow2_update_options()

2015-09-07 Thread Kevin Wolf
With this commit, the handling of driver-specific options in qcow2_open() is completely separated out into qcow2_update_options(). Signed-off-by: Kevin Wolf --- block/qcow2.c | 134 +- 1 file changed, 68 insertions(+), 66

[Qemu-block] [PATCH v3 13/13] qemu-iotests: More qcow2 reopen tests

2015-09-07 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- tests/qemu-iotests/137 | 145 + tests/qemu-iotests/137.out | 42 + tests/qemu-iotests/group | 1 + 3 files changed, 188 insertions(+) create mode 100755 tests/qemu-iotests/137

Re: [Qemu-block] [PATCH v2 2/2] block: add a 'blockdev-snapshot' QMP command

2015-09-07 Thread Alberto Garcia
On Mon 07 Sep 2015 04:55:47 PM CEST, Kevin Wolf wrote: > Of course, this means that we need to provide a way to actually > fulfill the right conditions, and you might be right that it doesn't > exist yet. Could the same effect as BDRV_O_NO_BACKING possibly be > achieved with blockdev-add with

[Qemu-block] [PATCH v3 11/13] qcow2: Support updating driver-specific options in reopen

2015-09-07 Thread Kevin Wolf
For updating the cache sizes or disabling lazy refcounts there is a bit more to do than just changing the variables, but otherwise we're all set for changing options during bdrv_reopen(). Just implement the missing pieces and hook the functions up in bdrv_reopen(). Signed-off-by: Kevin Wolf

[Qemu-block] [PATCH v3 03/13] qemu-io: Add command 'reopen'

2015-09-07 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- qemu-io-cmds.c | 90 ++ 1 file changed, 90 insertions(+) diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c index 53477e1..d6572a8 100644 ---

[Qemu-block] [PATCH v3 06/13] qcow2: Move qcow2_update_options() call up

2015-09-07 Thread Kevin Wolf
qcow2_update_options() only updates some variables in BDRVQcowState and doesn't really depend on other parts of it being initialised yet, so it can be moved so that it immediately follows the other half of option handling code in qcow2_open(). Signed-off-by: Kevin Wolf

[Qemu-block] [PATCH v3 09/13] qcow2: Fix memory leak in qcow2_update_options() error path

2015-09-07 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Max Reitz --- block/qcow2.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 923b9dd..226b1b1 100644 ---

[Qemu-block] [PATCH v3 12/13] qemu-iotests: Reopen qcow2 with lazy-refcounts change

2015-09-07 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- tests/qemu-iotests/039 | 27 +++ tests/qemu-iotests/039.out | 18 ++ 2 files changed, 45 insertions(+) diff --git a/tests/qemu-iotests/039

[Qemu-block] [PATCH v3 08/13] qcow2: Leave s unchanged on qcow2_update_options() failure

2015-09-07 Thread Kevin Wolf
On return, either all new options should be applied to BDRVQcowState (on success), or all of the old settings should be preserved (on failure). Signed-off-by: Kevin Wolf --- block/qcow2.c | 57 +++-- 1 file changed, 35

Re: [Qemu-block] [PATCH 2/2] ide/atapi: partially avoid deadlock if the storage backend is dead

2015-09-07 Thread Stefan Hajnoczi
On Sun, Sep 06, 2015 at 11:24:10AM +0200, Peter Lieven wrote: > > Taking a step back, what are the semantics of writing !(val & > > BM_CMD_START)? Is the device guaranteed to cancel/complete requests > > during the register write? > > I have to check that. John, do you have an idea? > > Stefan,

Re: [Qemu-block] [PATCH 1/1] ide: unify io_buffer_offset increments

2015-09-07 Thread Paolo Bonzini
On 26/08/2015 01:45, John Snow wrote: > IDEState's io_buffer_offset was originally added to keep track of offsets > in AHCI rather exclusively, but it was added to IDEState instead of an > AHCI-specific structure. Interesting to see something weird turn into feature. :) Reviewed-by: Paolo

Re: [Qemu-block] [PATCH v4 02/38] blockdev: Allow creation of BDS trees without BB

2015-09-07 Thread Max Reitz
On 07.09.2015 18:12, Kevin Wolf wrote: > Am 20.07.2015 um 19:45 hat Max Reitz geschrieben: >> If the "id" field is missing from the options given to blockdev-add, >> just omit the BlockBackend and create the BlockDriverState tree alone. >> >> However, if "id" is missing, "node-name" must be

Re: [Qemu-block] [PATCH v4 06/38] block: Make bdrv_is_inserted() recursive

2015-09-07 Thread Kevin Wolf
Am 20.07.2015 um 19:45 hat Max Reitz geschrieben: > 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: Alberto

Re: [Qemu-block] [PATCH v4 07/38] block/quorum: Implement bdrv_is_inserted()

2015-09-07 Thread Max Reitz
On 07.09.2015 20:03, Kevin Wolf wrote: > Am 20.07.2015 um 19:45 hat Max Reitz geschrieben: >> bdrv_is_inserted() should be invoked recursively on the children of >> quorum. >> >> Signed-off-by: Max Reitz >> Reviewed-by: Eric Blake >> Reviewed-by: Alberto

Re: [Qemu-block] [PATCH v4 07/38] block/quorum: Implement bdrv_is_inserted()

2015-09-07 Thread Kevin Wolf
Am 07.09.2015 um 20:04 hat Max Reitz geschrieben: > On 07.09.2015 20:03, Kevin Wolf wrote: > > Am 20.07.2015 um 19:45 hat Max Reitz geschrieben: > >> bdrv_is_inserted() should be invoked recursively on the children of > >> quorum. > >> > >> Signed-off-by: Max Reitz > >>

Re: [Qemu-block] [PATCH v4 06/38] block: Make bdrv_is_inserted() recursive

2015-09-07 Thread Max Reitz
On 07.09.2015 19:43, Kevin Wolf wrote: > Am 20.07.2015 um 19:45 hat Max Reitz geschrieben: >> 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

Re: [Qemu-block] [PATCH v4 07/38] block/quorum: Implement bdrv_is_inserted()

2015-09-07 Thread Kevin Wolf
Am 20.07.2015 um 19:45 hat Max Reitz geschrieben: > bdrv_is_inserted() should be invoked recursively on the children of > quorum. > > Signed-off-by: Max Reitz > Reviewed-by: Eric Blake > Reviewed-by: Alberto Garcia If you implement patch

Re: [Qemu-block] [PATCH v4 03/38] iotests: Only create BB if necessary

2015-09-07 Thread Max Reitz
On 07.09.2015 18:20, Kevin Wolf wrote: > Am 20.07.2015 um 19:45 hat Max Reitz geschrieben: >> Tests 071 and 081 test giving references in blockdev-add. It is not >> necessary to create a BlockBackend here, so omit it. >> >> Signed-off-by: Max Reitz >> Reviewed-by: Eric Blake

Re: [Qemu-block] [PATCH v4 09/38] hw/block/fdc: Implement tray status

2015-09-07 Thread Kevin Wolf
Am 20.07.2015 um 19:45 hat Max Reitz geschrieben: > 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"). > > This results in the tray being reported as open if qemu has been started > with the default

[Qemu-block] [PATCH v2 2/2] Backup: don't do copy-on-read in before_write_notifier

2015-09-07 Thread Wen Congyang
We will copy data in before_write_notifier to do backup. It is a nested I/O request, so we cannot do copy-on-read. The steps to reproduce it: 1. -drive copy-on-read=on,... // qemu option 2. drive_backup -f disk0 /path_to_backup.img // monitor command Signed-off-by: Wen Congyang

Re: [Qemu-block] [Qemu-devel] [PATCH 06/16] quorum: allow ignoring child errors

2015-09-07 Thread Wen Congyang
On 09/08/2015 12:56 AM, Dr. David Alan Gilbert wrote: > * Eric Blake (ebl...@redhat.com) wrote: >> On 09/02/2015 02:51 AM, Wen Congyang wrote: >>> If the child is not ready, read/write/getlength/flush will >>> return -errno. It is not critical error, and can be ignored: >>> 1. read/write: >>>

[Qemu-block] [PATCH v2 1/2] block: Introduce a new API bdrv_co_no_copy_on_readv()

2015-09-07 Thread Wen Congyang
In some cases, we need to disable copy-on-read, and just read the data. Signed-off-by: Wen Congyang --- block/io.c| 12 +++- include/block/block.h | 9 ++--- trace-events | 1 + 3 files changed, 18 insertions(+), 4 deletions(-) diff

Re: [Qemu-block] [PATCH v2 2/2] block: add a 'blockdev-snapshot' QMP command

2015-09-07 Thread Alberto Garcia
On Fri 04 Sep 2015 04:42:17 PM CEST, Eric Blake wrote: >> +if (snapshot_ref) { >> +if (!bdrv_lookup_bs(snapshot_ref, snapshot_ref, _err)) { >> error_propagate(errp, local_err); >> return; >> } >> } > > Shouldn't you also check

Re: [Qemu-block] [Qemu-devel] [PULL 00/16] Block patches

2015-09-07 Thread Peter Maydell
On 4 September 2015 at 21:10, Kevin Wolf wrote: > The following changes since commit b597aa037dbd98014c8dec3d69a5e2240f432533: > > Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2015-09-04' > into staging (2015-09-04 17:37:50 +0100) > > are available in the

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/6] replace qemu_fls() with pow2ceil()/pow2floor()

2015-09-07 Thread Paolo Bonzini
On 07/09/2015 13:04, Peter Maydell wrote: > Ping? > > Paolo, do you want to take these, should I just apply them > to master, or what? Sorry, I thought you were applying these or pulling them through your trees. Let me know if you still want me to take them. Paolo

Re: [Qemu-block] [PATCH v3 13/13] qemu-iotests: More qcow2 reopen tests

2015-09-07 Thread Max Reitz
On 07.09.2015 15:26, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > tests/qemu-iotests/137 | 145 > + > tests/qemu-iotests/137.out | 42 + > tests/qemu-iotests/group | 1 + > 3 files changed, 188

Re: [Qemu-block] [PATCH v3 11/13] qcow2: Support updating driver-specific options in reopen

2015-09-07 Thread Max Reitz
On 07.09.2015 15:26, Kevin Wolf wrote: > For updating the cache sizes or disabling lazy refcounts And updating the cache clean timer, too. > there is a bit > more to do than just changing the variables, but otherwise we're all set > for