Message ID | AANLkTi=P+7C8Opc5gzmybvp6xK4TZbohN9rMVs_0m+Vg@mail.gmail.com |
---|---|
State | New |
Headers | show |
diff --git a/savevm.c b/savevm.c index 2082b8c..feca8fa 100644 --- a/savevm.c +++ b/savevm.c @@ -1286,9 +1286,11 @@ int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd, } field++; } - ret = vmstate_subsection_load(f, vmsd, opaque); - if (ret != 0) { - return ret; + if (vmsd->subsections) { + ret = vmstate_subsection_load(f, vmsd, opaque); + if (ret != 0) { + return ret; + } } if (vmsd->post_load) {
If one vmstate includes subsections and its last field flag is VMS_STRUCT, vmstate_load_state will be always failed when the subsections exist. This fix is not perfect because if the last field includes subsections too, vmstate_load_state will maybe be failed when not all of the subsections exist. I think vmstate subsections needs to be redesigned. Signed-off-by: TeLeMan <geleman@gmail.com> --- savevm.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) return vmsd->post_load(opaque, version_id);