Similar to the previous patch, make sure that external events are not
dispatched during transaction operations.
Signed-off-by: Fam Zheng
Reviewed-by: Jeff Cody
Reviewed-by: Kevin Wolf
---
blockdev.c | 9 -
1 file changed, 8
This module computes the average of a set of values within a time
window, keeping also track of the minimum and maximum values.
In order to produce more accurate results it works internally by
creating two time windows of the same period, offsetted by half of
that period. Values are accounted on
On 22/10/2015 10:17, Fam Zheng wrote:
> When qcow2 is created on iscsi target with a virtual size greater than
> physical
> capacity of the LUN, over time it's possible that guest fills too much data
> and
> at that point, new clusters in qcow2 will be allocated beyond the end of disk.
>
>
So we could distinguish it from internal used fds, thus avoid handling
unwanted events in nested aio polls.
Signed-off-by: Fam Zheng
Reviewed-by: Jeff Cody
Reviewed-by: Kevin Wolf
---
nbd.c | 4 ++--
1 file changed, 2 insertions(+), 2
Signed-off-by: Alberto Garcia
---
block/accounting.c | 1 +
include/block/accounting.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/block/accounting.c b/block/accounting.c
index 05a5c5f..185025e 100644
--- a/block/accounting.c
+++ b/block/accounting.c
@@ -2,6
Signed-off-by: Alberto Garcia
---
hw/ide/atapi.c | 31 +++
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
index 747f466..cf0b78e 100644
--- a/hw/ide/atapi.c
+++ b/hw/ide/atapi.c
@@ -108,27 +108,30 @@
When qcow2 is created on iscsi target with a virtual size greater than physical
capacity of the LUN, over time it's possible that guest fills too much data and
at that point, new clusters in qcow2 will be allocated beyond the end of disk.
werror=enospc is useful for that purpose to allocate more
Previously we return -EIO blindly when anything goes wrong. Add a helper
function to parse sense fields and try to make the return code more
meaningful.
Signed-off-by: Fam Zheng
---
block/iscsi.c | 56 +++-
1 file changed, 55
Signed-off-by: Alberto Garcia
---
qemu-io-cmds.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
index 6e5d1e4..0cac623 100644
--- a/qemu-io-cmds.c
+++ b/qemu-io-cmds.c
@@ -1364,6 +1364,7 @@ static void aio_write_done(void *opaque,
Signed-off-by: Alberto Garcia
---
hw/scsi/scsi-disk.c | 46 +++---
1 file changed, 31 insertions(+), 15 deletions(-)
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index bada9a7..20a31a7 100644
--- a/hw/scsi/scsi-disk.c
+++
On 22/10/2015 10:31, Peter Lieven wrote:
>
> +switch (sense->key) {
> +case SCSI_SENSE_NO_SENSE:
> +return 0;
> +break;
> +case SCSI_SENSE_NOT_READY:
> +return -EBUSY;
> +break;
> +case SCSI_SENSE_DATA_PROTECTION:
> +return -EACCES;
On Wed, Oct 21, 2015 at 10:06:39AM +0800, Fam Zheng wrote:
> So we could distinguish it from internal used fds, thus avoid handling
> unwanted events in nested aio polls.
>
> Signed-off-by: Fam Zheng
> ---
> nbd.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>
This patch adds two new fields to BlockDeviceTimedStats that track the
average number of pending read and write requests for a block device.
The values are calculated for the period of time defined for that
interval.
Signed-off-by: Alberto Garcia
---
block/accounting.c
Here's a new version of the extended I/O accounting patches.
This one is rebased on top of the current master, has a few minor
documentation fixes and drops the 'supports_stats' field completely.
Regards,
Berto
v3:
- Rebased on top of the current master and on Max's BlockBackend
series v7
-
Currently both BLKIF_OP_WRITE and BLKIF_OP_FLUSH_DISKCACHE are being
accounted as write operations.
Signed-off-by: Alberto Garcia
Reviewed-by: Stefan Hajnoczi
---
hw/block/xen_disk.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
Am 21.10.2015 um 20:36 hat Alberto Garcia geschrieben:
> The group throttling code was always meant to handle its locking
> internally. However, bdrv_swap() was touching the ThrottleGroup
> structure directly and therefore needed an API for that.
>
> Now that bdrv_swap() no longer exists there's
Thanks for summarizing the discussion!
If you are taking over Fam's series, please squash in your patches to
make review easier.
Maybe the names can be improved:
"allow-partial" is not self-explanatory.
"sync-cancel" is misleading since successful completion is affected too,
not just
Drivers can have internal request sources that generate IO, like the
need_check_timer in QED. Since we want quiesced periods that contain
nested event loops in block layer, we need to have a way to disable such
event sources.
Block drivers must implement the "bdrv_drain" callback if it has any
This ensures the atomicity of the transaction by avoiding processing of
external requests such as those from ioeventfd.
state->bs is assigned right after bdrv_drained_begin. Because it was
used as the flag for deletion or not in abort, now we need a separate
flag - InternalSnapshotState.created.
They will be excluded by type in the nested event loops in block layer,
so that unwanted events won't be processed there.
Signed-off-by: Fam Zheng
Reviewed-by: Kevin Wolf
---
hw/block/dataplane/virtio-blk.c | 5 ++---
hw/scsi/virtio-scsi-dataplane.c | 18
Signed-off-by: Alberto Garcia
---
hw/block/virtio-blk.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 8beb26b..aea9728 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -76,7 +76,7 @@
Signed-off-by: Alberto Garcia
---
hw/block/nvme.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 5da41b2..169e4fa 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -201,10 +201,11 @@ static void
v6: Add Kevin's rev-by in patches 1-3, 6-8, 10, 12.
Add Jeff's rev-by in patches 1, 2, 6-8, 10.
04: Fix spelling and wording in comments. [Jeff]
Add assert at decrement. [Jeff]
05: Fix bad rebase. [Jeff]
09: Let blk_is_available come first. [Jeff, Kevin]
11: Rewrite
Signed-off-by: Fam Zheng
---
aio-posix.c | 3 ++-
aio-win32.c | 3 ++-
include/block/aio.h | 38 ++
3 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/aio-posix.c b/aio-posix.c
index f0f9122..0467f23 100644
---
Am 22.09.2015 um 08:13 schrieb Peter Lieven:
Am 25.06.2015 um 15:18 schrieb Stefan Hajnoczi:
On Tue, Jun 23, 2015 at 10:12:15AM +0200, Peter Lieven wrote:
upcoming libnfs versions will support logging debug messages. Add
support for it in qemu through an URL parameter.
Signed-off-by: Peter
This patch adds the block_acct_failed() and block_acct_invalid()
functions to allow keeping track of failed and invalid I/O operations.
The number of failed and invalid operations is exposed in
BlockDeviceStats.
We don't keep track of the time spent on invalid operations because
they are
Signed-off-by: Alberto Garcia
Reviewed-by: Stefan Hajnoczi
---
hw/ide/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 317406d..b559f1b 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -895,7
This patch adds the new field 'idle_time_ns' to the BlockDeviceStats
structure, indicating the time that has passed since the previous I/O
operation.
It also adds the block_acct_idle_time_ns() call, to ensure that all
references to the clock type used for accounting are in the same
place. This
This patch switches to QEMU_CLOCK_VIRTUAL for the accounting code in
qtest mode, and makes the latency of the operation constant. This way we
can perform tests on the accounting code with reproducible results.
Signed-off-by: Alberto Garcia
---
block/accounting.c | 14
The BlockAcctStats structure contains a list of BlockAcctTimedStats.
Each one of these collects statistics about the minimum, maximum and
average latencies of all I/O operations in a certain interval of time.
This patch adds a new "stats-intervals" option that allows defining
these intervals.
Its value is still QEMU_CLOCK_REALTIME, but having it in a variable will
allow us to change its value easily in the future when running in qtest
mode.
Signed-off-by: Alberto Garcia
Reviewed-by: Stefan Hajnoczi
---
block/accounting.c | 6 --
1 file
Signed-off-by: Alberto Garcia
---
tests/qemu-iotests/136 | 349 +
tests/qemu-iotests/136.out | 5 +
tests/qemu-iotests/group | 1 +
3 files changed, 355 insertions(+)
create mode 100644 tests/qemu-iotests/136
create mode
Signed-off-by: Alberto Garcia
---
hw/ide/macio.c | 12 ++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/hw/ide/macio.c b/hw/ide/macio.c
index 66ac2ba..176e331 100644
--- a/hw/ide/macio.c
+++ b/hw/ide/macio.c
@@ -286,7 +286,11 @@ static void
Signed-off-by: Alberto Garcia
---
hw/block/xen_disk.c | 23 ++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 4869518..02eda6e 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@
Am 22.10.2015 um 10:17 schrieb Fam Zheng:
Previously we return -EIO blindly when anything goes wrong. Add a helper
function to parse sense fields and try to make the return code more
meaningful.
Signed-off-by: Fam Zheng
---
block/iscsi.c | 56
Am 22.10.2015 um 10:17 schrieb Fam Zheng:
When qcow2 is created on iscsi target with a virtual size greater than physical
capacity of the LUN, over time it's possible that guest fills too much data and
at that point, new clusters in qcow2 will be allocated beyond the end of disk.
Why would you
Signed-off-by: Fam Zheng
Reviewed-by: Kevin Wolf
---
tests/test-aio.c | 24
1 file changed, 24 insertions(+)
diff --git a/tests/test-aio.c b/tests/test-aio.c
index 03cd45d..1623803 100644
--- a/tests/test-aio.c
+++ b/tests/test-aio.c
This will make the default werror (=enospc) work better when qcow2 is
created on top of iscsi or other block devices.
Signed-off-by: Fam Zheng
---
block/qcow2.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/block/qcow2.c b/block/qcow2.c
index bacc4f2..8edf0fe 100644
This patch adds two options, "stats-account-invalid" and
"stats-account-failed", that can be used to decide whether invalid and
failed I/O operations must be used when collecting statistics for
latency and last access time.
Signed-off-by: Alberto Garcia
Reviewed-by: Stefan
On Thu, Oct 22, 2015 at 12:18:11PM +0200, Kevin Wolf wrote:
> Am 22.10.2015 um 08:32 hat Fam Zheng geschrieben:
> > This ensures the atomicity of the transaction by avoiding processing of
> > external requests such as those from ioeventfd.
> >
> > state->bs is assigned right after
On Thu 22 Oct 2015 12:38:24 PM CEST, Kevin Wolf wrote:
>> >> > I haven't thought about it enough yet, but it seems to me that we
>> >> > can't do the BDS/BB aliasing with blockdev-del, but need to interpret
>> >> > node-name as BDS and id as BB. Perhaps we also shouldn't use a
Am 22.10.2015 um 13:31 hat Alberto Garcia geschrieben:
> On Thu 22 Oct 2015 01:25:05 PM CEST, Kevin Wolf wrote:
> >> But there's this case that is not so obvious. It involves the new
> >> 'blockdev-snapshot' command I'm working on:
> >>
> >> - blockdev-add id=drive0 node-name=node0
Am 22.10.2015 um 08:32 hat Fam Zheng geschrieben:
> The "need_check_timer" is used to clear the "NEED_CHECK" flag in the
> image header after a grace period once metadata update has finished. In
> compliance to the bdrv_drain semantics we should make sure it remains
> deleted once .bdrv_drain is
Am 22.10.2015 um 13:08 hat Alberto Garcia geschrieben:
> >> I'm currently thinking about d), which tries to maintain the symmetry
> >> with blockdev-add:
> >>
> >> - blockdev-del would have two parameters, 'id' and 'node-name', and only
> >> one of them can be set, so you must choose whether
On Thu 22 Oct 2015 01:25:05 PM CEST, Kevin Wolf wrote:
>> But there's this case that is not so obvious. It involves the new
>> 'blockdev-snapshot' command I'm working on:
>>
>> - blockdev-add id=drive0 node-name=node0 file=hd0.qcow2
>> - qemu-img create -f qcow2 -b hd0.qcow2 overlay0.qcow2
>>
On Thu, 10/22 10:32, Peter Lieven wrote:
> Am 22.10.2015 um 10:17 schrieb Fam Zheng:
> >When qcow2 is created on iscsi target with a virtual size greater than
> >physical
> >capacity of the LUN, over time it's possible that guest fills too much data
> >and
> >at that point, new clusters in qcow2
On Thu, 10/22 10:45, Paolo Bonzini wrote:
>
>
> On 22/10/2015 10:31, Peter Lieven wrote:
> >
> > +switch (sense->key) {
> > +case SCSI_SENSE_NO_SENSE:
> > +return 0;
> > +break;
> > +case SCSI_SENSE_NOT_READY:
> > +return -EBUSY;
> > +break;
> > +
On 22/10/2015 11:51, Fam Zheng wrote:
> > >
> > > +switch (sense->key) {
> > > +case SCSI_SENSE_NO_SENSE:
> > > +return 0;
> > > +break;
> > > +case SCSI_SENSE_NOT_READY:
> > > +return -EBUSY;
> > > +break;
> > > +case SCSI_SENSE_DATA_PROTECTION:
Am 22.10.2015 um 10:45 hat Paolo Bonzini geschrieben:
> On 22/10/2015 10:17, Fam Zheng wrote:
> > When qcow2 is created on iscsi target with a virtual size greater than
> > physical
> > capacity of the LUN, over time it's possible that guest fills too much data
> > and
> > at that point, new
Am 22.10.2015 um 08:32 hat Fam Zheng geschrieben:
> This ensures the atomicity of the transaction by avoiding processing of
> external requests such as those from ioeventfd.
>
> state->bs is assigned right after bdrv_drained_begin. Because it was
> used as the flag for deletion or not in abort,
Am 22.10.2015 um 10:45 schrieb Paolo Bonzini:
On 22/10/2015 10:31, Peter Lieven wrote:
+switch (sense->key) {
+case SCSI_SENSE_NO_SENSE:
+return 0;
+break;
Isn't it dangerous to return 0 (no error) if the status is != SCSI_STATUS_GOOD?
Peter
Am 22.10.2015 um 10:17 hat Fam Zheng geschrieben:
> Previously we return -EIO blindly when anything goes wrong. Add a helper
> function to parse sense fields and try to make the return code more
> meaningful.
>
> Signed-off-by: Fam Zheng
> ---
> block/iscsi.c | 56
Am 20.10.2015 um 17:02 hat Alberto Garcia geschrieben:
> On Mon 19 Oct 2015 05:04:50 PM CEST, Kevin Wolf wrote:
> >> > So we seem to have two criteria to distinguish BDSes:
> >> >
> >> > 1. Does/Doesn't have a BlockBackend on top.
> >> >In the future, multiple BlockBackends
This ensures the atomicity of the transaction by avoiding processing of
external requests such as those from ioeventfd.
Signed-off-by: Fam Zheng
Reviewed-by: Jeff Cody
Reviewed-by: Kevin Wolf
---
blockdev.c | 11 +--
1 file changed,
We have two issues with our qapi union layout:
1) Even though the QMP wire format spells the tag 'type', the
C code spells it 'kind', requiring some hacks in the generator.
2) The C struct uses an anonymous union, which places all tag
values in the same namespace as all non-variant members. This
Signed-off-by: Fam Zheng
Reviewed-by: Kevin Wolf
---
tests/test-aio.c | 24
1 file changed, 24 insertions(+)
diff --git a/tests/test-aio.c b/tests/test-aio.c
index 03cd45d..1623803 100644
--- a/tests/test-aio.c
+++ b/tests/test-aio.c
Signed-off-by: Fam Zheng
---
aio-posix.c | 3 ++-
aio-win32.c | 3 ++-
include/block/aio.h | 38 ++
3 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/aio-posix.c b/aio-posix.c
index f0f9122..0467f23 100644
---
The semantics is that after bdrv_drained_begin(bs), bs will not get new external
requests until the matching bdrv_drained_end(bs).
Signed-off-by: Fam Zheng
---
block/io.c| 17 +
include/block/block.h | 19 +++
This ensures the atomicity of the transaction by avoiding processing of
external requests such as those from ioeventfd.
state->bs is assigned right after bdrv_drained_begin. Because it was
used as the flag for deletion or not in abort, now we need a separate
flag - InternalSnapshotState.created.
Similar to the previous patch, make sure that external events are not
dispatched during transaction operations.
Signed-off-by: Fam Zheng
Reviewed-by: Jeff Cody
Reviewed-by: Kevin Wolf
---
blockdev.c | 9 -
1 file changed, 8
v7: Exclude bdrv_drain and bdrv_qed_drain patches, they'll follow the
bdrv_drain fix for bdrv_aio_flush.
Fix internal snapshot clean.
v6: Add Kevin's rev-by in patches 1-3, 6-8, 10, 12.
Add Jeff's rev-by in patches 1, 2, 6-8, 10.
04: Fix spelling and wording in comments. [Jeff]
This ensures the atomicity of the transaction by avoiding processing of
external requests such as those from ioeventfd.
Move the assignment to state->bs up right after bdrv_drained_begin, so
that we can use it in the clean callback. The abort callback will still
check bs->job and state->job, so
So we could distinguish it from internal used fds, thus avoid handling
unwanted events in nested aio polls.
Signed-off-by: Fam Zheng
Reviewed-by: Jeff Cody
Reviewed-by: Kevin Wolf
---
nbd.c | 4 ++--
1 file changed, 2 insertions(+), 2
All callers pass in false, and the real external ones will switch to
true in coming patches.
Signed-off-by: Fam Zheng
Reviewed-by: Jeff Cody
Reviewed-by: Kevin Wolf
---
aio-posix.c | 6 -
aio-win32.c
On Thu, 10/22 22:59, Paolo Bonzini wrote:
>
>
> On 22/10/2015 12:53, Kevin Wolf wrote:
> > Am 22.10.2015 um 08:32 hat Fam Zheng geschrieben:
> >> The "need_check_timer" is used to clear the "NEED_CHECK" flag in the
> >> image header after a grace period once metadata update has finished. In
> >>
Here's the new version of the blockdev-del command.
The first change is that I renamed it to 'x-blockdev-del' as Markus
suggested.
I also extended the test cases, which should be way more robust
now. This actually made me realize that there's tricky scenarios that
require changes in other parts
This function returns the reference count of a given BlockBackend.
For convenience, it returns 0 if the BlockBackend pointer is NULL.
Signed-off-by: Alberto Garcia
Reviewed-by: Max Reitz
---
block/block-backend.c | 5 +
During the 'drive-backup' operation the target image only has the
monitor reference, therefore there's nothing that prevents its
deletion using the 'x-blockdev-del' command before the block job has
finished.
Although the operation itself does not allow the user to set a node
name that can be used
Signed-off-by: Alberto Garcia
---
hw/ide/core.c | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/hw/ide/core.c b/hw/ide/core.c
index b559f1b..dd7e9c5 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -574,7 +574,6 @@ static void
This patch keeps track of the minimum, maximum and average latencies
of I/O operations during a certain interval of time.
The values are exposed in the BlockDeviceTimedStats structure.
An option to define the intervals to collect these statistics will be
added in a separate patch.
This command is still experimental, hence the name.
This is the companion to 'blockdev-add'. It allows deleting a
BlockBackend with its associated BlockDriverState tree, or a
BlockDriverState that is not attached to any backend.
In either case, the command fails if the reference count is greater
During the 'drive-mirror' operation the target image only has the
monitor reference, therefore there's nothing that prevents its
deletion using the 'x-blockdev-del' command before the block job has
finished.
Signed-off-by: Alberto Garcia
---
block/mirror.c | 6 ++
1 file
Signed-off-by: Alberto Garcia
---
tests/qemu-iotests/139 | 408 +
tests/qemu-iotests/139.out | 5 +
tests/qemu-iotests/group | 1 +
3 files changed, 414 insertions(+)
create mode 100644 tests/qemu-iotests/139
create mode
On Mon, Oct 12, 2015 at 02:27:22PM +0200, Peter Lieven wrote:
> @@ -129,9 +134,71 @@ static int cd_read_sector(IDEState *s, int lba, uint8_t
> *buf, int sector_size)
> ret = -EIO;
> break;
> }
> +
> +if (!ret) {
> +s->lba++;
This function probably shouldn't
On Thu 22 Oct 2015 05:13:55 PM CEST, Alberto Garcia wrote:
> During the 'drive-mirror' operation the target image only has the
> monitor reference, therefore there's nothing that prevents its
> deletion using the 'x-blockdev-del' command before the block job has
> finished.
Answering myself: it's
75 matches
Mail list logo