1
The following changes since commit 6cb4f6db4f4367faa33da85b15f75bbbd2bed2a6:
1
The following changes since commit 41192db338588051f21501abc13743e62b0a5605:
2
2
3
Merge remote-tracking branch 'remotes/cleber/tags/python-next-pull-request' into staging (2019-03-07 16:16:02 +0000)
3
Merge remote-tracking branch 'remotes/ehabkost-gl/tags/machine-next-pull-request' into staging (2021-01-01 22:57:15 +0000)
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://gitlab.com/stefanha/qemu.git tags/block-pull-request
8
8
9
for you to fetch changes up to 6ca206204fa773c8626d59caf2a5676d6cc35f52:
9
for you to fetch changes up to 593621f36b716eb091c4ec791db72dd4461789da:
10
10
11
iothread: document about why we need explicit aio_poll() (2019-03-08 10:20:57 +0000)
11
readline: Fix possible array index out of bounds in readline_hist_add() (2021-01-04 11:13:39 +0000)
12
12
13
----------------------------------------------------------------
13
----------------------------------------------------------------
14
Pull request
14
Pull request
15
15
16
----------------------------------------------------------------
16
----------------------------------------------------------------
17
17
18
Anastasiia Rusakova (1):
18
Alex Chen (1):
19
hw/block/virtio-blk: Clean req->dev repetitions
19
readline: Fix possible array index out of bounds in
20
readline_hist_add()
20
21
21
Peter Xu (5):
22
util/readline.c | 3 +++
22
iothread: replace init_done_cond with a semaphore
23
1 file changed, 3 insertions(+)
23
iothread: create the gcontext unconditionally
24
iothread: create main loop unconditionally
25
iothread: push gcontext earlier in the thread_fn
26
iothread: document about why we need explicit aio_poll()
27
28
Stefan Hajnoczi (1):
29
MAINTAINERS: add missing support status fields
30
31
MAINTAINERS | 3 ++
32
include/sysemu/iothread.h | 5 +--
33
hw/block/virtio-blk.c | 16 ++++---
34
iothread.c | 90 +++++++++++++++++++--------------------
35
4 files changed, 57 insertions(+), 57 deletions(-)
36
24
37
--
25
--
38
2.20.1
26
2.29.2
39
27
40
diff view generated by jsdifflib
1
This patch adds the "S:" line for areas of the codebase that currently
1
From: Alex Chen <alex.chen@huawei.com>
2
lack a support status field.
3
2
4
Note that there are a few more areas that are more abstract and do not
3
When the 'cmdline' is the last entry in 'rs->history' array, there is
5
correspond to a specific set of files. They have not been modified.
4
no need to put this entry to the end of the array, partly because it is
5
the last entry, and partly because the next operition will lead to array
6
index out of bounds.
6
7
7
Cc: Alex Bennée <alex.bennee@linaro.org>
8
Reported-by: Euler Robot <euler.robot@huawei.com>
8
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9
Signed-off-by: Alex Chen <alex.chen@huawei.com>
9
Reviewed-by: Thomas Huth <thuth@redhat.com>
10
Message-id: 20201203135043.117072-1-alex.chen@huawei.com
10
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
11
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
12
Message-id: 20190301163518.20702-1-stefanha@redhat.com
13
Message-Id: <20190301163518.20702-1-stefanha@redhat.com>
14
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
15
---
12
---
16
MAINTAINERS | 3 +++
13
util/readline.c | 3 +++
17
1 file changed, 3 insertions(+)
14
1 file changed, 3 insertions(+)
18
15
19
diff --git a/MAINTAINERS b/MAINTAINERS
16
diff --git a/util/readline.c b/util/readline.c
20
index XXXXXXX..XXXXXXX 100644
17
index XXXXXXX..XXXXXXX 100644
21
--- a/MAINTAINERS
18
--- a/util/readline.c
22
+++ b/MAINTAINERS
19
+++ b/util/readline.c
23
@@ -XXX,XX +XXX,XX @@ F: include/hw/tricore/
20
@@ -XXX,XX +XXX,XX @@ static void readline_hist_add(ReadLineState *rs, const char *cmdline)
24
21
}
25
Multiarch Linux User Tests
22
if (strcmp(hist_entry, cmdline) == 0) {
26
M: Alex Bennée <alex.bennee@linaro.org>
23
same_entry:
27
+S: Maintained
24
+ if (idx == READLINE_MAX_CMDS - 1) {
28
F: tests/tcg/multiarch/
25
+ return;
29
26
+ }
30
Guest CPU Cores (KVM):
27
new_entry = hist_entry;
31
@@ -XXX,XX +XXX,XX @@ F: qemu.sasl
28
/* Put this entry at the end of history */
32
Coroutines
29
memmove(&rs->history[idx], &rs->history[idx + 1],
33
M: Stefan Hajnoczi <stefanha@redhat.com>
34
M: Kevin Wolf <kwolf@redhat.com>
35
+S: Maintained
36
F: util/*coroutine*
37
F: include/qemu/coroutine*
38
F: tests/test-coroutine.c
39
@@ -XXX,XX +XXX,XX @@ F: .gitlab-ci.yml
40
Guest Test Compilation Support
41
M: Alex Bennée <alex.bennee@linaro.org>
42
R: Philippe Mathieu-Daudé <f4bug@amsat.org>
43
+S: Maintained
44
F: tests/tcg/Makefile
45
F: tests/tcg/Makefile.include
46
L: qemu-devel@nongnu.org
47
--
30
--
48
2.20.1
31
2.29.2
49
32
50
diff view generated by jsdifflib
Deleted patch
1
From: Anastasiia Rusakova <arusakova917@gmail.com>
2
1
3
Some functions sometimes uses req->dev even though a local variable
4
VirtIOBlock* s = req->dev has already been defined.
5
Updated places to use s everywhere in the file.
6
7
Signed-off-by: Anastasiia Rusakova <arusakova917@gmail.com>
8
Message-id: 20190307161925.4158-1-rusakova.nastasia@icloud.com
9
Message-Id: <20190307161925.4158-1-rusakova.nastasia@icloud.com>
10
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11
---
12
hw/block/virtio-blk.c | 16 +++++++++-------
13
1 file changed, 9 insertions(+), 7 deletions(-)
14
15
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
16
index XXXXXXX..XXXXXXX 100644
17
--- a/hw/block/virtio-blk.c
18
+++ b/hw/block/virtio-blk.c
19
@@ -XXX,XX +XXX,XX @@ static void virtio_blk_rw_complete(void *opaque, int ret)
20
}
21
22
if (ret) {
23
- int p = virtio_ldl_p(VIRTIO_DEVICE(req->dev), &req->out.type);
24
+ int p = virtio_ldl_p(VIRTIO_DEVICE(s), &req->out.type);
25
bool is_read = !(p & VIRTIO_BLK_T_OUT);
26
/* Note that memory may be dirtied on read failure. If the
27
* virtio request is not completed here, as is the case for
28
@@ -XXX,XX +XXX,XX @@ static void virtio_blk_rw_complete(void *opaque, int ret)
29
}
30
31
virtio_blk_req_complete(req, VIRTIO_BLK_S_OK);
32
- block_acct_done(blk_get_stats(req->dev->blk), &req->acct);
33
+ block_acct_done(blk_get_stats(s->blk), &req->acct);
34
virtio_blk_free_request(req);
35
}
36
aio_context_release(blk_get_aio_context(s->conf.conf.blk));
37
@@ -XXX,XX +XXX,XX @@ static int virtio_blk_handle_scsi_req(VirtIOBlockReq *req)
38
{
39
int status = VIRTIO_BLK_S_OK;
40
struct virtio_scsi_inhdr *scsi = NULL;
41
- VirtIODevice *vdev = VIRTIO_DEVICE(req->dev);
42
- VirtQueueElement *elem = &req->elem;
43
VirtIOBlock *blk = req->dev;
44
+ VirtIODevice *vdev = VIRTIO_DEVICE(blk);
45
+ VirtQueueElement *elem = &req->elem;
46
47
#ifdef __linux__
48
int i;
49
@@ -XXX,XX +XXX,XX @@ static void virtio_blk_submit_multireq(BlockBackend *blk, MultiReqBuffer *mrb)
50
51
static void virtio_blk_handle_flush(VirtIOBlockReq *req, MultiReqBuffer *mrb)
52
{
53
- block_acct_start(blk_get_stats(req->dev->blk), &req->acct, 0,
54
+ VirtIOBlock *s = req->dev;
55
+
56
+ block_acct_start(blk_get_stats(s->blk), &req->acct, 0,
57
BLOCK_ACCT_FLUSH);
58
59
/*
60
* Make sure all outstanding writes are posted to the backing device.
61
*/
62
if (mrb->is_write && mrb->num_reqs > 0) {
63
- virtio_blk_submit_multireq(req->dev->blk, mrb);
64
+ virtio_blk_submit_multireq(s->blk, mrb);
65
}
66
- blk_aio_flush(req->dev->blk, virtio_blk_flush_complete, req);
67
+ blk_aio_flush(s->blk, virtio_blk_flush_complete, req);
68
}
69
70
static bool virtio_blk_sect_range_ok(VirtIOBlock *dev,
71
--
72
2.20.1
73
74
diff view generated by jsdifflib
Deleted patch
1
From: Peter Xu <peterx@redhat.com>
2
1
3
Only sending an init-done message using lock+cond seems an overkill to
4
me. Replacing it with a simpler semaphore.
5
6
Meanwhile, init the semaphore unconditionally, then we can destroy it
7
unconditionally too in finalize which seems cleaner.
8
9
Signed-off-by: Peter Xu <peterx@redhat.com>
10
Message-id: 20190306115532.23025-2-peterx@redhat.com
11
Message-Id: <20190306115532.23025-2-peterx@redhat.com>
12
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
13
---
14
include/sysemu/iothread.h | 3 +--
15
iothread.c | 17 ++++-------------
16
2 files changed, 5 insertions(+), 15 deletions(-)
17
18
diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h
19
index XXXXXXX..XXXXXXX 100644
20
--- a/include/sysemu/iothread.h
21
+++ b/include/sysemu/iothread.h
22
@@ -XXX,XX +XXX,XX @@ typedef struct {
23
GMainContext *worker_context;
24
GMainLoop *main_loop;
25
GOnce once;
26
- QemuMutex init_done_lock;
27
- QemuCond init_done_cond; /* is thread initialization done? */
28
+ QemuSemaphore init_done_sem; /* is thread init done? */
29
bool stopping; /* has iothread_stop() been called? */
30
bool running; /* should iothread_run() continue? */
31
int thread_id;
32
diff --git a/iothread.c b/iothread.c
33
index XXXXXXX..XXXXXXX 100644
34
--- a/iothread.c
35
+++ b/iothread.c
36
@@ -XXX,XX +XXX,XX @@ static void *iothread_run(void *opaque)
37
rcu_register_thread();
38
39
my_iothread = iothread;
40
- qemu_mutex_lock(&iothread->init_done_lock);
41
iothread->thread_id = qemu_get_thread_id();
42
- qemu_cond_signal(&iothread->init_done_cond);
43
- qemu_mutex_unlock(&iothread->init_done_lock);
44
+ qemu_sem_post(&iothread->init_done_sem);
45
46
while (iothread->running) {
47
aio_poll(iothread->ctx, true);
48
@@ -XXX,XX +XXX,XX @@ static void iothread_instance_init(Object *obj)
49
50
iothread->poll_max_ns = IOTHREAD_POLL_MAX_NS_DEFAULT;
51
iothread->thread_id = -1;
52
+ qemu_sem_init(&iothread->init_done_sem, 0);
53
}
54
55
static void iothread_instance_finalize(Object *obj)
56
@@ -XXX,XX +XXX,XX @@ static void iothread_instance_finalize(Object *obj)
57
58
iothread_stop(iothread);
59
60
- if (iothread->thread_id != -1) {
61
- qemu_cond_destroy(&iothread->init_done_cond);
62
- qemu_mutex_destroy(&iothread->init_done_lock);
63
- }
64
/*
65
* Before glib2 2.33.10, there is a glib2 bug that GSource context
66
* pointer may not be cleared even if the context has already been
67
@@ -XXX,XX +XXX,XX @@ static void iothread_instance_finalize(Object *obj)
68
g_main_context_unref(iothread->worker_context);
69
iothread->worker_context = NULL;
70
}
71
+ qemu_sem_destroy(&iothread->init_done_sem);
72
}
73
74
static void iothread_complete(UserCreatable *obj, Error **errp)
75
@@ -XXX,XX +XXX,XX @@ static void iothread_complete(UserCreatable *obj, Error **errp)
76
return;
77
}
78
79
- qemu_mutex_init(&iothread->init_done_lock);
80
- qemu_cond_init(&iothread->init_done_cond);
81
iothread->once = (GOnce) G_ONCE_INIT;
82
83
/* This assumes we are called from a thread with useful CPU affinity for us
84
@@ -XXX,XX +XXX,XX @@ static void iothread_complete(UserCreatable *obj, Error **errp)
85
g_free(name);
86
87
/* Wait for initialization to complete */
88
- qemu_mutex_lock(&iothread->init_done_lock);
89
while (iothread->thread_id == -1) {
90
- qemu_cond_wait(&iothread->init_done_cond,
91
- &iothread->init_done_lock);
92
+ qemu_sem_wait(&iothread->init_done_sem);
93
}
94
- qemu_mutex_unlock(&iothread->init_done_lock);
95
}
96
97
typedef struct {
98
--
99
2.20.1
100
101
diff view generated by jsdifflib
Deleted patch
1
From: Peter Xu <peterx@redhat.com>
2
1
3
In existing code we create the gcontext dynamically at the first
4
access of the gcontext from caller. That can bring some complexity
5
and potential races during using iothread. Since the context itself
6
is not that big a resource, and we won't have millions of iothread,
7
let's simply create the gcontext unconditionally.
8
9
This will also be a preparation work further to move the thread
10
context push operation earlier than before (now it's only pushed right
11
before we want to start running the gmainloop).
12
13
Removing the g_once since it's not necessary, while introducing a new
14
run_gcontext boolean to show whether we want to run the gcontext.
15
16
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
17
Signed-off-by: Peter Xu <peterx@redhat.com>
18
Message-id: 20190306115532.23025-3-peterx@redhat.com
19
Message-Id: <20190306115532.23025-3-peterx@redhat.com>
20
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
21
---
22
include/sysemu/iothread.h | 2 +-
23
iothread.c | 43 +++++++++++++++++++--------------------
24
2 files changed, 22 insertions(+), 23 deletions(-)
25
26
diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h
27
index XXXXXXX..XXXXXXX 100644
28
--- a/include/sysemu/iothread.h
29
+++ b/include/sysemu/iothread.h
30
@@ -XXX,XX +XXX,XX @@ typedef struct {
31
32
QemuThread thread;
33
AioContext *ctx;
34
+ bool run_gcontext; /* whether we should run gcontext */
35
GMainContext *worker_context;
36
GMainLoop *main_loop;
37
- GOnce once;
38
QemuSemaphore init_done_sem; /* is thread init done? */
39
bool stopping; /* has iothread_stop() been called? */
40
bool running; /* should iothread_run() continue? */
41
diff --git a/iothread.c b/iothread.c
42
index XXXXXXX..XXXXXXX 100644
43
--- a/iothread.c
44
+++ b/iothread.c
45
@@ -XXX,XX +XXX,XX @@ static void *iothread_run(void *opaque)
46
* We must check the running state again in case it was
47
* changed in previous aio_poll()
48
*/
49
- if (iothread->running && atomic_read(&iothread->worker_context)) {
50
+ if (iothread->running && atomic_read(&iothread->run_gcontext)) {
51
GMainLoop *loop;
52
53
g_main_context_push_thread_default(iothread->worker_context);
54
@@ -XXX,XX +XXX,XX @@ static void iothread_instance_init(Object *obj)
55
iothread->poll_max_ns = IOTHREAD_POLL_MAX_NS_DEFAULT;
56
iothread->thread_id = -1;
57
qemu_sem_init(&iothread->init_done_sem, 0);
58
+ /* By default, we don't run gcontext */
59
+ atomic_set(&iothread->run_gcontext, 0);
60
}
61
62
static void iothread_instance_finalize(Object *obj)
63
@@ -XXX,XX +XXX,XX @@ static void iothread_instance_finalize(Object *obj)
64
qemu_sem_destroy(&iothread->init_done_sem);
65
}
66
67
+static void iothread_init_gcontext(IOThread *iothread)
68
+{
69
+ GSource *source;
70
+
71
+ iothread->worker_context = g_main_context_new();
72
+ source = aio_get_g_source(iothread_get_aio_context(iothread));
73
+ g_source_attach(source, iothread->worker_context);
74
+ g_source_unref(source);
75
+}
76
+
77
static void iothread_complete(UserCreatable *obj, Error **errp)
78
{
79
Error *local_error = NULL;
80
@@ -XXX,XX +XXX,XX @@ static void iothread_complete(UserCreatable *obj, Error **errp)
81
return;
82
}
83
84
+ /*
85
+ * Init one GMainContext for the iothread unconditionally, even if
86
+ * it's not used
87
+ */
88
+ iothread_init_gcontext(iothread);
89
+
90
aio_context_set_poll_params(iothread->ctx,
91
iothread->poll_max_ns,
92
iothread->poll_grow,
93
@@ -XXX,XX +XXX,XX @@ static void iothread_complete(UserCreatable *obj, Error **errp)
94
return;
95
}
96
97
- iothread->once = (GOnce) G_ONCE_INIT;
98
-
99
/* This assumes we are called from a thread with useful CPU affinity for us
100
* to inherit.
101
*/
102
@@ -XXX,XX +XXX,XX @@ IOThreadInfoList *qmp_query_iothreads(Error **errp)
103
return head;
104
}
105
106
-static gpointer iothread_g_main_context_init(gpointer opaque)
107
-{
108
- AioContext *ctx;
109
- IOThread *iothread = opaque;
110
- GSource *source;
111
-
112
- iothread->worker_context = g_main_context_new();
113
-
114
- ctx = iothread_get_aio_context(iothread);
115
- source = aio_get_g_source(ctx);
116
- g_source_attach(source, iothread->worker_context);
117
- g_source_unref(source);
118
-
119
- aio_notify(iothread->ctx);
120
- return NULL;
121
-}
122
-
123
GMainContext *iothread_get_g_main_context(IOThread *iothread)
124
{
125
- g_once(&iothread->once, iothread_g_main_context_init, iothread);
126
-
127
+ atomic_set(&iothread->run_gcontext, 1);
128
+ aio_notify(iothread->ctx);
129
return iothread->worker_context;
130
}
131
132
--
133
2.20.1
134
135
diff view generated by jsdifflib
Deleted patch
1
From: Peter Xu <peterx@redhat.com>
2
1
3
Since we've have the gcontext always there, create the main loop
4
altogether. The iothread_run() is even cleaner.
5
6
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7
Signed-off-by: Peter Xu <peterx@redhat.com>
8
Message-id: 20190306115532.23025-4-peterx@redhat.com
9
Message-Id: <20190306115532.23025-4-peterx@redhat.com>
10
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11
---
12
iothread.c | 12 +++---------
13
1 file changed, 3 insertions(+), 9 deletions(-)
14
15
diff --git a/iothread.c b/iothread.c
16
index XXXXXXX..XXXXXXX 100644
17
--- a/iothread.c
18
+++ b/iothread.c
19
@@ -XXX,XX +XXX,XX @@ static void *iothread_run(void *opaque)
20
* changed in previous aio_poll()
21
*/
22
if (iothread->running && atomic_read(&iothread->run_gcontext)) {
23
- GMainLoop *loop;
24
-
25
g_main_context_push_thread_default(iothread->worker_context);
26
- iothread->main_loop =
27
- g_main_loop_new(iothread->worker_context, TRUE);
28
- loop = iothread->main_loop;
29
-
30
g_main_loop_run(iothread->main_loop);
31
- iothread->main_loop = NULL;
32
- g_main_loop_unref(loop);
33
-
34
g_main_context_pop_thread_default(iothread->worker_context);
35
}
36
}
37
@@ -XXX,XX +XXX,XX @@ static void iothread_instance_finalize(Object *obj)
38
if (iothread->worker_context) {
39
g_main_context_unref(iothread->worker_context);
40
iothread->worker_context = NULL;
41
+ g_main_loop_unref(iothread->main_loop);
42
+ iothread->main_loop = NULL;
43
}
44
qemu_sem_destroy(&iothread->init_done_sem);
45
}
46
@@ -XXX,XX +XXX,XX @@ static void iothread_init_gcontext(IOThread *iothread)
47
source = aio_get_g_source(iothread_get_aio_context(iothread));
48
g_source_attach(source, iothread->worker_context);
49
g_source_unref(source);
50
+ iothread->main_loop = g_main_loop_new(iothread->worker_context, TRUE);
51
}
52
53
static void iothread_complete(UserCreatable *obj, Error **errp)
54
--
55
2.20.1
56
57
diff view generated by jsdifflib
Deleted patch
1
From: Peter Xu <peterx@redhat.com>
2
1
3
We were pushing the context until right before running the gmainloop.
4
Now since we have everything unconditionally, we can move this
5
earlier.
6
7
One benefit is that now it's done even before init_done_sem, so as
8
long as the iothread user calls iothread_create() and completes, we
9
know that the thread stack is ready.
10
11
Signed-off-by: Peter Xu <peterx@redhat.com>
12
Message-id: 20190306115532.23025-5-peterx@redhat.com
13
Message-Id: <20190306115532.23025-5-peterx@redhat.com>
14
15
[Tweaked comment wording as discussed with Peter Xu.
16
--Stefan]
17
18
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
19
---
20
iothread.c | 9 ++++++---
21
1 file changed, 6 insertions(+), 3 deletions(-)
22
23
diff --git a/iothread.c b/iothread.c
24
index XXXXXXX..XXXXXXX 100644
25
--- a/iothread.c
26
+++ b/iothread.c
27
@@ -XXX,XX +XXX,XX @@ static void *iothread_run(void *opaque)
28
IOThread *iothread = opaque;
29
30
rcu_register_thread();
31
-
32
+ /*
33
+ * g_main_context_push_thread_default() must be called before anything
34
+ * in this new thread uses glib.
35
+ */
36
+ g_main_context_push_thread_default(iothread->worker_context);
37
my_iothread = iothread;
38
iothread->thread_id = qemu_get_thread_id();
39
qemu_sem_post(&iothread->init_done_sem);
40
@@ -XXX,XX +XXX,XX @@ static void *iothread_run(void *opaque)
41
* changed in previous aio_poll()
42
*/
43
if (iothread->running && atomic_read(&iothread->run_gcontext)) {
44
- g_main_context_push_thread_default(iothread->worker_context);
45
g_main_loop_run(iothread->main_loop);
46
- g_main_context_pop_thread_default(iothread->worker_context);
47
}
48
}
49
50
+ g_main_context_pop_thread_default(iothread->worker_context);
51
rcu_unregister_thread();
52
return NULL;
53
}
54
--
55
2.20.1
56
57
diff view generated by jsdifflib
Deleted patch
1
From: Peter Xu <peterx@redhat.com>
2
1
3
After consulting Paolo I know why we'd better keep the explicit
4
aio_poll() in iothread_run(). Document it directly into the code so
5
that future readers will know the answer from day one.
6
7
Signed-off-by: Peter Xu <peterx@redhat.com>
8
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
9
Message-id: 20190306115532.23025-6-peterx@redhat.com
10
Message-Id: <20190306115532.23025-6-peterx@redhat.com>
11
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
12
---
13
iothread.c | 9 +++++++++
14
1 file changed, 9 insertions(+)
15
16
diff --git a/iothread.c b/iothread.c
17
index XXXXXXX..XXXXXXX 100644
18
--- a/iothread.c
19
+++ b/iothread.c
20
@@ -XXX,XX +XXX,XX @@ static void *iothread_run(void *opaque)
21
qemu_sem_post(&iothread->init_done_sem);
22
23
while (iothread->running) {
24
+ /*
25
+ * Note: from functional-wise the g_main_loop_run() below can
26
+ * already cover the aio_poll() events, but we can't run the
27
+ * main loop unconditionally because explicit aio_poll() here
28
+ * is faster than g_main_loop_run() when we do not need the
29
+ * gcontext at all (e.g., pure block layer iothreads). In
30
+ * other words, when we want to run the gcontext with the
31
+ * iothread we need to pay some performance for functionality.
32
+ */
33
aio_poll(iothread->ctx, true);
34
35
/*
36
--
37
2.20.1
38
39
diff view generated by jsdifflib