[Qemu-block] [PATCH COLO-BLOCK v7 17/17] Implement new driver for block replication

2015-06-29 Thread Wen Congyang
Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei --- block/Makefile.objs | 1 + block/replication.c | 443 2 files changed, 444 insertions(+) create mode 100644 block/replication.c diff --git a/block/Makefil

[Qemu-block] [PATCH COLO-BLOCK v7 15/17] skip nbd_target when starting block replication

2015-06-29 Thread Wen Congyang
Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei --- block.c | 12 1 file changed, 12 insertions(+) diff --git a/block.c b/block.c index 1cfbbf9..7371c5a 100644 --- a/block.c +++ b/block.c @@ -4347,6 +4347,10 @@ void bdrv_start_replication(BlockDrive

[Qemu-block] [PATCH COLO-BLOCK v7 16/17] quorum: implement block driver interfaces for block replication

2015-06-29 Thread Wen Congyang
Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei Cc: Alberto Garcia --- block/quorum.c | 78 ++ 1 file changed, 78 insertions(+) diff --git a/block/quorum.c b/block/quorum.c index 6774d4c..bafa774 100644 --

[Qemu-block] [PATCH COLO-BLOCK v7 02/17] quorum: implement block driver interfaces add/delete a BDS's child

2015-06-29 Thread Wen Congyang
Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei Cc: Alberto Garcia --- block/quorum.c | 72 -- 1 file changed, 70 insertions(+), 2 deletions(-) diff --git a/block/quorum.c b/block/quorum.c index a7df17c..4

[Qemu-block] [PATCH COLO-BLOCK v7 13/17] docs: block replication's description

2015-06-29 Thread Wen Congyang
Signed-off-by: Wen Congyang Signed-off-by: Yang Hongyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei --- docs/block-replication.txt | 179 + 1 file changed, 179 insertions(+) create mode 100644 docs/block-replication.txt diff --git a/docs/b

[Qemu-block] [PATCH COLO-BLOCK v7 14/17] Add new block driver interfaces to control block replication

2015-06-29 Thread Wen Congyang
Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei Cc: Luiz Capitulino Cc: Michael Roth Reviewed-by: Paolo Bonzini --- block.c | 40 include/block/block.h | 5 + include/block/block_int.h | 14 ++

[Qemu-block] [PATCH COLO-BLOCK v7 12/17] block: Allow references for backing files

2015-06-29 Thread Wen Congyang
Usage: -drive file=xxx,id=Y, \ -drive file=,id=X,backing.backing_reference=Y It will create such backing chain: {virtio-blk dev 'Y'} {virtio-blk dev 'X'} | | | |

[Qemu-block] [PATCH COLO-BLOCK v7 09/17] Backup: clear all bitmap when doing block checkpoint

2015-06-29 Thread Wen Congyang
Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei Cc: Jeff Cody --- block/backup.c | 13 + blockjob.c | 10 ++ include/block/blockjob.h | 12 3 files changed, 35 insertions(+) diff --git a/block/backup.c b/

[Qemu-block] [PATCH COLO-BLOCK v7 11/17] Allow creating backup jobs when opening BDS

2015-06-29 Thread Wen Congyang
When opening BDS, we need to create backup jobs for image-fleecing. Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei Cc: Jeff Cody Reviewed-by: Stefan Hajnoczi --- block/Makefile.objs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/Mak

[Qemu-block] [PATCH COLO-BLOCK v7 10/17] allow writing to the backing file

2015-06-29 Thread Wen Congyang
Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei --- block.c | 41 - 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c index 7619981..12efd21 100644 --- a/block.c +++ b/block.c @@ -747,6 +747,15

[Qemu-block] [PATCH COLO-BLOCK v7 08/17] block: make bdrv_put_ref_bh_schedule() as a public API

2015-06-29 Thread Wen Congyang
Signed-off-by: Wen Congyang --- block.c | 25 + blockdev.c| 37 ++--- include/block/block.h | 1 + 3 files changed, 32 insertions(+), 31 deletions(-) diff --git a/block.c b/block.c index dbbba5d..7619981 100644 --

[Qemu-block] [PATCH COLO-BLOCK v7 06/17] introduce a new API to enable/disable attach device model

2015-06-29 Thread Wen Congyang
Signed-off-by: Wen Congyang --- block/block-backend.c | 24 include/sysemu/block-backend.h | 2 ++ 2 files changed, 26 insertions(+) diff --git a/block/block-backend.c b/block/block-backend.c index aee8a12..72d8b2c 100644 --- a/block/block-backend.c +++ b/block

[Qemu-block] [PATCH COLO-BLOCK v7 05/17] quorum: allow ignoring child errors

2015-06-29 Thread Wen Congyang
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: Just not report the error event. 2. getlength: just ignore it. If all children's getlength return -errno, and be ignored, return -EIO. 3. flush: Just ig

[Qemu-block] [PATCH COLO-BLOCK v7 07/17] introduce a new API to check if blk is attached

2015-06-29 Thread Wen Congyang
Signed-off-by: Wen Congyang --- block.c| 4 ++-- block/block-backend.c | 9 + include/sysemu/block-backend.h | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/block.c b/block.c index 617e431..dbbba5d 100644 --- a/block.c +++ b/block.c

[Qemu-block] [PATCH COLO-BLOCK v7 03/17] hmp: add monitor command to add/remove a child

2015-06-29 Thread Wen Congyang
Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei --- blockdev.c| 53 +++ hmp-commands.hx | 28 + include/sysemu/blockdev.h | 2 ++ 3 files changed, 83 insertions(+) dif

[Qemu-block] [PATCH COLO-BLOCK v7 04/17] introduce a new API qemu_opts_absorb_qdict_by_index()

2015-06-29 Thread Wen Congyang
Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei --- include/qemu/option.h | 2 ++ util/qemu-option.c| 44 2 files changed, 46 insertions(+) diff --git a/include/qemu/option.h b/include/qemu/option.h index 57e51c9

[Qemu-block] [PATCH COLO-BLOCK v7 01/17] Add new block driver interface to add/delete a BDS's child

2015-06-29 Thread Wen Congyang
In some cases, we want to take a quorum child offline, and take another child online. Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei --- block.c | 39 +++ include/block/block.h | 4 include/block/b

[Qemu-block] [PATCH COLO-BLOCK v7 00/17] Block replication for continuous checkpoints

2015-06-29 Thread Wen Congyang
Block replication is a very important feature which is used for continuous checkpoints(for example: COLO). Usage: Please refer to docs/block-replication.txt You can get the patch here: https://github.com/wencongyang/qemu-colo/commits/block-replication-v7 You can get ths patch with framework here

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/4] ahci: misc fixes/tests for 2.4

