1 | The following changes since commit fa54abb8c298f892639ffc4bc2f61448ac3be4a1: | 1 | The following changes since commit 577caa2672ccde7352fda3ef17e44993de862f0e: |
---|---|---|---|
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/edgar/tags/edgar/mmio-exec-v2.for-upstream' into staging (2017-06-27 16:56:55 +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 | git://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 439778e6b4a20c8fe6a6a92a17013b09c4ae55d0: |
10 | 10 | ||
11 | MAINTAINERS: update my email address (2017-04-21 10:36:12 +0100) | 11 | virtio-pci: use ioeventfd even when KVM is disabled (2017-06-28 13:18:53 +0100) |
12 | 12 | ||
13 | ---------------------------------------------------------------- | 13 | ---------------------------------------------------------------- |
14 | 14 | ||
15 | ---------------------------------------------------------------- | 15 | ---------------------------------------------------------------- |
16 | 16 | ||
17 | Changlong Xie (1): | 17 | Stefan Hajnoczi (2): |
18 | MAINTAINERS: update Wen's email address | 18 | virtio-blk: trace vdev so devices can be distinguished |
19 | virtio-pci: use ioeventfd even when KVM is disabled | ||
19 | 20 | ||
20 | Lidong Chen (1): | 21 | hw/block/virtio-blk.c | 12 +++++++----- |
21 | migration/block: use blk_pwrite_zeroes for each zero cluster | 22 | hw/virtio/virtio-pci.c | 2 +- |
22 | 23 | hw/block/trace-events | 10 +++++----- | |
23 | Stefan Hajnoczi (3): | 24 | 3 files changed, 13 insertions(+), 11 deletions(-) |
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 | 25 | ||
38 | -- | 26 | -- |
39 | 2.9.3 | 27 | 2.9.4 |
40 | 28 | ||
41 | 29 | 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 |
1 | The (burst) max parameter cannot be smaller than the avg parameter. | 1 | It is hard to analyze trace logs with multiple virtio-blk devices |
---|---|---|---|
2 | There is a test case that uses avg = 56, max = 1 and gets away with it | 2 | because none of the trace events include the VirtIODevice *vdev. |
3 | because no input validation is performed by the test case. | ||
4 | 3 | ||
5 | This patch switches to valid test input parameters. | 4 | This patch adds vdev so it's clear which device a request is associated |
5 | with. | ||
6 | |||
7 | I considered using VirtIOBlock *s instead but VirtIODevice *vdev is more | ||
8 | general and may be correlated with generic virtio trace events like | ||
9 | virtio_set_status. | ||
6 | 10 | ||
7 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 11 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
8 | Reviewed-by: Alberto Garcia <berto@igalia.com> | 12 | Reviewed-by: Fam Zheng <famz@redhat.com> |
9 | Message-id: 20170301115026.22621-3-stefanha@redhat.com | 13 | Message-id: 20170614092930.11234-1-stefanha@redhat.com |
10 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 14 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
11 | --- | 15 | --- |
12 | tests/test-throttle.c | 8 ++++---- | 16 | hw/block/virtio-blk.c | 12 +++++++----- |
13 | 1 file changed, 4 insertions(+), 4 deletions(-) | 17 | hw/block/trace-events | 10 +++++----- |
18 | 2 files changed, 12 insertions(+), 10 deletions(-) | ||
14 | 19 | ||
15 | diff --git a/tests/test-throttle.c b/tests/test-throttle.c | 20 | diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c |
16 | index XXXXXXX..XXXXXXX 100644 | 21 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/tests/test-throttle.c | 22 | --- a/hw/block/virtio-blk.c |
18 | +++ b/tests/test-throttle.c | 23 | +++ b/hw/block/virtio-blk.c |
19 | @@ -XXX,XX +XXX,XX @@ static void test_config_functions(void) | 24 | @@ -XXX,XX +XXX,XX @@ static void virtio_blk_req_complete(VirtIOBlockReq *req, unsigned char status) |
20 | orig_cfg.buckets[THROTTLE_OPS_READ].avg = 69; | 25 | VirtIOBlock *s = req->dev; |
21 | orig_cfg.buckets[THROTTLE_OPS_WRITE].avg = 23; | 26 | VirtIODevice *vdev = VIRTIO_DEVICE(s); |
22 | 27 | ||
23 | - orig_cfg.buckets[THROTTLE_BPS_TOTAL].max = 0; /* should be corrected */ | 28 | - trace_virtio_blk_req_complete(req, status); |
24 | - orig_cfg.buckets[THROTTLE_BPS_READ].max = 1; /* should not be corrected */ | 29 | + trace_virtio_blk_req_complete(vdev, req, status); |
25 | + orig_cfg.buckets[THROTTLE_BPS_TOTAL].max = 0; /* should be corrected */ | 30 | |
26 | + orig_cfg.buckets[THROTTLE_BPS_READ].max = 56; /* should not be corrected */ | 31 | stb_p(&req->in->status, status); |
27 | orig_cfg.buckets[THROTTLE_BPS_WRITE].max = 120; | 32 | virtqueue_push(req->vq, &req->elem, req->in_len); |
28 | 33 | @@ -XXX,XX +XXX,XX @@ static void virtio_blk_rw_complete(void *opaque, int ret) | |
29 | orig_cfg.buckets[THROTTLE_OPS_TOTAL].max = 150; | 34 | { |
30 | @@ -XXX,XX +XXX,XX @@ static void test_config_functions(void) | 35 | VirtIOBlockReq *next = opaque; |
31 | g_assert(final_cfg.buckets[THROTTLE_OPS_READ].avg == 69); | 36 | VirtIOBlock *s = next->dev; |
32 | g_assert(final_cfg.buckets[THROTTLE_OPS_WRITE].avg == 23); | 37 | + VirtIODevice *vdev = VIRTIO_DEVICE(s); |
33 | 38 | ||
34 | - g_assert(final_cfg.buckets[THROTTLE_BPS_TOTAL].max == 15.3);/* fixed */ | 39 | aio_context_acquire(blk_get_aio_context(s->conf.conf.blk)); |
35 | - g_assert(final_cfg.buckets[THROTTLE_BPS_READ].max == 1); /* not fixed */ | 40 | while (next) { |
36 | + g_assert(final_cfg.buckets[THROTTLE_BPS_TOTAL].max == 15.3); /* fixed */ | 41 | VirtIOBlockReq *req = next; |
37 | + g_assert(final_cfg.buckets[THROTTLE_BPS_READ].max == 56); /* not fixed */ | 42 | next = req->mr_next; |
38 | g_assert(final_cfg.buckets[THROTTLE_BPS_WRITE].max == 120); | 43 | - trace_virtio_blk_rw_complete(req, ret); |
39 | 44 | + trace_virtio_blk_rw_complete(vdev, req, ret); | |
40 | g_assert(final_cfg.buckets[THROTTLE_OPS_TOTAL].max == 150); | 45 | |
46 | if (req->qiov.nalloc != -1) { | ||
47 | /* If nalloc is != 1 req->qiov is a local copy of the original | ||
48 | @@ -XXX,XX +XXX,XX @@ static inline void submit_requests(BlockBackend *blk, MultiReqBuffer *mrb, | ||
49 | mrb->reqs[i - 1]->mr_next = mrb->reqs[i]; | ||
50 | } | ||
51 | |||
52 | - trace_virtio_blk_submit_multireq(mrb, start, num_reqs, | ||
53 | + trace_virtio_blk_submit_multireq(VIRTIO_DEVICE(mrb->reqs[start]->dev), | ||
54 | + mrb, start, num_reqs, | ||
55 | sector_num << BDRV_SECTOR_BITS, | ||
56 | qiov->size, is_write); | ||
57 | block_acct_merge_done(blk_get_stats(blk), | ||
58 | @@ -XXX,XX +XXX,XX @@ static int virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb) | ||
59 | |||
60 | if (is_write) { | ||
61 | qemu_iovec_init_external(&req->qiov, iov, out_num); | ||
62 | - trace_virtio_blk_handle_write(req, req->sector_num, | ||
63 | + trace_virtio_blk_handle_write(vdev, req, req->sector_num, | ||
64 | req->qiov.size / BDRV_SECTOR_SIZE); | ||
65 | } else { | ||
66 | qemu_iovec_init_external(&req->qiov, in_iov, in_num); | ||
67 | - trace_virtio_blk_handle_read(req, req->sector_num, | ||
68 | + trace_virtio_blk_handle_read(vdev, req, req->sector_num, | ||
69 | req->qiov.size / BDRV_SECTOR_SIZE); | ||
70 | } | ||
71 | |||
72 | diff --git a/hw/block/trace-events b/hw/block/trace-events | ||
73 | index XXXXXXX..XXXXXXX 100644 | ||
74 | --- a/hw/block/trace-events | ||
75 | +++ b/hw/block/trace-events | ||
76 | @@ -XXX,XX +XXX,XX @@ | ||
77 | # See docs/tracing.txt for syntax documentation. | ||
78 | |||
79 | # hw/block/virtio-blk.c | ||
80 | -virtio_blk_req_complete(void *req, int status) "req %p status %d" | ||
81 | -virtio_blk_rw_complete(void *req, int ret) "req %p ret %d" | ||
82 | -virtio_blk_handle_write(void *req, uint64_t sector, size_t nsectors) "req %p sector %"PRIu64" nsectors %zu" | ||
83 | -virtio_blk_handle_read(void *req, uint64_t sector, size_t nsectors) "req %p sector %"PRIu64" nsectors %zu" | ||
84 | -virtio_blk_submit_multireq(void *mrb, int start, int num_reqs, uint64_t offset, size_t size, bool is_write) "mrb %p start %d num_reqs %d offset %"PRIu64" size %zu is_write %d" | ||
85 | +virtio_blk_req_complete(void *vdev, void *req, int status) "vdev %p req %p status %d" | ||
86 | +virtio_blk_rw_complete(void *vdev, void *req, int ret) "vdev %p req %p ret %d" | ||
87 | +virtio_blk_handle_write(void *vdev, void *req, uint64_t sector, size_t nsectors) "vdev %p req %p sector %"PRIu64" nsectors %zu" | ||
88 | +virtio_blk_handle_read(void *vdev, void *req, uint64_t sector, size_t nsectors) "vdev %p req %p sector %"PRIu64" nsectors %zu" | ||
89 | +virtio_blk_submit_multireq(void *vdev, void *mrb, int start, int num_reqs, uint64_t offset, size_t size, bool is_write) "vdev %p mrb %p start %d num_reqs %d offset %"PRIu64" size %zu is_write %d" | ||
90 | |||
91 | # hw/block/hd-geometry.c | ||
92 | hd_geometry_lchs_guess(void *blk, int cyls, int heads, int secs) "blk %p LCHS %d %d %d" | ||
41 | -- | 93 | -- |
42 | 2.9.3 | 94 | 2.9.4 |
43 | 95 | ||
44 | 96 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | Throttling has a weird property that throttle_get_config() does not | ||
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 | 1 | ||
6 | If .max is 0 then the throttling code assigns a default value of .avg / | ||
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 | |||
11 | Users are exposed to this quirk via "info block" or "query-block" | ||
12 | monitor commands. This has caused confusion because it looks like a bug | ||
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> | ||
23 | --- | ||
24 | tests/test-throttle.c | 8 ++++---- | ||
25 | util/throttle.c | 14 ++++++++++++++ | ||
26 | 2 files changed, 18 insertions(+), 4 deletions(-) | ||
27 | |||
28 | diff --git a/tests/test-throttle.c b/tests/test-throttle.c | ||
29 | index XXXXXXX..XXXXXXX 100644 | ||
30 | --- a/tests/test-throttle.c | ||
31 | +++ b/tests/test-throttle.c | ||
32 | @@ -XXX,XX +XXX,XX @@ static void test_config_functions(void) | ||
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 | } | ||
61 | |||
62 | +/* undo internal bucket parameter changes (see throttle_fix_bucket()) */ | ||
63 | +static void throttle_unfix_bucket(LeakyBucket *bkt) | ||
64 | +{ | ||
65 | + if (bkt->max < bkt->avg) { | ||
66 | + bkt->max = 0; | ||
67 | + } | ||
68 | +} | ||
69 | + | ||
70 | /* take care of canceling a timer */ | ||
71 | static void throttle_cancel_timer(QEMUTimer *timer) | ||
72 | { | ||
73 | @@ -XXX,XX +XXX,XX @@ void throttle_config(ThrottleState *ts, | ||
74 | */ | ||
75 | void throttle_get_config(ThrottleState *ts, ThrottleConfig *cfg) | ||
76 | { | ||
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 | } | ||
85 | |||
86 | |||
87 | -- | ||
88 | 2.9.3 | ||
89 | |||
90 | 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 |
1 | From: Zhang Chen <zhangchen.fnst@cn.fujitsu.com> | 1 | Old kvm.ko versions only supported a tiny number of ioeventfds so |
---|---|---|---|
2 | virtio-pci avoids ioeventfds when kvm_has_many_ioeventfds() returns 0. | ||
2 | 3 | ||
3 | I'm leaving my job at Fujitsu, this email address will stop working | 4 | Do not check kvm_has_many_ioeventfds() when KVM is disabled since it |
4 | this week. Update it to one that I will have access to later. | 5 | always returns 0. Since commit 8c56c1a592b5092d91da8d8943c17777d6462a6f |
6 | ("memory: emulate ioeventfd") it has been possible to use ioeventfds in | ||
7 | qtest or TCG mode. | ||
5 | 8 | ||
6 | Signed-off-by: Xie Changlong <xiecl.fnst@cn.fujitsu.com> | 9 | This patch makes -device virtio-blk-pci,iothread=iothread0 work even |
7 | Message-id: 1492758767-19716-1-git-send-email-xiecl.fnst@cn.fujitsu.com | 10 | when KVM is disabled. |
11 | |||
12 | I have tested that virtio-blk-pci works under TCG both with and without | ||
13 | iothread. | ||
14 | |||
15 | This patch fixes qemu-iotests 068, which was accidentally merged early | ||
16 | despite the dependency on ioeventfd. | ||
17 | |||
18 | Cc: Michael S. Tsirkin <mst@redhat.com> | ||
19 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
20 | Reviewed-by: Michael S. Tsirkin <mst@redhat.com> | ||
21 | Message-id: 20170615163813.7255-2-stefanha@redhat.com | ||
8 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 22 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
9 | --- | 23 | --- |
10 | MAINTAINERS | 2 +- | 24 | hw/virtio/virtio-pci.c | 2 +- |
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | 25 | 1 file changed, 1 insertion(+), 1 deletion(-) |
12 | 26 | ||
13 | diff --git a/MAINTAINERS b/MAINTAINERS | 27 | diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c |
14 | index XXXXXXX..XXXXXXX 100644 | 28 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/MAINTAINERS | 29 | --- a/hw/virtio/virtio-pci.c |
16 | +++ b/MAINTAINERS | 30 | +++ b/hw/virtio/virtio-pci.c |
17 | @@ -XXX,XX +XXX,XX @@ F: tests/image-fuzzer/ | 31 | @@ -XXX,XX +XXX,XX @@ static void virtio_pci_realize(PCIDevice *pci_dev, Error **errp) |
18 | 32 | bool pcie_port = pci_bus_is_express(pci_dev->bus) && | |
19 | Replication | 33 | !pci_bus_is_root(pci_dev->bus); |
20 | M: Wen Congyang <wencongyang2@huawei.com> | 34 | |
21 | -M: Changlong Xie <xiecl.fnst@cn.fujitsu.com> | 35 | - if (!kvm_has_many_ioeventfds()) { |
22 | +M: Xie Changlong <xiechanglong.d@gmail.com> | 36 | + if (kvm_enabled() && !kvm_has_many_ioeventfds()) { |
23 | S: Supported | 37 | proxy->flags &= ~VIRTIO_PCI_FLAG_USE_IOEVENTFD; |
24 | F: replication* | 38 | } |
25 | F: block/replication.c | 39 | |
26 | -- | 40 | -- |
27 | 2.9.3 | 41 | 2.9.4 |
28 | 42 | ||
29 | 43 | diff view generated by jsdifflib |