qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, hreitz@redhat.com, berrange@redhat.com,
	qemu-block@nongnu.org, stefanha@redhat.com
Subject: [PATCH experiment 13/16] disable some code
Date: Mon, 14 Mar 2022 10:32:00 +0100	[thread overview]
Message-ID: <20220314093203.1420404-14-pbonzini@redhat.com> (raw)
In-Reply-To: <20220314093203.1420404-1-pbonzini@redhat.com>

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




  parent reply	other threads:[~2022-03-14  9:54 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-14  9:31 [PATCH experiment 00/16] C++20 coroutine backend Paolo Bonzini
2022-03-14  9:31 ` [PATCH experiment 01/16] coroutine: add missing coroutine_fn annotations for CoRwlock functions Paolo Bonzini
2022-03-14  9:31 ` [PATCH experiment 02/16] coroutine: qemu_coroutine_get_aio_context is not a coroutine_fn Paolo Bonzini
2022-03-14  9:31 ` [PATCH experiment 03/16] coroutine: small code cleanup in qemu_co_rwlock_wrlock Paolo Bonzini
2022-03-14 13:32   ` Philippe Mathieu-Daudé
2022-03-14  9:31 ` [PATCH experiment 04/16] coroutine: introduce QemuCoLockable Paolo Bonzini
2022-03-14  9:31 ` [PATCH experiment 05/16] port atomic.h to C++ Paolo Bonzini
2022-03-14  9:31 ` [PATCH experiment 06/16] use g_new0 instead of g_malloc0 Paolo Bonzini
2022-03-14 11:16   ` Markus Armbruster
2022-03-14  9:31 ` [PATCH experiment 07/16] start porting compiler.h to C++ Paolo Bonzini
2022-03-14  9:31 ` [PATCH experiment 08/16] tracetool: add extern "C" around generated headers Paolo Bonzini
2022-03-14 13:33   ` Philippe Mathieu-Daudé
2022-03-14 13:44     ` Paolo Bonzini
2022-03-14  9:31 ` [PATCH experiment 09/16] start adding extern "C" markers Paolo Bonzini
2022-03-14  9:31 ` [PATCH experiment 10/16] add space between liter and string macro Paolo Bonzini
2022-03-14  9:31 ` [PATCH experiment 11/16] bump to C++20 Paolo Bonzini
2022-03-14  9:31 ` [PATCH experiment 12/16] remove "new" keyword from trace-events Paolo Bonzini
2022-03-14 13:30   ` Philippe Mathieu-Daudé
2022-03-14  9:32 ` Paolo Bonzini [this message]
2022-03-14  9:32 ` [PATCH experiment 14/16] util: introduce C++ stackless coroutine backend Paolo Bonzini
2022-03-14 14:37   ` Stefan Hajnoczi
2022-03-14 19:36     ` Paolo Bonzini
2022-03-14  9:32 ` [PATCH experiment 15/16] port QemuCoLockable to C++ coroutines Paolo Bonzini
2022-03-14  9:32 ` [PATCH experiment 16/16] port test-coroutine " Paolo Bonzini
2022-03-14 14:07 ` [PATCH experiment 00/16] C++20 coroutine backend Stefan Hajnoczi
2022-03-14 16:21   ` Paolo Bonzini
2022-03-14 19:51     ` Richard Henderson
2022-03-15 14:05     ` Stefan Hajnoczi
2022-03-15 14:24       ` Peter Maydell
2022-03-15 17:29         ` Paolo Bonzini
2022-03-16 12:32           ` Stefan Hajnoczi
2022-03-16 13:06             ` Daniel P. Berrangé
2022-03-16 16:44               ` Stefan Hajnoczi
2022-03-17 15:11             ` Paolo Bonzini
2022-03-17 15:53               ` Hanna Reitz
2022-03-31 11:37                 ` Markus Armbruster
2022-03-15 14:50       ` Kevin Wolf
2022-03-15 15:35         ` Stefan Hajnoczi
2022-03-15 15:55         ` Daniel P. Berrangé
2022-03-15 23:08           ` Paolo Bonzini
2022-03-16 12:40             ` Stefan Hajnoczi
2022-03-16 16:15               ` Kevin Wolf
2022-03-17 12:16             ` Dr. David Alan Gilbert
2022-03-17 12:51             ` Daniel P. Berrangé
2022-03-31 11:52           ` Markus Armbruster
2022-03-15 17:23         ` When and how to use C++ (was Re: [PATCH experiment 00/16] C++20 coroutine backend) Paolo Bonzini
2022-03-14 16:52 ` [PATCH experiment 00/16] C++20 coroutine backend Daniel P. Berrangé
2022-03-15  9:05   ` Paolo Bonzini
2022-03-15  9:32     ` Daniel P. Berrangé
2022-03-15 17:27       ` Paolo Bonzini
2022-03-15 18:12         ` Daniel P. Berrangé
2022-03-15 16:15 ` Daniel P. Berrangé
2022-03-15 17:50   ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220314093203.1420404-14-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=berrange@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).