[Qemu-devel] [PATCH 0/3] qmp: Add "blockdev-backup"

2014-09-10 Thread Fam Zheng
The existing drive-backup command accepts a target file path, but that interface provides little flexibility on the properties of target block device, compared to what is possible with "blockdev-add", "drive_add" or "-drive". This is also a building block to allow image fleecing (creating a point

[Qemu-devel] [PATCH 1/3] qmp: Add command 'blockdev-backup'

2014-09-10 Thread Fam Zheng
Similar to drive-backup, but this command uses a device id as target instead of creating/opening an image file. Also add blocker on target bs, since the target is also a named device now. Add check and report error for bs == target which became possible but is an illegal case with introduction of

[Qemu-devel] [PATCH 3/3] qemu-iotests: Test blockdev-backup in 055

2014-09-10 Thread Fam Zheng
This applies cases on drive-backup on blockdev-backup, except cases with target format and mode. Also add a case to check source == target. Signed-off-by: Fam Zheng --- tests/qemu-iotests/055 | 277 ++--- tests/qemu-iotests/055.out | 4 +- 2 files c

[Qemu-devel] [PATCH] kvm: ioapic: conditionally delay irq delivery during eoi broadcast

2014-09-10 Thread Zhang Haoyu
Currently, we call ioapic_service() immediately when we find the irq is still active during eoi broadcast. But for real hardware, there's some dealy between the EOI writing and irq delivery (system bus latency?). So we need to emulate this behavior. Otherwise, for a guest who haven't register a pro

[Qemu-devel] [PATCH] block: Split BLOCK_OP_TYPE_COMMIT to BLOCK_OP_TYPE_COMMIT_{SOURCE, TARGET}

2014-09-10 Thread Fam Zheng
Like BLOCK_OP_TYPE_BACKUP_SOURCE and BLOCK_OP_TYPE_BACKUP_TARGET, block-commit involves two asymmetric devices. This change is not user-visible (yet), because commit only works with device names. But once we enable backing reference in blockdev-add, or specifying node-name in block-commit command

[Qemu-devel] [PATCH v6 00/22] block: Asynchronous request cancellation

2014-09-10 Thread Fam Zheng
v6: Drop bdrv_em_aiocb_info.cancel in patch 5. (Paolo) v5: Fix IDE callback. (Paolo) Fix blkdebug. (Paolo) Drop the DMA fix which is independent of this series. (Paolo) Incorperate Yuan's patch on quorum_aio_cancel. (Benoît) Commit message wording fix. (Benoît) Rename qemu_aio_

[Qemu-devel] [PATCH v6 01/22] ide/ahci: Check for -ECANCELED in aio callbacks

2014-09-10 Thread Fam Zheng
Before, bdrv_aio_cancel will either complete the request (like normal) and call CB with an actual return code, or skip calling the request (for example when the IO req is not submitted by thread pool yet). We will change bdrv_aio_cancel to do it differently: always call CB before return, with eith

[Qemu-devel] [PATCH v6 02/22] block: Add refcnt in BlockDriverAIOCB

2014-09-10 Thread Fam Zheng
This will be useful in synchronous cancel emulation with bdrv_aio_cancel_async. Signed-off-by: Fam Zheng --- block.c | 12 +++- include/block/aio.h | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c index d06dd51..c1ee860 100644 --- a/bl

[Qemu-devel] [PATCH v6 10/22] archipelago: Drop archipelago_aiocb_info.cancel

2014-09-10 Thread Fam Zheng
The cancelled flag is no longer useful. Later the request will complete as before, and cb will be called. Signed-off-by: Fam Zheng --- block/archipelago.c | 17 + 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/block/archipelago.c b/block/archipelago.c index 22a7daa

[Qemu-devel] [PATCH v6 04/22] block: Drop bdrv_em_co_aiocb_info.cancel

2014-09-10 Thread Fam Zheng
Also drop the now unused ->done pointer. Signed-off-by: Fam Zheng --- block.c | 21 - 1 file changed, 21 deletions(-) diff --git a/block.c b/block.c index 371082b..6193883 100644 --- a/block.c +++ b/block.c @@ -4757,22 +4757,8 @@ typedef struct BlockDriverAIOCBCoroutine {

[Qemu-devel] [PATCH v6 05/22] block: Drop bdrv_em_aiocb_info.cancel

2014-09-10 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/block.c b/block.c index 6193883..349bb13 100644 --- a/block.c +++ b/block.c @@ -4675,18 +4675,8 @@ typedef struct BlockDriverAIOCBSync { int is_write; } BlockDriverAIOCBSync; -static void b

[Qemu-devel] [PATCH v6 03/22] block: Add bdrv_aio_cancel_async

2014-09-10 Thread Fam Zheng
This is the async version of bdrv_aio_cancel, which doesn't block the caller. It guarantees that the cb is called either before returning or some time later. bdrv_aio_cancel can base on bdrv_aio_cancel_async, later we can convert all .io_cancel implementations to .io_cancel_async, and the aio_poll

[Qemu-devel] [PATCH v6 11/22] blkdebug: Drop blkdebug_aiocb_info.cancel

2014-09-10 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/blkdebug.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index 69b330e..08131b3 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -52,11 +52,8 @@ typedef struct BlkdebugSuspendedReq

[Qemu-devel] [PATCH v6 06/22] thread-pool: Convert thread_pool_aiocb_info.cancel to cancel_async

2014-09-10 Thread Fam Zheng
The .cancel_async shares the same the first half with .cancel: try to steal the request if not submitted yet. In this case set the elem to THREAD_DONE status and ret to -ECANCELED, which means thread_pool_completion_bh will call the cb with -ECANCELED. If the request is already submitted, do nothi

[Qemu-devel] [PATCH v6 07/22] linux-aio: Convert laio_aiocb_info.cancel to .cancel_async

2014-09-10 Thread Fam Zheng
Just call io_cancel (2), if it fails, it means the request is not canceled, so the event loop will eventually call qemu_laio_process_completion. In qemu_laio_process_completion, change to call the cb unconditionally. It is required by bdrv_aio_cancel_async. Signed-off-by: Fam Zheng --- block/li

[Qemu-devel] [PATCH v6 13/22] curl: Drop curl_aiocb_info.cancel

2014-09-10 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/curl.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/block/curl.c b/block/curl.c index 938f9d9..6f5d6ae 100644 --- a/block/curl.c +++ b/block/curl.c @@ -613,14 +613,8 @@ out_noclean: return -EINVAL; } -static void curl_aio_cancel(BlockDriverAI

[Qemu-devel] [PATCH v6 12/22] blkverify: Drop blkverify_aiocb_info.cancel

2014-09-10 Thread Fam Zheng
Also the finished pointer is not used any more. Signed-off-by: Fam Zheng --- block/blkverify.c | 19 --- 1 file changed, 19 deletions(-) diff --git a/block/blkverify.c b/block/blkverify.c index 163064c..460393f 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -29,7 +29,

[Qemu-devel] [PATCH v6 08/22] dma: Convert dma_aiocb_info.cancel to .cancel_async

2014-09-10 Thread Fam Zheng
Just forward the request to bdrv_aio_cancel_async. Signed-off-by: Fam Zheng --- dma-helpers.c | 20 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/dma-helpers.c b/dma-helpers.c index 499b52b..5a46e5c 100644 --- a/dma-helpers.c +++ b/dma-helpers.c @@ -73,7 +73

[Qemu-devel] [PATCH v6 09/22] iscsi: Convert iscsi_aiocb_info.cancel to .cancel_async

2014-09-10 Thread Fam Zheng
Also drop the unused field "canceled". Signed-off-by: Fam Zheng --- block/iscsi.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/block/iscsi.c b/block/iscsi.c index 3e19202..a0aca5f 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -88,7 +88,6 @@ typedef s

[Qemu-devel] [PATCH v6 15/22] quorum: fix quorum_aio_cancel()

2014-09-10 Thread Fam Zheng
From: Liu Yuan For a fifo read pattern, we only have one running aio (possible other cases that has less number than num_children in the future), so we need to check if .acb is NULL against bdrv_aio_cancel() to avoid segfault. Cc: Eric Blake Cc: Benoit Canet Cc: Kevin Wolf Cc: Stefan Hajnoczi

[Qemu-devel] [PATCH v6 18/22] sheepdog: Convert sd_aiocb_info.cancel to .cancel_async

2014-09-10 Thread Fam Zheng
Also drop the now unused SheepdogAIOCB.finished field. Note that this aio is internal to sheepdog driver and has NULL cb and opaque, and should be unused at all. Signed-off-by: Fam Zheng --- block/sheepdog.c | 46 +++--- 1 file changed, 19 insertions(+), 2

[Qemu-devel] [PATCH v6 14/22] qed: Drop qed_aiocb_info.cancel

2014-09-10 Thread Fam Zheng
Also drop the now unused ->finished field. Signed-off-by: Fam Zheng --- block/qed.c | 21 - 1 file changed, 21 deletions(-) diff --git a/block/qed.c b/block/qed.c index ba395af..07cdb47 100644 --- a/block/qed.c +++ b/block/qed.c @@ -18,22 +18,8 @@ #include "qapi/qmp/qerror.

[Qemu-devel] [PATCH v6 16/22] quorum: Convert quorum_aiocb_info.cancel to .cancel_async

2014-09-10 Thread Fam Zheng
Before, we cancel all the child requests with bdrv_aio_cancel, then free the acb.. Now we just kick off asynchronous cancellation of child requests and return, we know quorum_aio_cb will be called later, so in the end quorum_aio_finalize will take care of calling the caller's cb. Signed-off-by: F

[Qemu-devel] [PATCH v6 20/22] ide: Convert trim_aiocb_info.cancel to .cancel_async

2014-09-10 Thread Fam Zheng
We know that either bh is scheduled or ide_issue_trim_cb will be called again, so we just set i, j and ret to the right values. In both cases, ide_trim_bh_cb will be called. Also forward the cancellation to the iocb->aiocb which we get from bdrv_aio_discard. Signed-off-by: Fam Zheng --- hw/ide/

[Qemu-devel] [PATCH v6 17/22] rbd: Drop rbd_aiocb_info.cancel

2014-09-10 Thread Fam Zheng
And also drop the now unused "cancelled" field. Signed-off-by: Fam Zheng --- block/rbd.c | 23 +-- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/block/rbd.c b/block/rbd.c index ea969e7..349d465 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -77,7 +77,6 @@ typed

[Qemu-devel] [PATCH v6 21/22] block: Drop AIOCBInfo.cancel

2014-09-10 Thread Fam Zheng
Now that all the implementations are converted to asynchronous version and we can emulate synchronous cancellation with it. Let's drop the unused member. Signed-off-by: Fam Zheng --- block.c | 24 ++-- include/block/aio.h | 1 - 2 files changed, 10 insertions(+),

[Qemu-devel] [PATCH v6 22/22] block: Rename qemu_aio_release -> qemu_aio_unref

2014-09-10 Thread Fam Zheng
Suggested-by: Benoît Canet Signed-off-by: Fam Zheng --- block.c | 8 block/archipelago.c | 4 ++-- block/blkdebug.c| 2 +- block/blkverify.c | 2 +- block/curl.c| 10 +- block/iscsi.c | 6 +++--- block/linux-aio.c | 4 ++-- block/qed.c

[Qemu-devel] [PATCH v6 19/22] win32-aio: Drop win32_aiocb_info.cancel

2014-09-10 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/win32-aio.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/block/win32-aio.c b/block/win32-aio.c index 5030e32..eed86f7 100644 --- a/block/win32-aio.c +++ b/block/win32-aio.c @@ -106,22 +106,8 @@ static void win32_aio_completion_cb(EventNotif

Re: [Qemu-devel] [PATCH v6 3/3] qapi: Sort items in BlockdevOptions definition

2014-09-10 Thread Fam Zheng
On Wed, 09/10 15:32, Benoît Canet wrote: > The Wednesday 10 Sep 2014 à 11:08:48 (+0800), Fam Zheng wrote : > > Signed-off-by: Fam Zheng > > --- > > qapi/block-core.json | 38 +++--- > > 1 file changed, 19 insertions(+), 19 deletions(-) > > > > diff --git a/qapi/bl

Re: [Qemu-devel] [PATCH v6 1/3] block: Introduce "null" drivers

2014-09-10 Thread Fam Zheng
On Wed, 09/10 15:27, Benoît Canet wrote: > The Wednesday 10 Sep 2014 à 11:08:46 (+0800), Fam Zheng wrote : > > This is an analogue to Linux null_blk. It can be used for testing or > > benchmarking block device emulation and general block layer > > functionalities such as coroutines and throttling,

Re: [Qemu-devel] [PATCH v8 00/30] modify boot order of guest, and take effect after rebooting

2014-09-10 Thread Gonglei (Arei)
> > 主题: [Qemu-devel] [PATCH v8 00/30] modify boot order of guest, and take > > effect after rebooting > > > > From: Gonglei > > > > Sometimes, we want to modify boot order of a guest, but no need to > shutdown > > it. We can call dynamic changing bootindex of a guest, which can be assured > > taki

Re: [Qemu-devel] [PATCH] kvm: ioapic: conditionally delay irq delivery during eoi broadcast

2014-09-10 Thread Jan Kiszka
On 2014-09-11 07:06, Zhang Haoyu wrote: > Currently, we call ioapic_service() immediately when we find the irq is still > active during eoi broadcast. But for real hardware, there's some dealy between > the EOI writing and irq delivery (system bus latency?). So we need to emulate > this behavior. O

[Qemu-devel] [PATCH v7 2/3] qapi: Sort BlockdevDriver enum data list

2014-09-10 Thread Fam Zheng
Reviewed-by: Benoît Canet Signed-off-by: Fam Zheng --- qapi/block-core.json | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index bf0cb23..35191b4 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1147,11 +

[Qemu-devel] [PATCH v7 1/3] block: Introduce "null" drivers

2014-09-10 Thread Fam Zheng
This is an analogue to Linux null_blk. It can be used for testing or benchmarking block device emulation and general block layer functionalities such as coroutines and throttling, where disk IO is not necessary or wanted. Use null-aio:// for AIO version, and null-co:// for coroutine version. Sign

[Qemu-devel] [PATCH v7 0/3] block: Introduce "null" drivers

2014-09-10 Thread Fam Zheng
v7: Add Benoît's rev-by line in patch 2. Improved help text in patch 1. (Benoît) v6: Don't inherit from BlockdevOptionsFile. (Stefan) Use .bdrv_co_readv instead of .bdrv_read. (Kevin) Sort items in qapi schema definitions in patch 2 & 3. Fam Zheng (3): block: Introduce "null" drive

Re: [Qemu-devel] [question] virtio-blk performance degradationhappenedwith virito-serial

2014-09-10 Thread Amit Shah
On (Sun) 07 Sep 2014 [17:46:26], Zhang Haoyu wrote: > Hi, Paolo, Amit, > any ideas? I'll check this, thanks for testing with Linux guests. Amit

[Qemu-devel] [PATCH v7 3/3] qapi: Sort items in BlockdevOptions definition

2014-09-10 Thread Fam Zheng
Signed-off-by: Fam Zheng --- qapi/block-core.json | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 35191b4..5adef27 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1483,4

Re: [Qemu-devel] ballooning not working on hotplugged pc-dimm

2014-09-10 Thread Paolo Bonzini
Il 11/09/2014 03:57, Michael R. Hines ha scritto: >> > > Why does hotplugging use a different name? > > This also affects RDMA live migration - we are explicitly looking up > "pc.ram" ram blocks and pinning them for memory registration with Linux. Are we? I cannot see any code that special case

Re: [Qemu-devel] ballooning not working on hotplugged pc-dimm

2014-09-10 Thread Michael R. Hines
On 09/11/2014 02:22 PM, Paolo Bonzini wrote: Il 11/09/2014 03:57, Michael R. Hines ha scritto: Why does hotplugging use a different name? This also affects RDMA live migration - we are explicitly looking up "pc.ram" ram blocks and pinning them for memory registration with Linux. Are we? I can

Re: [Qemu-devel] ballooning not working on hotplugged pc-dimm

2014-09-10 Thread zhanghailiang
On 2014/9/11 14:27, Michael R. Hines wrote: On 09/11/2014 02:22 PM, Paolo Bonzini wrote: Il 11/09/2014 03:57, Michael R. Hines ha scritto: Why does hotplugging use a different name? This also affects RDMA live migration - we are explicitly looking up "pc.ram" ram blocks and pinning them for me

Re: [Qemu-devel] [PATCH 01/23] block: Split bdrv_new_named() off bdrv_new()

2014-09-10 Thread Fam Zheng
On Wed, 09/10 10:13, Markus Armbruster wrote: > Creating an anonymous BDS can't fail. Make that obvious. > > Signed-off-by: Markus Armbruster > --- > block.c | 26 +++--- > block/iscsi.c | 2 +- > block/vvfat.c | 2 +- > blockdev.c

<    1   2   3   4