Skip to content

Commit 8686a68

Browse files
committed
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 <[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]>
1 parent 9ea473f commit 8686a68

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

include/migration/vmstate.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ typedef struct VMStateField VMStateField;
4141
*/
4242
struct VMStateInfo {
4343
const char *name;
44-
int (*get)(QEMUFile *f, void *pv, size_t size, const VMStateField *field);
45-
int (*put)(QEMUFile *f, void *pv, size_t size, const VMStateField *field,
46-
JSONWriter *vmdesc);
44+
int coroutine_mixed_fn (*get)(QEMUFile *f, void *pv, size_t size,
45+
const VMStateField *field);
46+
int coroutine_mixed_fn (*put)(QEMUFile *f, void *pv, size_t size,
47+
const VMStateField *field,
48+
JSONWriter *vmdesc);
4749
};
4850

4951
enum VMStateFlags {

0 commit comments

Comments
 (0)