vmstate: Mark VMStateInfo.get/put() coroutine_mixed_fn

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>
Message-ID: <20230905145002.46391-2-kwolf@redhat.com>
Acked-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Kevin Wolf 2023-09-05 16:50:01 +02:00
parent 9ea473fb7b
commit 8686a689e5
1 changed files with 5 additions and 3 deletions

View File

@ -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 {