[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH experiment 13/16] disable some code
From: |
Paolo Bonzini |
Subject: |
[PATCH experiment 13/16] disable some code |
Date: |
Mon, 14 Mar 2022 10:32:00 +0100 |
Disable a lot of code that I can't be bothered to convert right now.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
include/qemu/coroutine.h | 2 ++
qapi/qmp-dispatch.c | 2 ++
tests/unit/meson.build | 2 +-
tests/unit/test-coroutine.c | 6 ++++++
util/async.c | 2 ++
util/meson.build | 10 +++++-----
util/qemu-coroutine-lock.c | 2 ++
util/qemu-coroutine-sleep.c | 2 ++
util/thread-pool.c | 2 ++
9 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/include/qemu/coroutine.h b/include/qemu/coroutine.h
index 428e97d946..ac9891502e 100644
--- a/include/qemu/coroutine.h
+++ b/include/qemu/coroutine.h
@@ -200,6 +200,7 @@ typedef struct CoQueue {
*/
void qemu_co_queue_init(CoQueue *queue);
+#if 0
/**
* Adds the current coroutine to the CoQueue and transfers control to the
* caller of the coroutine. The mutex is unlocked during the wait and
@@ -208,6 +209,7 @@ void qemu_co_queue_init(CoQueue *queue);
#define qemu_co_queue_wait(queue, lock) \
qemu_co_queue_wait_impl(queue, QEMU_MAKE_CO_LOCKABLE(lock))
void coroutine_fn qemu_co_queue_wait_impl(CoQueue *queue, QemuCoLockable
*lock);
+#endif
/**
* Removes the next coroutine from the CoQueue, and wake it up.
diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
index d378bccac7..6a4633c133 100644
--- a/qapi/qmp-dispatch.c
+++ b/qapi/qmp-dispatch.c
@@ -235,7 +235,9 @@ QDict *qmp_dispatch(const QmpCommandList *cmds, QObject
*request,
};
aio_bh_schedule_oneshot(qemu_get_aio_context(), do_qmp_dispatch_bh,
&data);
+#if 0
qemu_coroutine_yield();
+#endif
}
qobject_unref(args);
if (err) {
diff --git a/tests/unit/meson.build b/tests/unit/meson.build
index 96b295263e..4ca5fdb699 100644
--- a/tests/unit/meson.build
+++ b/tests/unit/meson.build
@@ -61,7 +61,7 @@ endif
if have_block
tests += {
- 'test-coroutine': [testblock],
+ 'test-coroutine': [],
'test-aio': [testblock],
'test-aio-multithread': [testblock],
'test-throttle': [testblock],
diff --git a/tests/unit/test-coroutine.c b/tests/unit/test-coroutine.c
index 82e22db070..c230c2fa6e 100644
--- a/tests/unit/test-coroutine.c
+++ b/tests/unit/test-coroutine.c
@@ -16,6 +16,7 @@
#include "qemu/coroutine_int.h"
#include "qemu/lockable.h"
+#if 0
/*
* Check that qemu_in_coroutine() works
*/
@@ -638,11 +639,13 @@ static void perf_cost(void)
duration, ops,
(unsigned long)(1000000000.0 * duration / maxcycles));
}
+#endif
int main(int argc, char **argv)
{
g_test_init(&argc, &argv, NULL);
+#if 0
/* This test assumes there is a freelist and marks freed coroutine memory
* with a sentinel value. If there is no freelist this would legitimately
* crash, so skip it.
@@ -650,7 +653,9 @@ int main(int argc, char **argv)
if (CONFIG_COROUTINE_POOL) {
g_test_add_func("/basic/no-dangling-access", test_no_dangling_access);
}
+#endif
+#if 0
g_test_add_func("/basic/lifecycle", test_lifecycle);
g_test_add_func("/basic/yield", test_yield);
g_test_add_func("/basic/nesting", test_nesting);
@@ -669,5 +674,6 @@ int main(int argc, char **argv)
g_test_add_func("/perf/function-call", perf_baseline);
g_test_add_func("/perf/cost", perf_cost);
}
+#endif
return g_test_run();
}
diff --git a/util/async.c b/util/async.c
index 2ea1172f3e..95a9e0f95f 100644
--- a/util/async.c
+++ b/util/async.c
@@ -595,6 +595,7 @@ void aio_co_schedule(AioContext *ctx, Coroutine *co)
aio_context_unref(ctx);
}
+#if 0
typedef struct AioCoRescheduleSelf {
Coroutine *co;
AioContext *new_ctx;
@@ -624,6 +625,7 @@ void coroutine_fn aio_co_reschedule_self(AioContext
*new_ctx)
qemu_coroutine_yield();
}
}
+#endif
void aio_co_wake(struct Coroutine *co)
{
diff --git a/util/meson.build b/util/meson.build
index f6ee74ad0c..30949cd481 100644
--- a/util/meson.build
+++ b/util/meson.build
@@ -76,13 +76,13 @@ if have_block
util_ss.add(files('lockcnt.c'))
util_ss.add(files('main-loop.c'))
util_ss.add(files('nvdimm-utils.c'))
- util_ss.add(files('qemu-coroutine.c', 'qemu-coroutine-lock.c',
'qemu-coroutine-io.c'))
- util_ss.add(when: 'CONFIG_LINUX', if_true: [
- files('vhost-user-server.c'), vhost_user
- ])
+ util_ss.add(files('qemu-coroutine.c', 'qemu-coroutine-lock.c')) #
'qemu-coroutine-io.c'
+# util_ss.add(when: 'CONFIG_LINUX', if_true: [
+# files('vhost-user-server.c'), vhost_user
+# ])
util_ss.add(files('block-helpers.c'))
util_ss.add(files('qemu-coroutine-sleep.c'))
- util_ss.add(files('qemu-co-shared-resource.c'))
+# util_ss.add(files('qemu-co-shared-resource.c'))
util_ss.add(files('thread-pool.c', 'qemu-timer.c'))
util_ss.add(files('readline.c'))
util_ss.add(files('throttle.c'))
diff --git a/util/qemu-coroutine-lock.c b/util/qemu-coroutine-lock.c
index 3f12b53a31..d6c0565ba5 100644
--- a/util/qemu-coroutine-lock.c
+++ b/util/qemu-coroutine-lock.c
@@ -34,6 +34,7 @@
#include "block/aio.h"
#include "trace.h"
+#if 0
void qemu_co_queue_init(CoQueue *queue)
{
QSIMPLEQ_INIT(&queue->entries);
@@ -465,3 +466,4 @@ void qemu_co_rwlock_upgrade(CoRwlock *lock)
assert(lock->owners == -1);
}
}
+#endif
diff --git a/util/qemu-coroutine-sleep.c b/util/qemu-coroutine-sleep.c
index 571ab521ff..b5bfb4ad18 100644
--- a/util/qemu-coroutine-sleep.c
+++ b/util/qemu-coroutine-sleep.c
@@ -17,6 +17,7 @@
#include "qemu/timer.h"
#include "block/aio.h"
+#if 0
static const char *qemu_co_sleep_ns__scheduled = "qemu_co_sleep_ns";
void qemu_co_sleep_wake(QemuCoSleep *w)
@@ -78,3 +79,4 @@ void coroutine_fn qemu_co_sleep_ns_wakeable(QemuCoSleep *w,
qemu_co_sleep(w);
timer_del(&ts);
}
+#endif
diff --git a/util/thread-pool.c b/util/thread-pool.c
index d763cea505..f621f69a91 100644
--- a/util/thread-pool.c
+++ b/util/thread-pool.c
@@ -266,6 +266,7 @@ BlockAIOCB *thread_pool_submit_aio(ThreadPool *pool,
return &req->common;
}
+#if 0
typedef struct ThreadPoolCo {
Coroutine *co;
int ret;
@@ -288,6 +289,7 @@ int coroutine_fn thread_pool_submit_co(ThreadPool *pool,
ThreadPoolFunc *func,
qemu_coroutine_yield();
return tpc.ret;
}
+#endif
void thread_pool_submit(ThreadPool *pool, ThreadPoolFunc *func, void *arg)
{
--
2.35.1
- [PATCH experiment 03/16] coroutine: small code cleanup in qemu_co_rwlock_wrlock, (continued)
- [PATCH experiment 03/16] coroutine: small code cleanup in qemu_co_rwlock_wrlock, Paolo Bonzini, 2022/03/14
- [PATCH experiment 05/16] port atomic.h to C++, Paolo Bonzini, 2022/03/14
- [PATCH experiment 04/16] coroutine: introduce QemuCoLockable, Paolo Bonzini, 2022/03/14
- [PATCH experiment 07/16] start porting compiler.h to C++, Paolo Bonzini, 2022/03/14
- [PATCH experiment 11/16] bump to C++20, Paolo Bonzini, 2022/03/14
- [PATCH experiment 12/16] remove "new" keyword from trace-events, Paolo Bonzini, 2022/03/14
- [PATCH experiment 09/16] start adding extern "C" markers, Paolo Bonzini, 2022/03/14
- [PATCH experiment 10/16] add space between liter and string macro, Paolo Bonzini, 2022/03/14
- [PATCH experiment 13/16] disable some code,
Paolo Bonzini <=
- [PATCH experiment 16/16] port test-coroutine to C++ coroutines, Paolo Bonzini, 2022/03/14
- [PATCH experiment 14/16] util: introduce C++ stackless coroutine backend, Paolo Bonzini, 2022/03/14
- [PATCH experiment 15/16] port QemuCoLockable to C++ coroutines, Paolo Bonzini, 2022/03/14
- Re: [PATCH experiment 00/16] C++20 coroutine backend, Stefan Hajnoczi, 2022/03/14