[Qemu-block] [PATCH v6 05/13] virtio-blk: Don't handle output when there is "device IO" op blocker

2015-05-20 Thread Fam Zheng
virtio-blk now listens to op blocker change of the associated block backend. Up on setting op blocker on BLOCK_OP_TYPE_DEVICE_IO: non-dataplane: 1) Set VirtIOBlock.paused 2) In virtio_blk_handle_output, do nothing if VirtIOBlock.paused dataplane: 1) Clear the host event notifier

[Qemu-block] [PATCH v6 10/13] blockdev: Block device IO during drive-backup transaction

2015-05-20 Thread Fam Zheng
Signed-off-by: Fam Zheng --- blockdev.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index 923fc90..ae52d27 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1575,6 +1575,7 @@ typedef struct DriveBackupState { BlockDriverState *bs; AioCo

[Qemu-block] [PATCH v6 13/13] block/mirror: Block "device IO" during mirror exit

2015-05-20 Thread Fam Zheng
When mirror should complete, the source and target are in sync. But we call bdrv_swap() only a while later in the main loop bh. If the guest writes something before that, target will not get the new data. Block "device IO" before bdrv_drain and unblock it after bdrw_swap(). Reported-by: Wen Cong

[Qemu-block] [PATCH v6 12/13] block: Block "device IO" during bdrv_drain and bdrv_drain_all

2015-05-20 Thread Fam Zheng
We don't want new requests from guest, so block the operation around the nested poll. It also avoids looping forever when iothread is submitting a lot of requests. Signed-off-by: Fam Zheng --- block/io.c | 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a

[Qemu-block] [PATCH v6 11/13] blockdev: Block device IO during blockdev-backup transaction

2015-05-20 Thread Fam Zheng
Signed-off-by: Fam Zheng --- blockdev.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index ae52d27..bd28183 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1649,6 +1649,7 @@ typedef struct BlockdevBackupState { BlockDriverState *bs;

[Qemu-block] [PATCH v6 07/13] nbd-server: Clear "can_read" when "device io" blocker is set

2015-05-20 Thread Fam Zheng
So that NBD export cannot submit IO during bdrv_drain_all(). Signed-off-by: Fam Zheng --- nbd.c | 24 1 file changed, 24 insertions(+) diff --git a/nbd.c b/nbd.c index 06b501b..b5026af 100644 --- a/nbd.c +++ b/nbd.c @@ -160,6 +160,8 @@ struct NBDExport { uint32_t n

[Qemu-block] [PATCH v6 02/13] block: Add op blocker notifier list

2015-05-20 Thread Fam Zheng
BDS users can register a notifier and get notified about op blocker changes. Signed-off-by: Fam Zheng Reviewed-by: Max Reitz --- block.c | 35 +++ include/block/block.h | 8 include/block/block_int.h | 3 +++ 3 files changed, 46 i

[Qemu-block] [PATCH v6 09/13] blockdev: Block device IO during external snapshot transaction

2015-05-20 Thread Fam Zheng
Signed-off-by: Fam Zheng --- blockdev.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 7f763d9..923fc90 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1404,6 +1404,7 @@ typedef struct ExternalSnapshotState { BlockDriverStat

[Qemu-block] [PATCH v6 08/13] blockdev: Block device IO during internal snapshot transaction

2015-05-20 Thread Fam Zheng
Signed-off-by: Fam Zheng --- blockdev.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/blockdev.c b/blockdev.c index 5eaf77e..7f763d9 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1262,6 +1262,7 @@ typedef struct InternalSnapshotState { BlockDriverState *bs;

[Qemu-block] [PATCH v6 04/13] virtio-blk: Move complete_request to 'ops' structure

2015-05-20 Thread Fam Zheng
Should more ops be added to differentiate code between dataplane and non-dataplane, the new saved_ops approach will be cleaner than messing with N pointers. Signed-off-by: Fam Zheng Reviewed-by: Max Reitz --- hw/block/dataplane/virtio-blk.c | 13 - hw/block/virtio-blk.c |

[Qemu-block] [PATCH v6 06/13] virtio-scsi-dataplane: Add "device IO" op blocker listener

2015-05-20 Thread Fam Zheng
When a disk is attached to scsi-bus, virtio_scsi_hotplug will take care of protecting the block device with op blockers. Currently we haven't enabled block jobs (like what's done in virtio_blk_data_plane_create), but it is necessary to honor "device IO" op blocker first before we do. This is useful

[Qemu-block] [PATCH v6 03/13] block-backend: Add blk_op_blocker_add_notifier

2015-05-20 Thread Fam Zheng
Forward the call to bdrv_op_blocker_add_notifier. Signed-off-by: Fam Zheng Reviewed-by: Max Reitz --- block/block-backend.c | 6 ++ include/sysemu/block-backend.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/block/block-backend.c b/block/block-backend.c index 93e46f3..16e

[Qemu-block] [PATCH v6 01/13] block: Add op blocker type "device IO"

2015-05-20 Thread Fam Zheng
It blocks device IO. All bdrv_op_block_all/blk_op_block_all callers are taken care of: - virtio_blk_data_plane_create - virtio_scsi_hotplug Device creation, unblock it. - bdrv_set_backing_hd Backing hd is not used by device, so blocking is OK. - backup_start Blocking target when backup

[Qemu-block] [PATCH v6 00/13] Fix transactional snapshot with dataplane and NBD export

2015-05-20 Thread Fam Zheng
v6: Patch 13: unset block after bdrv_swap(). Reported by Paolo. Unlike the iohandler in main loop, iothreads currently process the event notifier used by virtio-blk ioeventfd in nested aio_poll. This is dangerous without proper protection, because guest requests could sneak to block layer where t

Re: [Qemu-block] [PATCH COLO-Block v5 00/15] Block replication for continuous checkpoints

2015-05-20 Thread Wen Congyang
On 05/21/2015 12:52 PM, Wen Congyang wrote: > 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/blo

Re: [Qemu-block] [Qemu-devel] [PATCH 11/34] block: Allow references for backing files

2015-05-20 Thread Wen Congyang
On 05/09/2015 01:21 AM, Kevin Wolf wrote: > For bs->file, using references to existing BDSes has been possible for a > while already. This patch enables the same for bs->backing_hd. 1. We reference to an existing BDSes, and some disk uses this blk. Do we allow this? 2. bs->backing_hd->blk can be n

[Qemu-block] [PATCH COLO-Block v5 05/15] Backup: clear all bitmap when doing block checkpoint

2015-05-20 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 v5 14/15] quorum: allow ignoring child errors

2015-05-20 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 v5 12/15] skip nbd_target when starting block replication

2015-05-20 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 74fd3d6..961e395 100644 --- a/block.c +++ b/block.c @@ -4221,6 +4221,10 @@ void bdrv_start_replication(BlockDrive

[Qemu-block] [PATCH COLO-Block v5 08/15] NBD client: implement block driver interfaces to connect/disconnect NBD server

2015-05-20 Thread Wen Congyang
Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei --- block/nbd.c | 67 - 1 file changed, 49 insertions(+), 18 deletions(-) diff --git a/block/nbd.c b/block/nbd.c index 2176186..bc9477a 100644 --- a/block

[Qemu-block] [PATCH COLO-Block v5 15/15] Implement new driver for block replication

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

[Qemu-block] [PATCH COLO-Block v5 09/15] Introduce a new -drive option to control whether to connect to remote target

2015-05-20 Thread Wen Congyang
Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei --- blockdev.c| 8 include/block/block.h | 1 + qemu-options.hx | 4 3 files changed, 13 insertions(+) diff --git a/blockdev.c b/blockdev.c index 95a0c6a..0c457ee 100644 --- a/blockd

[Qemu-block] [PATCH COLO-Block v5 13/15] quorum: implement block driver interfaces for block replication

2015-05-20 Thread Wen Congyang
Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei --- block/quorum.c | 78 ++ 1 file changed, 78 insertions(+) diff --git a/block/quorum.c b/block/quorum.c index f91ef75..3eb8fd3 100644 --- a/block/quorum.c +

[Qemu-block] [PATCH COLO-Block v5 11/15] Add new block driver interfaces to control block replication

2015-05-20 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 v5 04/15] block: Parse "backing_reference" option to reference existing BDS

2015-05-20 Thread Wen Congyang
Usage: -drive file=xxx,id=Y, \ -drive file=,id=X,backing_reference.drive_id=Y,backing_reference.hidden-disk.* It will create such backing chain: {virtio-blk dev 'Y'} {virtio-blk dev 'X'} |

[Qemu-block] [PATCH COLO-Block v5 01/15] docs: block replication's description

2015-05-20 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 v5 03/15] Allow creating backup jobs when opening BDS

2015-05-20 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 --- block/Makefile.objs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/Makefile.objs b/block/Makefile.ob

[Qemu-block] [PATCH COLO-Block v5 10/15] NBD client: connect to nbd server later

2015-05-20 Thread Wen Congyang
The secondary qemu starts later than the primary qemu, so we cannot connect to nbd server in bdrv_open(). Introduce a new open flags to control it. Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei --- block/nbd.c | 12 +++- 1 file changed, 7 insertions(+)

[Qemu-block] [PATCH COLO-Block v5 07/15] Add new block driver interface to connect/disconnect the remote target

2015-05-20 Thread Wen Congyang
In some cases, we want to connect/disconnect the remote target when we need, not in bdrv_open()/bdrv_close(). Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei --- block.c | 24 include/block/block.h | 3 +++ include

[Qemu-block] [PATCH COLO-Block v5 06/15] Don't allow a disk use backing reference target

2015-05-20 Thread Wen Congyang
Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei --- block.c | 9 + 1 file changed, 9 insertions(+) diff --git a/block.c b/block.c index 220ba9a..1b362ba 100644 --- a/block.c +++ b/block.c @@ -1206,6 +1206,14 @@ static int bdrv_open_backing_reference_fil

[Qemu-block] [PATCH COLO-Block v5 02/15] allow writing to the backing file

2015-05-20 Thread Wen Congyang
Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei --- block.c | 33 - 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c index 49d472f..adffa0e 100644 --- a/block.c +++ b/block.c @@ -1051,6 +1051,20 @@ ou

[Qemu-block] [PATCH COLO-Block v5 00/15] Block replication for continuous checkpoints

2015-05-20 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-v5 The other newest COLO patchse will be sen

Re: [Qemu-block] [PATCH COLO v4 00/15] Block replication for continuous checkpoints

2015-05-20 Thread Wen Congyang
On 05/21/2015 03:18 AM, Dr. David Alan Gilbert wrote: > * Wen Congyang (we...@cn.fujitsu.com) wrote: >> 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 patc

Re: [Qemu-block] [PATCH COLO v4 00/15] Block replication for continuous checkpoints

2015-05-20 Thread Dr. David Alan Gilbert
* Wen Congyang (we...@cn.fujitsu.com) wrote: > 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/bl

Re: [Qemu-block] [Qemu-devel] [PATCH COLO v4 01/15] docs: block replication's description

2015-05-20 Thread Andrey Korolyov
On Thu, May 14, 2015 at 6:38 PM, Dr. David Alan Gilbert wrote: > * Wen Congyang (ghost...@gmail.com) wrote: >> At 2015/5/14 19:19, Dr. David Alan Gilbert Wrote: >> >One thing I wanted to check I understand; how much RAM do the active and >> >hidden >> >disks use; lets say during the 1st checkpo

[Qemu-block] [PULL 03/12] tests: Use qtest_add_data_func() consistently

2015-05-20 Thread Andreas Färber
Replace uses of g_test_add_data_func() for QTest test cases. It is still valid to use it for any non-QTest test cases, which are not run for multiple target binaries. Suggested-by: John Snow Reviewed-by: John Snow Signed-off-by: Andreas Färber --- tests/ahci-test.c | 9 ++--- tests

Re: [Qemu-block] [PATCH 05/34] block: Use macro for cache option names

2015-05-20 Thread Alberto Garcia
On Fri 08 May 2015 07:21:37 PM CEST, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [PATCH 03/34] quorum: Use bdrv_open_image()

2015-05-20 Thread Alberto Garcia
On Fri 08 May 2015 07:21:35 PM CEST, Kevin Wolf wrote: > Besides standardising on a single interface for opening child nodes, > this simplifies the .bdrv_open() implementation of the quorum block > driver by using block layer functionality for handling BlockdevRefs. > > Signed-off-by: Kevin Wolf

Re: [Qemu-block] [PATCH] MAINTAINERS: Split "Block QAPI, monitor, command line" off core

2015-05-20 Thread Kevin Wolf
Am 20.05.2015 um 13:23 hat Markus Armbruster geschrieben: > Kevin and Stefan asked me to take care of this part. > > Signed-off-by: Markus Armbruster Thanks, applied to the block branch. Kevin

Re: [Qemu-block] [Qemu-devel] [PATCH 01/34] qdict: Add qdict_array_entries()

2015-05-20 Thread Alberto Garcia
On Fri 08 May 2015 10:06:35 PM CEST, Eric Blake wrote: >> +for (i = 0; i < UINT_MAX; i++) { >> +QObject *subqobj; >> +int subqdict_entries; >> +size_t slen = 32 + subqdict_len; >> +char indexstr[slen], prefix[slen]; > > And more dependence on a working C99 compi

Re: [Qemu-block] [Qemu-devel] [PATCH] MAINTAINERS: Split "Block QAPI, monitor, command line" off core

2015-05-20 Thread Eric Blake
On 05/20/2015 05:23 AM, Markus Armbruster wrote: > Kevin and Stefan asked me to take care of this part. > > Signed-off-by: Markus Armbruster > --- > MAINTAINERS | 8 > 1 file changed, 8 insertions(+) > Reviewed-by: Eric Blake > diff --git a/MAINTAINERS b/MAINTAINERS > index b3552b2.

Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase

2015-05-20 Thread Peter Maydell
On 20 May 2015 at 12:55, John Snow wrote: > So even if /currently/ we can reconstitute it from the register values, > we may eventually be unable to. > > post_load will work for now, but I fear the case (in ten years) when > someone else cleans up FDC code but fails to realize that the phase is >

Re: [Qemu-block] [Qemu-devel] [PATCH 6/8] fdc: Disentangle phases in fdctrl_read_data()

2015-05-20 Thread John Snow
On 05/20/2015 04:25 AM, Kevin Wolf wrote: > Am 19.05.2015 um 22:40 hat John Snow geschrieben: >> >> >> On 05/19/2015 11:36 AM, Kevin Wolf wrote: >>> This commit makes similar improvements as have already been made to the >>> write function: Instead of relying on a flag in the MSR to distinguish >

Re: [Qemu-block] [Qemu-devel] [PATCH 7/8] fdc: Fix MSR.RQM flag

2015-05-20 Thread John Snow
On 05/20/2015 04:14 AM, Kevin Wolf wrote: > Am 19.05.2015 um 22:40 hat John Snow geschrieben: >> >> >> On 05/19/2015 11:36 AM, Kevin Wolf wrote: >>> The RQM bit in MSR should be set whenever the guest is supposed to >>> access the FIFO, and it should be cleared in all other cases. This is >>> imp

Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase

2015-05-20 Thread John Snow
On 05/20/2015 05:24 AM, Peter Maydell wrote: > On 20 May 2015 at 09:43, Kevin Wolf wrote: >> Am 20.05.2015 um 10:06 hat Peter Maydell geschrieben: >>> That handles migration, which is good. But I still think that >>> storing the same information in two places in the device >>> state (phase field

Re: [Qemu-block] [Qemu-devel] [PATCH v4 11/11] qmp-commands.hx: Update the supported 'transaction' operations

2015-05-20 Thread John Snow
On 05/20/2015 07:12 AM, Kashyap Chamarthy wrote: > On Tue, May 19, 2015 at 11:37:32AM -0400, John Snow wrote: >>> On Mon, May 18, 2015 at 06:22:22PM +0200, Max Reitz wrote: On 12.05.2015 01:04, John Snow wrote: > > [. . .] > > diff --git a/qmp-commands.hx b/qmp-commands.hx > index

[Qemu-block] [PATCH] MAINTAINERS: Split "Block QAPI, monitor, command line" off core

2015-05-20 Thread Markus Armbruster
Kevin and Stefan asked me to take care of this part. Signed-off-by: Markus Armbruster --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index b3552b2..8df0c6a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -812,6 +812,14 @@ F: block/stream.h F:

Re: [Qemu-block] [Qemu-devel] [PATCH v4 11/11] qmp-commands.hx: Update the supported 'transaction' operations

2015-05-20 Thread Kashyap Chamarthy
On Tue, May 19, 2015 at 11:37:32AM -0400, John Snow wrote: > > On Mon, May 18, 2015 at 06:22:22PM +0200, Max Reitz wrote: > >> On 12.05.2015 01:04, John Snow wrote: [. . .] > >>> diff --git a/qmp-commands.hx b/qmp-commands.hx > >>> index 7506774..363126a 100644 > >>> --- a/qmp-commands.hx > >>> +

Re: [Qemu-block] [PATCH] MAINTAINERS: Add header files to Block Layer Core section

2015-05-20 Thread Alberto Garcia
On Wed 20 May 2015 12:05:55 PM CEST, Kevin Wolf wrote: > Suggested-by: Markus Armbruster > Signed-off-by: Kevin Wolf Reviewed-by: Alberto Garcia Berto

[Qemu-block] [PATCH] MAINTAINERS: Add header files to Block Layer Core section

2015-05-20 Thread Kevin Wolf
Suggested-by: Markus Armbruster Signed-off-by: Kevin Wolf --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index b3552b2..9ff7c36 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -785,6 +785,7 @@ S: Supported F: block* F: block/ F: hw/block/ +F: inclu

[Qemu-block] [PATCH v4 5/5] raw-posix: Introduce hdev_is_sg()

2015-05-20 Thread Dimitris Aragiorgis
Until now, an SG device was identified only by checking if its path started with "/dev/sg". Then, hdev_open() set bs->sg accordingly. This is very fragile, e.g. it fails with symlinks or relative paths. We should rely on the actual properties of the device instead of the specified file path. Test

[Qemu-block] [PATCH v4 3/5] raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT

2015-05-20 Thread Dimitris Aragiorgis
Building the QEMU tools fails if we #define DEBUG_BLOCK inside block/raw-posix.c. Here instead of adding qemu-log.o in block-obj-y so that DEBUG_BLOCK_PRINT can be used, we substitute the latter with a simple DPRINTF() (that does not cause bit-rot). Signed-off-by: Dimitris Aragiorgis --- block/r

[Qemu-block] [PATCH v4 0/5] Some fixes related to scsi-generic

2015-05-20 Thread Dimitris Aragiorgis
Hi all, These four patches make slight changes to the way QEMU handles SCSI generic devices to fix a number of small problems. I am sending them against the master branch, since I don't know if they can be considered bugfixes. Thanks, dimara v4 (rebased to current master): * Avoid errno clobber

[Qemu-block] [PATCH v4 4/5] raw-posix: Use DPRINTF for DEBUG_FLOPPY

2015-05-20 Thread Dimitris Aragiorgis
Get rid of several #ifdef DEBUG_FLOPPY and substitute them with DPRINTF. Signed-off-by: Dimitris Aragiorgis --- block/raw-posix.c | 22 +- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index 438bf0b..ace228f 100644 ---

[Qemu-block] [PATCH v4 1/5] block: Use bdrv_is_sg() everywhere

2015-05-20 Thread Dimitris Aragiorgis
Instead of checking bs->sg use bdrv_is_sg() consistently throughout the code. Signed-off-by: Dimitris Aragiorgis Reviewed-by: Paolo Bonzini --- block.c |6 +++--- block/iscsi.c |2 +- block/raw-posix.c |4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --g

[Qemu-block] [PATCH v4 2/5] Fix migration in case of scsi-generic

2015-05-20 Thread Dimitris Aragiorgis
During migration, QEMU uses fsync()/fdatasync() on the open file descriptor for read-write block devices to flush data just before stopping the VM. However, fsync() on a scsi-generic device returns -EINVAL which causes the migration to fail. This patch skips flushing data in case of an SG device,

Re: [Qemu-block] [Qemu-devel] [PATCH v4 06/11] block: add refcount to Job object

2015-05-20 Thread Stefan Hajnoczi
On Tue, May 19, 2015 at 06:15:23PM -0400, John Snow wrote: > On 05/18/2015 11:45 AM, Stefan Hajnoczi wrote: > > On Mon, May 11, 2015 at 07:04:21PM -0400, John Snow wrote: > >> If we want to get at the job after the life of the job, > >> we'll need a refcount for this object. > >> > >> This may occu

Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase

2015-05-20 Thread Peter Maydell
On 20 May 2015 at 09:43, Kevin Wolf wrote: > Am 20.05.2015 um 10:06 hat Peter Maydell geschrieben: >> That handles migration, which is good. But I still think that >> storing the same information in two places in the device >> state (phase field and the register fields) is error-prone. > > That's

Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase

2015-05-20 Thread Kevin Wolf
Am 20.05.2015 um 10:06 hat Peter Maydell geschrieben: > On 20 May 2015 at 08:54, Kevin Wolf wrote: > > Am 19.05.2015 um 22:57 hat Peter Maydell geschrieben: > >> Yeah, if there's genuinely an underlying state machine that's > >> not completely visible in registers you need to actually model it. >

Re: [Qemu-block] [PATCH v3 00/13] main-loop: Get rid of fd_read_poll and qemu_set_fd_handler2

2015-05-20 Thread Stefan Hajnoczi
On Wed, May 20, 2015 at 8:39 AM, Paolo Bonzini wrote: > On 20/05/2015 08:38, Fam Zheng wrote: >> On Wed, 05/20 08:26, Paolo Bonzini wrote: >>> >>> >>> On 19/05/2015 17:02, Stefan Hajnoczi wrote: 1. Convert everything like you converted qemu-nbd.c. This is a conservative approach and we

Re: [Qemu-block] [Qemu-devel] [PATCH 6/8] fdc: Disentangle phases in fdctrl_read_data()

2015-05-20 Thread Kevin Wolf
Am 19.05.2015 um 22:40 hat John Snow geschrieben: > > > On 05/19/2015 11:36 AM, Kevin Wolf wrote: > > This commit makes similar improvements as have already been made to the > > write function: Instead of relying on a flag in the MSR to distinguish > > controller phases, use the explicit phase th

Re: [Qemu-block] [Qemu-devel] [PATCH 5/8] fdc: Code cleanup in fdctrl_write_data()

2015-05-20 Thread Kevin Wolf
Am 19.05.2015 um 22:40 hat John Snow geschrieben: > > > On 05/19/2015 11:35 AM, Kevin Wolf wrote: > > Factor out a few common lines of code, reformat, improve comments. > > > > Signed-off-by: Kevin Wolf > > --- > > hw/block/fdc.c | 62 > > +++---

Re: [Qemu-block] [Qemu-devel] [PATCH 7/8] fdc: Fix MSR.RQM flag

2015-05-20 Thread Kevin Wolf
Am 19.05.2015 um 22:40 hat John Snow geschrieben: > > > On 05/19/2015 11:36 AM, Kevin Wolf wrote: > > The RQM bit in MSR should be set whenever the guest is supposed to > > access the FIFO, and it should be cleared in all other cases. This is > > important so the guest can't continue writing/read

Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase

2015-05-20 Thread Peter Maydell
On 20 May 2015 at 08:54, Kevin Wolf wrote: > Am 19.05.2015 um 22:57 hat Peter Maydell geschrieben: >> Yeah, if there's genuinely an underlying state machine that's >> not completely visible in registers you need to actually model it. >> You should probably then model the register bits by calculati

Re: [Qemu-block] [Qemu-devel] [PATCH 3/8] fdc: Introduce fdctrl->phase

2015-05-20 Thread Kevin Wolf
Am 19.05.2015 um 22:57 hat Peter Maydell geschrieben: > On 19 May 2015 at 21:52, John Snow wrote: > > Hmm, I think this is not purely derived state because the flags are not > > necessarily sufficient for regenerating that state. > > Yeah, if there's genuinely an underlying state machine that's >

Re: [Qemu-block] [PATCH v3 00/13] main-loop: Get rid of fd_read_poll and qemu_set_fd_handler2

2015-05-20 Thread Paolo Bonzini
On 20/05/2015 08:38, Fam Zheng wrote: > On Wed, 05/20 08:26, Paolo Bonzini wrote: >> >> >> On 19/05/2015 17:02, Stefan Hajnoczi wrote: >>> 1. Convert everything like you converted qemu-nbd.c. This is a >>> conservative approach and we can be confident that behavior is >>> unchanged. >> >> So,