From 73730fdf0e2d75e51789b771fe227f4e629512a3 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 16 May 2008 17:01:12 +0100 Subject: [PATCH] register_savevm etc.: make save function optional This allows a device to provide only a loading function, not a saving function. This is useful if a later version of an emulation restores its state in some other way (eg by having a different device name, or by exploiting invariants in the state); when this happens it is still necessary to load or skip the information when it is found in old savefiles. Signed-off-by: Ian Jackson --- vl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vl.c b/vl.c index 67712f0ce..3a9135cd0 100644 --- a/vl.c +++ b/vl.c @@ -5988,6 +5988,10 @@ static int qemu_savevm_state(QEMUFile *f) qemu_put_be64(f, 0); /* total size */ for(se = first_se; se != NULL; se = se->next) { + if (se->save_state == NULL) + /* this one has a loader only, for backwards compatibility */ + continue; + /* ID string */ len = strlen(se->idstr); qemu_put_byte(f, len); -- 2.39.5