1
The following changes since commit fa54abb8c298f892639ffc4bc2f61448ac3be4a1:
1
The following changes since commit 58560ad254fbda71d4daa6622d71683190070ee2:
2
2
3
Drop QEMU_GNUC_PREREQ() checks for gcc older than 4.1 (2017-04-20 18:33:33 +0100)
3
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-4.2-20191024' into staging (2019-10-24 16:22:58 +0100)
4
4
5
are available in the git repository at:
5
are available in the Git repository at:
6
6
7
git://github.com/stefanha/qemu.git tags/block-pull-request
7
https://github.com/stefanha/qemu.git tags/block-pull-request
8
8
9
for you to fetch changes up to 3ccc0a0163b932fe980dce8d26db4bf98b1900e9:
9
for you to fetch changes up to d154ef37ff885918fa3e512fd7a8e42870291667:
10
10
11
MAINTAINERS: update my email address (2017-04-21 10:36:12 +0100)
11
yield_until_fd_readable: make it work with any AioContect (2019-10-25 14:38:29 +0200)
12
13
----------------------------------------------------------------
14
Pull request
12
15
13
----------------------------------------------------------------
16
----------------------------------------------------------------
14
17
15
----------------------------------------------------------------
18
Dietmar Maurer (1):
19
yield_until_fd_readable: make it work with any AioContect
16
20
17
Changlong Xie (1):
21
Julia Suvorova (1):
18
MAINTAINERS: update Wen's email address
22
virtio-blk: Add blk_drain() to virtio_blk_device_unrealize()
19
23
20
Lidong Chen (1):
24
hw/block/virtio-blk.c | 1 +
21
migration/block: use blk_pwrite_zeroes for each zero cluster
25
util/qemu-coroutine-io.c | 7 +++++--
22
26
2 files changed, 6 insertions(+), 2 deletions(-)
23
Stefan Hajnoczi (3):
24
qemu-options: explain disk I/O throttling options
25
throttle: do not use invalid config in test
26
throttle: make throttle_config(throttle_get_config()) symmetric
27
28
Zhang Chen (1):
29
MAINTAINERS: update my email address
30
31
MAINTAINERS | 4 ++--
32
migration/block.c | 35 +++++++++++++++++++++++++++++++++--
33
tests/test-throttle.c | 8 ++++----
34
util/throttle.c | 14 ++++++++++++++
35
qemu-options.hx | 24 ++++++++++++++++++++++++
36
5 files changed, 77 insertions(+), 8 deletions(-)
37
27
38
--
28
--
39
2.9.3
29
2.21.0
40
30
41
31
diff view generated by jsdifflib
Deleted patch
1
The disk I/O throttling options have been listed for a long time but
2
never explained on the QEMU man page.
3
1
4
Suggested-by: Nini Gu <ngu@redhat.com>
5
Cc: Alberto Garcia <berto@igalia.com>
6
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7
Reviewed-by: Alberto Garcia <berto@igalia.com>
8
Reviewed-by: Greg Kurz <groug@kaod.org>
9
Message-id: 20170301115026.22621-2-stefanha@redhat.com
10
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11
---
12
qemu-options.hx | 24 ++++++++++++++++++++++++
13
1 file changed, 24 insertions(+)
14
15
diff --git a/qemu-options.hx b/qemu-options.hx
16
index XXXXXXX..XXXXXXX 100644
17
--- a/qemu-options.hx
18
+++ b/qemu-options.hx
19
@@ -XXX,XX +XXX,XX @@ file sectors into the image file.
20
conversion of plain zero writes by the OS to driver specific optimized
21
zero write commands. You may even choose "unmap" if @var{discard} is set
22
to "unmap" to allow a zero write to be converted to an UNMAP operation.
23
+@item bps=@var{b},bps_rd=@var{r},bps_wr=@var{w}
24
+Specify bandwidth throttling limits in bytes per second, either for all request
25
+types or for reads or writes only. Small values can lead to timeouts or hangs
26
+inside the guest. A safe minimum for disks is 2 MB/s.
27
+@item bps_max=@var{bm},bps_rd_max=@var{rm},bps_wr_max=@var{wm}
28
+Specify bursts in bytes per second, either for all request types or for reads
29
+or writes only. Bursts allow the guest I/O to spike above the limit
30
+temporarily.
31
+@item iops=@var{i},iops_rd=@var{r},iops_wr=@var{w}
32
+Specify request rate limits in requests per second, either for all request
33
+types or for reads or writes only.
34
+@item iops_max=@var{bm},iops_rd_max=@var{rm},iops_wr_max=@var{wm}
35
+Specify bursts in requests per second, either for all request types or for reads
36
+or writes only. Bursts allow the guest I/O to spike above the limit
37
+temporarily.
38
+@item iops_size=@var{is}
39
+Let every @var{is} bytes of a request count as a new request for iops
40
+throttling purposes. Use this option to prevent guests from circumventing iops
41
+limits by sending fewer but larger requests.
42
+@item group=@var{g}
43
+Join a throttling quota group with given name @var{g}. All drives that are
44
+members of the same group are accounted for together. Use this option to
45
+prevent guests from circumventing throttling limits by using many small disks
46
+instead of a single larger disk.
47
@end table
48
49
By default, the @option{cache=writeback} mode is used. It will report data
50
--
51
2.9.3
52
53
diff view generated by jsdifflib
Deleted patch
1
The (burst) max parameter cannot be smaller than the avg parameter.
2
There is a test case that uses avg = 56, max = 1 and gets away with it
3
because no input validation is performed by the test case.
4
1
5
This patch switches to valid test input parameters.
6
7
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
8
Reviewed-by: Alberto Garcia <berto@igalia.com>
9
Message-id: 20170301115026.22621-3-stefanha@redhat.com
10
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11
---
12
tests/test-throttle.c | 8 ++++----
13
1 file changed, 4 insertions(+), 4 deletions(-)
14
15
diff --git a/tests/test-throttle.c b/tests/test-throttle.c
16
index XXXXXXX..XXXXXXX 100644
17
--- a/tests/test-throttle.c
18
+++ b/tests/test-throttle.c
19
@@ -XXX,XX +XXX,XX @@ static void test_config_functions(void)
20
orig_cfg.buckets[THROTTLE_OPS_READ].avg = 69;
21
orig_cfg.buckets[THROTTLE_OPS_WRITE].avg = 23;
22
23
- orig_cfg.buckets[THROTTLE_BPS_TOTAL].max = 0; /* should be corrected */
24
- orig_cfg.buckets[THROTTLE_BPS_READ].max = 1; /* should not be corrected */
25
+ orig_cfg.buckets[THROTTLE_BPS_TOTAL].max = 0; /* should be corrected */
26
+ orig_cfg.buckets[THROTTLE_BPS_READ].max = 56; /* should not be corrected */
27
orig_cfg.buckets[THROTTLE_BPS_WRITE].max = 120;
28
29
orig_cfg.buckets[THROTTLE_OPS_TOTAL].max = 150;
30
@@ -XXX,XX +XXX,XX @@ static void test_config_functions(void)
31
g_assert(final_cfg.buckets[THROTTLE_OPS_READ].avg == 69);
32
g_assert(final_cfg.buckets[THROTTLE_OPS_WRITE].avg == 23);
33
34
- g_assert(final_cfg.buckets[THROTTLE_BPS_TOTAL].max == 15.3);/* fixed */
35
- g_assert(final_cfg.buckets[THROTTLE_BPS_READ].max == 1); /* not fixed */
36
+ g_assert(final_cfg.buckets[THROTTLE_BPS_TOTAL].max == 15.3); /* fixed */
37
+ g_assert(final_cfg.buckets[THROTTLE_BPS_READ].max == 56); /* not fixed */
38
g_assert(final_cfg.buckets[THROTTLE_BPS_WRITE].max == 120);
39
40
g_assert(final_cfg.buckets[THROTTLE_OPS_TOTAL].max == 150);
41
--
42
2.9.3
43
44
diff view generated by jsdifflib
1
From: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
1
From: Julia Suvorova <jusual@redhat.com>
2
2
3
I'm leaving my job at Fujitsu, this email address will stop working
3
QEMU does not wait for completed I/O requests, assuming that the guest
4
this week. Update it to one that I will have access to later.
4
driver will reset the device before calling unrealize(). This does not
5
happen on Windows, and QEMU crashes in virtio_notify(), getting the
6
result of a completed I/O request on hot-unplugged device.
5
7
6
Signed-off-by: Xie Changlong <xiecl.fnst@cn.fujitsu.com>
8
Signed-off-by: Julia Suvorova <jusual@redhat.com>
7
Message-id: 1492758767-19716-1-git-send-email-xiecl.fnst@cn.fujitsu.com
9
Message-Id: <20191018142856.31870-1-jusual@redhat.com>
8
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9
---
11
---
10
MAINTAINERS | 2 +-
12
hw/block/virtio-blk.c | 1 +
11
1 file changed, 1 insertion(+), 1 deletion(-)
13
1 file changed, 1 insertion(+)
12
14
13
diff --git a/MAINTAINERS b/MAINTAINERS
15
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
14
index XXXXXXX..XXXXXXX 100644
16
index XXXXXXX..XXXXXXX 100644
15
--- a/MAINTAINERS
17
--- a/hw/block/virtio-blk.c
16
+++ b/MAINTAINERS
18
+++ b/hw/block/virtio-blk.c
17
@@ -XXX,XX +XXX,XX @@ F: tests/image-fuzzer/
19
@@ -XXX,XX +XXX,XX @@ static void virtio_blk_device_unrealize(DeviceState *dev, Error **errp)
18
20
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
19
Replication
21
VirtIOBlock *s = VIRTIO_BLK(dev);
20
M: Wen Congyang <wencongyang2@huawei.com>
22
21
-M: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
23
+ blk_drain(s->blk);
22
+M: Xie Changlong <xiechanglong.d@gmail.com>
24
virtio_blk_data_plane_destroy(s->dataplane);
23
S: Supported
25
s->dataplane = NULL;
24
F: replication*
26
qemu_del_vm_change_state_handler(s->change);
25
F: block/replication.c
26
--
27
--
27
2.9.3
28
2.21.0
28
29
29
30
diff view generated by jsdifflib
1
Throttling has a weird property that throttle_get_config() does not
1
From: Dietmar Maurer <dietmar@proxmox.com>
2
always return the same throttling settings that were given with
3
throttle_config(). In other words, the set and get functions aren't
4
symmetric.
5
2
6
If .max is 0 then the throttling code assigns a default value of .avg /
3
Simply use qemu_get_current_aio_context().
7
10 in throttle_config(). This is an implementation detail of the
8
throttling algorithm. When throttle_get_config() is called the .max
9
value returned should still be 0.
10
4
11
Users are exposed to this quirk via "info block" or "query-block"
5
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
12
monitor commands. This has caused confusion because it looks like a bug
6
Message-Id: <20191024045610.9071-1-dietmar@proxmox.com>
13
when an unexpected value is reported.
14
15
This patch hides the .max value adjustment in throttle_get_config() and
16
updates test-throttle.c appropriately.
17
18
Reported-by: Nini Gu <ngu@redhat.com>
19
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
20
Reviewed-by: Alberto Garcia <berto@igalia.com>
21
Message-id: 20170301115026.22621-4-stefanha@redhat.com
22
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
23
---
8
---
24
tests/test-throttle.c | 8 ++++----
9
util/qemu-coroutine-io.c | 7 +++++--
25
util/throttle.c | 14 ++++++++++++++
10
1 file changed, 5 insertions(+), 2 deletions(-)
26
2 files changed, 18 insertions(+), 4 deletions(-)
27
11
28
diff --git a/tests/test-throttle.c b/tests/test-throttle.c
12
diff --git a/util/qemu-coroutine-io.c b/util/qemu-coroutine-io.c
29
index XXXXXXX..XXXXXXX 100644
13
index XXXXXXX..XXXXXXX 100644
30
--- a/tests/test-throttle.c
14
--- a/util/qemu-coroutine-io.c
31
+++ b/tests/test-throttle.c
15
+++ b/util/qemu-coroutine-io.c
32
@@ -XXX,XX +XXX,XX @@ static void test_config_functions(void)
16
@@ -XXX,XX +XXX,XX @@ qemu_co_send_recv(int sockfd, void *buf, size_t bytes, bool do_send)
33
orig_cfg.buckets[THROTTLE_OPS_READ].avg = 69;
34
orig_cfg.buckets[THROTTLE_OPS_WRITE].avg = 23;
35
36
- orig_cfg.buckets[THROTTLE_BPS_TOTAL].max = 0; /* should be corrected */
37
- orig_cfg.buckets[THROTTLE_BPS_READ].max = 56; /* should not be corrected */
38
+ orig_cfg.buckets[THROTTLE_BPS_TOTAL].max = 0;
39
+ orig_cfg.buckets[THROTTLE_BPS_READ].max = 56;
40
orig_cfg.buckets[THROTTLE_BPS_WRITE].max = 120;
41
42
orig_cfg.buckets[THROTTLE_OPS_TOTAL].max = 150;
43
@@ -XXX,XX +XXX,XX @@ static void test_config_functions(void)
44
g_assert(final_cfg.buckets[THROTTLE_OPS_READ].avg == 69);
45
g_assert(final_cfg.buckets[THROTTLE_OPS_WRITE].avg == 23);
46
47
- g_assert(final_cfg.buckets[THROTTLE_BPS_TOTAL].max == 15.3); /* fixed */
48
- g_assert(final_cfg.buckets[THROTTLE_BPS_READ].max == 56); /* not fixed */
49
+ g_assert(final_cfg.buckets[THROTTLE_BPS_TOTAL].max == 0);
50
+ g_assert(final_cfg.buckets[THROTTLE_BPS_READ].max == 56);
51
g_assert(final_cfg.buckets[THROTTLE_BPS_WRITE].max == 120);
52
53
g_assert(final_cfg.buckets[THROTTLE_OPS_TOTAL].max == 150);
54
diff --git a/util/throttle.c b/util/throttle.c
55
index XXXXXXX..XXXXXXX 100644
56
--- a/util/throttle.c
57
+++ b/util/throttle.c
58
@@ -XXX,XX +XXX,XX @@ static void throttle_fix_bucket(LeakyBucket *bkt)
59
}
60
}
17
}
61
18
62
+/* undo internal bucket parameter changes (see throttle_fix_bucket()) */
19
typedef struct {
63
+static void throttle_unfix_bucket(LeakyBucket *bkt)
20
+ AioContext *ctx;
64
+{
21
Coroutine *co;
65
+ if (bkt->max < bkt->avg) {
22
int fd;
66
+ bkt->max = 0;
23
} FDYieldUntilData;
67
+ }
24
@@ -XXX,XX +XXX,XX @@ typedef struct {
68
+}
25
static void fd_coroutine_enter(void *opaque)
69
+
70
/* take care of canceling a timer */
71
static void throttle_cancel_timer(QEMUTimer *timer)
72
{
26
{
73
@@ -XXX,XX +XXX,XX @@ void throttle_config(ThrottleState *ts,
27
FDYieldUntilData *data = opaque;
74
*/
28
- qemu_set_fd_handler(data->fd, NULL, NULL, NULL);
75
void throttle_get_config(ThrottleState *ts, ThrottleConfig *cfg)
29
+ aio_set_fd_handler(data->ctx, data->fd, false, NULL, NULL, NULL, NULL);
76
{
30
qemu_coroutine_enter(data->co);
77
+ int i;
78
+
79
*cfg = ts->cfg;
80
+
81
+ for (i = 0; i < BUCKETS_COUNT; i++) {
82
+ throttle_unfix_bucket(&cfg->buckets[i]);
83
+ }
84
}
31
}
85
32
86
33
@@ -XXX,XX +XXX,XX @@ void coroutine_fn yield_until_fd_readable(int fd)
34
FDYieldUntilData data;
35
36
assert(qemu_in_coroutine());
37
+ data.ctx = qemu_get_current_aio_context();
38
data.co = qemu_coroutine_self();
39
data.fd = fd;
40
- qemu_set_fd_handler(fd, fd_coroutine_enter, NULL, &data);
41
+ aio_set_fd_handler(
42
+ data.ctx, fd, false, fd_coroutine_enter, NULL, NULL, &data);
43
qemu_coroutine_yield();
44
}
87
--
45
--
88
2.9.3
46
2.21.0
89
47
90
48
diff view generated by jsdifflib
Deleted patch
1
From: Lidong Chen <lidongchen@tencent.com>
2
1
3
BLOCK_SIZE is (1 << 20), qcow2 cluster size is 65536 by default,
4
this may cause the qcow2 file size to be bigger after migration.
5
This patch checks each cluster, using blk_pwrite_zeroes for each
6
zero cluster.
7
8
[Initialize cluster_size to BLOCK_SIZE to prevent a gcc uninitialized
9
variable compiler warning. In reality we always initialize cluster_size
10
in a conditional but gcc doesn't know that.
11
--Stefan]
12
13
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
14
Signed-off-by: Lidong Chen <lidongchen@tencent.com>
15
Message-id: 1492050868-16200-1-git-send-email-lidongchen@tencent.com
16
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
17
---
18
migration/block.c | 35 +++++++++++++++++++++++++++++++++--
19
1 file changed, 33 insertions(+), 2 deletions(-)
20
21
diff --git a/migration/block.c b/migration/block.c
22
index XXXXXXX..XXXXXXX 100644
23
--- a/migration/block.c
24
+++ b/migration/block.c
25
@@ -XXX,XX +XXX,XX @@ static int block_load(QEMUFile *f, void *opaque, int version_id)
26
int64_t total_sectors = 0;
27
int nr_sectors;
28
int ret;
29
+ BlockDriverInfo bdi;
30
+ int cluster_size = BLOCK_SIZE;
31
32
do {
33
addr = qemu_get_be64(f);
34
@@ -XXX,XX +XXX,XX @@ static int block_load(QEMUFile *f, void *opaque, int version_id)
35
error_report_err(local_err);
36
return -EINVAL;
37
}
38
+
39
+ ret = bdrv_get_info(blk_bs(blk), &bdi);
40
+ if (ret == 0 && bdi.cluster_size > 0 &&
41
+ bdi.cluster_size <= BLOCK_SIZE &&
42
+ BLOCK_SIZE % bdi.cluster_size == 0) {
43
+ cluster_size = bdi.cluster_size;
44
+ } else {
45
+ cluster_size = BLOCK_SIZE;
46
+ }
47
}
48
49
if (total_sectors - addr < BDRV_SECTORS_PER_DIRTY_CHUNK) {
50
@@ -XXX,XX +XXX,XX @@ static int block_load(QEMUFile *f, void *opaque, int version_id)
51
nr_sectors * BDRV_SECTOR_SIZE,
52
BDRV_REQ_MAY_UNMAP);
53
} else {
54
+ int i;
55
+ int64_t cur_addr;
56
+ uint8_t *cur_buf;
57
+
58
buf = g_malloc(BLOCK_SIZE);
59
qemu_get_buffer(f, buf, BLOCK_SIZE);
60
- ret = blk_pwrite(blk, addr * BDRV_SECTOR_SIZE, buf,
61
- nr_sectors * BDRV_SECTOR_SIZE, 0);
62
+ for (i = 0; i < BLOCK_SIZE / cluster_size; i++) {
63
+ cur_addr = addr * BDRV_SECTOR_SIZE + i * cluster_size;
64
+ cur_buf = buf + i * cluster_size;
65
+
66
+ if ((!block_mig_state.zero_blocks ||
67
+ cluster_size < BLOCK_SIZE) &&
68
+ buffer_is_zero(cur_buf, cluster_size)) {
69
+ ret = blk_pwrite_zeroes(blk, cur_addr,
70
+ cluster_size,
71
+ BDRV_REQ_MAY_UNMAP);
72
+ } else {
73
+ ret = blk_pwrite(blk, cur_addr, cur_buf,
74
+ cluster_size, 0);
75
+ }
76
+ if (ret < 0) {
77
+ break;
78
+ }
79
+ }
80
g_free(buf);
81
}
82
83
--
84
2.9.3
85
86
diff view generated by jsdifflib
Deleted patch
1
From: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
2
1
3
So he can get CC'ed on future patches and bugs for this feature
4
5
Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
6
Message-id: 1492484893-23435-1-git-send-email-xiecl.fnst@cn.fujitsu.com
7
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
8
---
9
MAINTAINERS | 2 +-
10
1 file changed, 1 insertion(+), 1 deletion(-)
11
12
diff --git a/MAINTAINERS b/MAINTAINERS
13
index XXXXXXX..XXXXXXX 100644
14
--- a/MAINTAINERS
15
+++ b/MAINTAINERS
16
@@ -XXX,XX +XXX,XX @@ S: Supported
17
F: tests/image-fuzzer/
18
19
Replication
20
-M: Wen Congyang <wency@cn.fujitsu.com>
21
+M: Wen Congyang <wencongyang2@huawei.com>
22
M: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
23
S: Supported
24
F: replication*
25
--
26
2.9.3
27
28
diff view generated by jsdifflib