From: Kevin Wolf <kwolf@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, mst@redhat.com, quintela@redhat.com,
peterx@redhat.com, leobras@redhat.com, stefanha@redhat.com,
pbonzini@redhat.com, qemu-block@nongnu.org,
qemu-stable@nongnu.org
Subject: [PATCH 1/2] vmstate: Mark VMStateInfo.get/put() coroutine_mixed_fn
Date: Tue, 5 Sep 2023 16:50:01 +0200 [thread overview]
Message-ID: <20230905145002.46391-2-kwolf@redhat.com> (raw)
In-Reply-To: <20230905145002.46391-1-kwolf@redhat.com>
Migration code can run both in coroutine context (the usual case) and
non-coroutine context (at least savevm/loadvm for snapshots). This also
affects the VMState callbacks, and devices must consider this. Change
the callback definition in VMStateInfo to be explicit about it.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
include/migration/vmstate.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index d1b8abe08d..e4db910339 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -41,9 +41,11 @@ typedef struct VMStateField VMStateField;
*/
struct VMStateInfo {
const char *name;
- int (*get)(QEMUFile *f, void *pv, size_t size, const VMStateField *field);
- int (*put)(QEMUFile *f, void *pv, size_t size, const VMStateField *field,
- JSONWriter *vmdesc);
+ int coroutine_mixed_fn (*get)(QEMUFile *f, void *pv, size_t size,
+ const VMStateField *field);
+ int coroutine_mixed_fn (*put)(QEMUFile *f, void *pv, size_t size,
+ const VMStateField *field,
+ JSONWriter *vmdesc);
};
enum VMStateFlags {
--
2.41.0
next prev parent reply other threads:[~2023-09-05 14:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-05 14:50 [PATCH 0/2] virtio: Drop out of coroutine context in virtio_load() Kevin Wolf
2023-09-05 14:50 ` Kevin Wolf [this message]
2023-09-05 15:06 ` [PATCH 1/2] vmstate: Mark VMStateInfo.get/put() coroutine_mixed_fn Peter Xu
2023-09-05 14:50 ` [PATCH 2/2] virtio: Drop out of coroutine context in virtio_load() Kevin Wolf
2023-09-07 18:40 ` Stefan Hajnoczi
2023-09-08 8:59 ` Kevin Wolf
2023-09-08 10:46 ` Stefan Hajnoczi
2023-10-17 5:19 ` Michael Tokarev
2023-10-17 8:48 ` Kevin Wolf
2023-10-17 13:06 ` Juan Quintela
2023-09-07 18:42 ` [PATCH 0/2] " Stefan Hajnoczi
2023-09-08 8:53 ` Kevin Wolf
2023-09-08 10:46 ` Stefan Hajnoczi
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=20230905145002.46391-2-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=leobras@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=quintela@redhat.com \
--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).