2015-06-29 Thread John Snow
final ping: I'll pull this as a pre-requisite for the NCQ fixes (part 1) series that has been reviewed unless there are objections to this series. --js On 06/16/2015 12:02 PM, John Snow wrote: > This is a small handful of fixes for the ahci-tests/ahci device, > alongside two new tests. I have a

Re: [Qemu-block] [Qemu-devel] [PATCH] raw-posix.c: cd_is_inserted() implementation for Mac OS X

2015-06-29 Thread Programmingkid
On Jun 29, 2015, at 4:43 PM, Laurent Vivier wrote: > > > On 29/06/2015 20:37, Programmingkid wrote: >> >> On Jun 29, 2015, at 2:16 PM, Peter Maydell wrote: >> >>> On 29 June 2015 at 19:04, Programmingkid >> > wrote: On Jun 29, 2015, at 1:11 PM, Pet

Re: [Qemu-block] [Qemu-devel] [PATCH] raw-posix.c: cd_is_inserted() implementation for Mac OS X

2015-06-29 Thread Laurent Vivier
On 29/06/2015 20:37, Programmingkid wrote: > > On Jun 29, 2015, at 2:16 PM, Peter Maydell wrote: > >> On 29 June 2015 at 19:04, Programmingkid > > wrote: >>> >>> On Jun 29, 2015, at 1:11 PM, Peter Maydell wrote: >>> On 29 June 2015 at 17:54, Programmingkid

Re: [Qemu-block] [RFC] ide: fix bmdma underflow code

2015-06-29 Thread John Snow
On 06/29/2015 04:16 PM, John Snow wrote: > This RFC requires my ahci-ncq-s2 patchset and all of its dependencies. > > Fix the BMDMA underflow code to acknowledge the new 'limit' parameter, > without breaking or modifying the existing ide-tests. > > This approach uses s->io_buffer_size as a retu

