qemu-kvm: Fix test for I/O thread
PATCH 1/1 qemu-kvm: Fix test for I/O thread
Looks to me like this was rather intended. But given that 4e8b8a6d92c5ece048e65be3a3980d24f065b32b claims to actually fix a bug in its original broken form, please have a careful look.
qemu/qemu-kvm.c +1 -1
@@ -89,7 +89,7 @@ static void qemu_cond_wait(pthread_cond_t *cond)pthread_cond_timedwait (cond, &qemu_mutex, &ts);/* If we're the I/O thread, some other thread may be waiting for aio * completion */ -if (!vcpu_info) +if (!env)qemu_aio_poll (); cpu_single_env = env; }
Quoted 11 lines · Jan Kiszka
Looks to me like this was rather intended. But given that
4e8b8a6d92c5ece048e65be3a3980d24f065b32bclaims to actually fix a bug in its original broken form, please have a careful look.Signed-off-by Jan Kiszka <[email protected]>qemu/qemu-kvm.c +0
-0
qemu/qemu-kvm.c static void qemu_cond_wait(pthread_cond_t *cond) · line 95
Quoted 8 lines
qemu/qemu-kvm.c +1
-1@@ -89,7 +89,7 @@ static void qemu_cond_wait(pthread_cond_t *cond)pthread_cond_timedwait (cond, &qemu_mutex, &ts);/* If we're the I/O thread, some other thread may be waiting for aio * completion */ -if (!vcpu_info) +if (!env)qemu_aio_poll (); cpu_single_env = env; }
Aren't the two lines equivalent? vcpu_info is a thread-local-storage variable, and is unset for the iothread.
Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.
Quoted 16 lines · Avi Kivity
Quoted 15 lines · Jan Kiszka
Looks to me like this was rather intended. But given that
4e8b8a6d92c5ece048e65be3a3980d24f065b32bclaims to actually fix a bug in its original broken form, please have a careful look.Signed-off-by Jan Kiszka <[email protected]>qemu/qemu-kvm.c +0
-1@@ -89,7 +89,7 @@ static void qemu_cond_wait(pthread_cond_t *cond)pthread_cond_timedwait (cond, &qemu_mutex, &ts);/* If we're the I/O thread, some other thread may be waiting for aio * completion */ -if (!vcpu_info)
Quoted 9 lines
qemu/qemu-kvm.c static void qemu_cond_wait(pthread_cond_t *cond) · line 95
Quoted 5 lines
qemu/qemu-kvm.c +1
-0+if (!env)qemu_aio_poll (); cpu_single_env = env; }Aren't the two lines equivalent?
vcpu_infois a thread-local-storage variable, and is unset for the iothread.
Then you probably wanted to type 'vcpu', don't you? :)
However, I would stick with what the function already uses, ie. 'env'.
Jan
Quoted 30 lines · Jan Kiszka
Quoted 17 lines · Avi Kivity
Quoted 15 lines · Jan Kiszka
Looks to me like this was rather intended. But given that
4e8b8a6d92c5ece048e65be3a3980d24f065b32bclaims to actually fix a bug in its original broken form, please have a careful look.Signed-off-by Jan Kiszka <[email protected]>qemu/qemu-kvm.c +0
-1@@ -89,7 +89,7 @@ static void qemu_cond_wait(pthread_cond_t *cond)pthread_cond_timedwait (cond, &qemu_mutex, &ts);/* If we're the I/O thread, some other thread may be waiting for aio * completion */ -if (!vcpu_info)Quoted 10 lines
qemu/qemu-kvm.c static void qemu_cond_wait(pthread_cond_t *cond) · line 95
Quoted 6 lines
qemu/qemu-kvm.c +1
-0+if (!env)qemu_aio_poll (); cpu_single_env = env; }Aren't the two lines equivalent?
vcpu_infois a thread-local-storage variable, and is unset for the iothread.
Quoted 3 lines
Then you probably wanted to type 'vcpu', don't you? :)
Doh.
Quoted 2 lines
However, I would stick with what the function already uses, ie. 'env'.
env might be null even in a non-aio-thread (during initialization, perhaps?). I changed it to be vcpu since that's a stronger indicator.
Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.