[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/6] qtest: fix vhost-user-test unbalanced mutex loc
From: |
Nikolay Nikolaev |
Subject: |
[Qemu-devel] [PATCH 4/6] qtest: fix vhost-user-test unbalanced mutex locks |
Date: |
Thu, 19 Jun 2014 18:08:18 +0300 |
User-agent: |
StGit/0.17.1-dirty |
Signed-off-by: Nikolay Nikolaev <address@hidden>
---
tests/vhost-user-test.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 2934379..2af2381 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -269,6 +269,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int
size)
return;
}
+ g_mutex_lock(data_mutex);
memcpy(p, buf, VHOST_USER_HDR_SIZE);
if (msg.size) {
@@ -302,7 +303,6 @@ static void chr_read(void *opaque, const uint8_t *buf, int
size)
/* signal the test that it can continue */
g_cond_signal(data_cond);
- g_mutex_unlock(data_mutex);
break;
case VHOST_USER_SET_VRING_KICK:
@@ -319,6 +319,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int
size)
default:
break;
}
+ g_mutex_unlock(data_mutex);
}
static const char *init_hugepagefs(void)
@@ -385,7 +386,6 @@ int main(int argc, char **argv)
/* run the main loop thread so the chardev may operate */
data_mutex = _mutex_new();
data_cond = _cond_new();
- g_mutex_lock(data_mutex);
_thread_new(NULL, thread_function, NULL);
qemu_cmd = g_strdup_printf(QEMU_CMD, hugefs, socket_path);
- [Qemu-devel] [PATCH 0/6] vhost-user qtest fixes, Nikolay Nikolaev, 2014/06/19
- [Qemu-devel] [PATCH 1/6] configure: add new config define CONFIG_VHOST_NET_USED, Nikolay Nikolaev, 2014/06/19
- [Qemu-devel] [PATCH 2/6] libqemustub: add more stubs for qemu-char, Nikolay Nikolaev, 2014/06/19
- [Qemu-devel] [PATCH 3/6] qtest: fix qtest for vhost-user, Nikolay Nikolaev, 2014/06/19
- [Qemu-devel] [PATCH 4/6] qtest: fix vhost-user-test unbalanced mutex locks,
Nikolay Nikolaev <=
- [Qemu-devel] [PATCH 5/6] vhost: fix migration_blocker initialization, Nikolay Nikolaev, 2014/06/19
- [Qemu-devel] [PATCH 6/6] qtest: enable vhost-user-test, Nikolay Nikolaev, 2014/06/19
- Re: [Qemu-devel] [PATCH 0/6] vhost-user qtest fixes, Michael S. Tsirkin, 2014/06/19