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
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
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
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
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;
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
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
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
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;
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 |
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
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
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
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
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
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
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/
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
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
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
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
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
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
+
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 ++
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'}
|
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
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
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(+)
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
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
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
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
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
* 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
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
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
On Fri 08 May 2015 07:21:37 PM CEST, Kevin Wolf wrote:
> Signed-off-by: Kevin Wolf
Reviewed-by: Alberto Garcia
Berto
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
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
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
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.
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
>
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
>
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
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
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
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:
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
> >>> +
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
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
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
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
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
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
---
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
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,
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
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
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.
>
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
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
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
> > +++---
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
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
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
>
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,
66 matches
Mail list logo