summary refs log tree commit diff stats
path: root/util/qemu-coroutine-sleep.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-11-19 09:17:23 +0000
committerPeter Maydell <peter.maydell@linaro.org>2019-11-19 09:17:24 +0000
commit385e43e6638464009e09cfaec254012e531f6342 (patch)
treec43ee841d3695d5fd24bb4faaa2b28415884f0aa /util/qemu-coroutine-sleep.c
parentf086f22d6c068ba151b0f6e81e75a64f130df712 (diff)
parent296416ff0f519d762fbb87ac59f0770824267f3f (diff)
downloadfocaccia-qemu-385e43e6638464009e09cfaec254012e531f6342.tar.gz
focaccia-qemu-385e43e6638464009e09cfaec254012e531f6342.zip
Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2019-11-19' into staging
nbd patches for 2019-11-19

- iotests: more tests of NBD reconnect, various test output improvements
- nbd: fix spec compliance issue with long strings
- slience a Coverity warning on coroutines

# gpg: Signature made Tue 19 Nov 2019 03:06:41 GMT
# gpg:                using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A
# gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
# gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full]
# gpg:                 aka "[jpeg image of size 6874]" [full]
# Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A

* remotes/ericb/tags/pull-nbd-2019-11-19:
  tests: More iotest 223 improvements
  iotests: Include QMP input in .out files
  iotests: Switch nbd tests to use Unix rather than TCP
  iotests: Fix 173
  MAINTAINERS: add more bitmap-related to Dirty Bitmaps section
  nbd: Don't send oversize strings
  bitmap: Enforce maximum bitmap name length
  nbd/server: Prefer heap over stack for parsing client names
  qemu-coroutine-sleep: Silence Coverity warning
  iotests: Test NBD client reconnection

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'util/qemu-coroutine-sleep.c')
-rw-r--r--util/qemu-coroutine-sleep.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/util/qemu-coroutine-sleep.c b/util/qemu-coroutine-sleep.c
index ae91b92b6e..769a76e57d 100644
--- a/util/qemu-coroutine-sleep.c
+++ b/util/qemu-coroutine-sleep.c
@@ -68,5 +68,12 @@ void coroutine_fn qemu_co_sleep_ns_wakeable(QEMUClockType type, int64_t ns,
     }
     timer_mod(state.ts, qemu_clock_get_ns(type) + ns);
     qemu_coroutine_yield();
+    if (sleep_state) {
+        /*
+         * Note that *sleep_state is cleared during qemu_co_sleep_wake
+         * before resuming this coroutine.
+         */
+        assert(*sleep_state == NULL);
+    }
     timer_free(state.ts);
 }