Skip to content

Commit

Permalink
vmstate: Mark VMStateInfo.get/put() coroutine_mixed_fn
Browse files Browse the repository at this point in the history
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 <[email protected]>
Message-ID: <[email protected]>
Acked-by: Peter Xu <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
  • Loading branch information
kevmw committed Sep 8, 2023
1 parent 9ea473f commit 8686a68
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions include/migration/vmstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8686a68

Please sign in to comment.