[Qemu-block] [RFC] ide: fix bmdma underflow code

2015-06-29 Thread John Snow
This RFC requires my ahci-ncq-s2 patchset and all of its dependencies. Fix the BMDMA underflow code to acknowledge the new 'limit' parameter, without breaking or modifying the existing ide-tests. This approach uses s->io_buffer_size as a return value to mean the number of bytes witnessed in the P

Re: [Qemu-block] [Qemu-devel] [PATCH 01/16] ide: add limit to .prepare_buf()

2015-06-29 Thread John Snow
On 06/29/2015 09:34 AM, Stefan Hajnoczi wrote: > On Fri, Jun 26, 2015 at 02:16:57PM -0400, John Snow wrote: >> On 06/26/2015 10:32 AM, Stefan Hajnoczi wrote: >>> On Mon, Jun 22, 2015 at 08:21:00PM -0400, John Snow wrote: diff --git a/hw/ide/pci.c b/hw/ide/pci.c index 4afd0cf..a295baa 10

Re: [Qemu-block] [Qemu-devel] [PATCH] raw-posix.c: cd_is_inserted() implementation for Mac OS X

2015-06-29 Thread Programmingkid
On Jun 29, 2015, at 2:16 PM, Peter Maydell wrote: > On 29 June 2015 at 19:04, Programmingkid wrote: >> >> On Jun 29, 2015, at 1:11 PM, Peter Maydell wrote: >> >>> On 29 June 2015 at 17:54, Programmingkid wrote: @@ -2365,6 +2384,10 @@ static BlockDriver bdrv_host_device = { .bdrv_

Re: [Qemu-block] [Qemu-devel] [PATCH] raw-posix.c: cd_is_inserted() implementation for Mac OS X

2015-06-29 Thread Peter Maydell
On 29 June 2015 at 19:04, Programmingkid wrote: > > On Jun 29, 2015, at 1:11 PM, Peter Maydell wrote: > >> On 29 June 2015 at 17:54, Programmingkid wrote: >>> @@ -2365,6 +2384,10 @@ static BlockDriver bdrv_host_device = { >>> .bdrv_ioctl = hdev_ioctl, >>> .bdrv_aio_ioctl = hde

Re: [Qemu-block] [Qemu-devel] [PATCH] raw-posix.c: cd_is_inserted() implementation for Mac OS X

2015-06-29 Thread Programmingkid
On Jun 29, 2015, at 1:11 PM, Peter Maydell wrote: > On 29 June 2015 at 17:54, Programmingkid wrote: >> @@ -2365,6 +2384,10 @@ static BlockDriver bdrv_host_device = { >> .bdrv_ioctl = hdev_ioctl, >> .bdrv_aio_ioctl = hdev_aio_ioctl, >> #endif >> + >> +#ifdef __APPLE__ >> +

Re: [Qemu-block] [Qemu-devel] [PATCH] raw-posix.c: cd_is_inserted() implementation for Mac OS X

2015-06-29 Thread Peter Maydell
On 29 June 2015 at 17:54, Programmingkid wrote: > @@ -2365,6 +2384,10 @@ static BlockDriver bdrv_host_device = { > .bdrv_ioctl = hdev_ioctl, > .bdrv_aio_ioctl = hdev_aio_ioctl, > #endif > + > +#ifdef __APPLE__ > +.bdrv_is_inserted = cdrom_is_inserted, > +#endif Why is

[Qemu-block] [PATCH] raw-posix.c: cd_is_inserted() implementation for Mac OS X

2015-06-29 Thread Programmingkid
Fix a problem with QEMU not being able to use real cd's on Mac OS X hosts. Implements a function called cd_is_inserted(). Signed-off-by: John Arbuckle --- block/raw-posix.c | 25 - 1 files changed, 24 insertions(+), 1 deletions(-) diff --git a/block/raw-posix.c b/bloc

Re: [Qemu-block] [PATCH V2] block/nfs: add support for setting debug level

2015-06-29 Thread Stefan Hajnoczi
On Fri, Jun 26, 2015 at 01:06:09PM +0200, Peter Lieven wrote: > upcoming libnfs versions will support logging debug messages. Add > support for it in qemu through a cmdline parameter. > > Example > qemu -nfs debug=99 -cdrom nfs://... > > Signed-off-by: Peter Lieven > --- > v1->v2: reworked patc

Re: [Qemu-block] [PATCH] block/nfs: limit maximum readahead size to 1MB

2015-06-29 Thread Stefan Hajnoczi
On Fri, Jun 26, 2015 at 01:14:01PM +0200, Peter Lieven wrote: > a malicious caller could otherwise specify a very > large value via the URI and force libnfs to allocate > a large amount of memory for the readahead buffer. > > Cc: qemu-sta...@nongnu.org > Signed-off-by: Peter Lieven > --- > block

Re: [Qemu-block] [Qemu-devel] [PATCH V2] block/iscsi: restore compatiblity with libiscsi 1.9.0

2015-06-29 Thread Stefan Hajnoczi
On Fri, Jun 26, 2015 at 12:18:01PM +0200, Peter Lieven wrote: > RHEL7 and others are stuck with libiscsi 1.9.0 since there > unfortunately was an ABI breakage after that release. > > Signed-off-by: Peter Lieven > --- > v1->v2: - do not use reserved macro names [Paolo] > - change text in q

Re: [Qemu-block] [PATCH] block/curl: Don't lose original error when a connection fails.

2015-06-29 Thread Stefan Hajnoczi
On Thu, Jun 25, 2015 at 08:39:56PM +0100, Richard W.M. Jones wrote: > Currently if qemu is connected to a curl source (eg. web server), and > the web server fails / times out / dies, you always see a bogus EIO > "Input/output error". > > For example, choose a large file located on any local webser

Re: [Qemu-block] [Qemu-devel] [PATCH 06/16] ahci: record ncq failures

2015-06-29 Thread John Snow
On 06/29/2015 11:42 AM, John Snow wrote: > > > On 06/29/2015 10:24 AM, Stefan Hajnoczi wrote: >> On Fri, Jun 26, 2015 at 02:27:39PM -0400, John Snow wrote: >>> -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 >>> >>> >>> >>> On 06/26/2015 11:35 AM, Stefan Hajnoczi wrote: On Mon, Jun 22, 201

Re: [Qemu-block] [Qemu-devel] [PATCH 06/16] ahci: record ncq failures

2015-06-29 Thread John Snow
On 06/29/2015 10:24 AM, Stefan Hajnoczi wrote: > On Fri, Jun 26, 2015 at 02:27:39PM -0400, John Snow wrote: >> -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 >> >> >> >> On 06/26/2015 11:35 AM, Stefan Hajnoczi wrote: >>> On Mon, Jun 22, 2015 at 08:21:05PM -0400, John Snow wrote: Handle N

Re: [Qemu-block] [Qemu-devel] [PATCH 14/16] ahci: Do not map cmd_fis to generate response

2015-06-29 Thread John Snow
On 06/29/2015 10:51 AM, Stefan Hajnoczi wrote: > On Fri, Jun 26, 2015 at 01:31:12PM -0400, John Snow wrote: >> On 06/26/2015 11:59 AM, Stefan Hajnoczi wrote: >>> On Mon, Jun 22, 2015 at 08:21:13PM -0400, John Snow wrote: @@ -744,8 +722,8 @@ static void ahci_write_fis_pio(AHCIDevice *ad,

Re: [Qemu-block] [Qemu-devel] [PATCH 16/16] ahci: fix sdb fis semantics

2015-06-29 Thread Stefan Hajnoczi
On Fri, Jun 26, 2015 at 01:36:23PM -0400, John Snow wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > > > On 06/26/2015 12:11 PM, Stefan Hajnoczi wrote: > > On Mon, Jun 22, 2015 at 08:21:15PM -0400, John Snow wrote: > >> @@ -682,19 +680,22 @@ static void ahci_write_fis_sdb(AHCIState

Re: [Qemu-block] [Qemu-devel] [PATCH 14/16] ahci: Do not map cmd_fis to generate response

2015-06-29 Thread Stefan Hajnoczi
On Fri, Jun 26, 2015 at 01:31:12PM -0400, John Snow wrote: > On 06/26/2015 11:59 AM, Stefan Hajnoczi wrote: > > On Mon, Jun 22, 2015 at 08:21:13PM -0400, John Snow wrote: > >> @@ -744,8 +722,8 @@ static void ahci_write_fis_pio(AHCIDevice > >> *ad, uint16_t len) pio_fis[9] = s->hob_lcyl; pio_fis[10]

Re: [Qemu-block] [PATCH 12/16] ahci: ncq migration

2015-06-29 Thread Stefan Hajnoczi
On Fri, Jun 26, 2015 at 12:46:07PM -0400, John Snow wrote: > On 06/26/2015 11:48 AM, Stefan Hajnoczi wrote: > > On Mon, Jun 22, 2015 at 08:21:11PM -0400, John Snow wrote: > >> @@ -1555,6 +1573,35 @@ static int ahci_state_post_load(void > >> *opaque, int version_id) return -1; } > >> > >> +

Re: [Qemu-block] [Qemu-devel] [PATCH 06/16] ahci: record ncq failures

2015-06-29 Thread Stefan Hajnoczi
On Fri, Jun 26, 2015 at 02:27:39PM -0400, John Snow wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > > > On 06/26/2015 11:35 AM, Stefan Hajnoczi wrote: > > On Mon, Jun 22, 2015 at 08:21:05PM -0400, John Snow wrote: > >> Handle NCQ failures for cases where we want to halt the VM on

Re: [Qemu-block] [Qemu-devel] [PATCH 06/16] ahci: record ncq failures

2015-06-29 Thread Stefan Hajnoczi
On Fri, Jun 26, 2015 at 02:27:39PM -0400, John Snow wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > > > On 06/26/2015 11:35 AM, Stefan Hajnoczi wrote: > > On Mon, Jun 22, 2015 at 08:21:05PM -0400, John Snow wrote: > >> Handle NCQ failures for cases where we want to halt the VM on

Re: [Qemu-block] [Qemu-devel] [PATCH 01/16] ide: add limit to .prepare_buf()

2015-06-29 Thread Stefan Hajnoczi
On Fri, Jun 26, 2015 at 02:16:57PM -0400, John Snow wrote: > On 06/26/2015 10:32 AM, Stefan Hajnoczi wrote: > > On Mon, Jun 22, 2015 at 08:21:00PM -0400, John Snow wrote: > >> diff --git a/hw/ide/pci.c b/hw/ide/pci.c index 4afd0cf..a295baa > >> 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -55,8

Re: [Qemu-block] [PATCH] block: remove redundant check before g_slist_find()

2015-06-29 Thread Alexander Yarygin
Alberto Garcia writes: > An empty GSList is represented by a NULL pointer, therefore it's a > perfectly valid argument for g_slist_find() and there's no need to > make any additional check. > > Signed-off-by: Alberto Garcia > --- > block/io.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion

[Qemu-block] [PATCH] block: remove redundant check before g_slist_find()

2015-06-29 Thread Alberto Garcia
An empty GSList is represented by a NULL pointer, therefore it's a perfectly valid argument for g_slist_find() and there's no need to make any additional check. Signed-off-by: Alberto Garcia --- block/io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/io.c b/block/io.

Re: [Qemu-block] [Qemu-devel] [PATCH] block.c: fix real cdrom detection

2015-06-29 Thread Laurent Vivier
On 29/06/2015 05:01, Programmingkid wrote: > > On Jun 28, 2015, at 8:29 PM, Laurent Vivier wrote: > >> Hi, >> >> On 29/06/2015 01:43, Programmingkid wrote: >>> >>> On Jun 25, 2015, at 2:01 PM, Peter Maydell wrote: >>> On 25 June 2015 at 18:56, Programmingkid mailto:programmingk...@gma

Re: [Qemu-block] [Qemu-devel] [PATCH] block/mirror: Sleep periodically during bitmap scanning

2015-06-29 Thread Alexandre DERUMIER
Hi, I'm currently testing this patch, and it still hanging for me (mirroring a raw file from nfs) I just wonder why block_job_sleep_ns is set to 0 ? +block_job_sleep_ns(&s->common, QEMU_CLOCK_REALTIME, 0); I have tried to increasing it to a bigger value +block