> From: Paolo Bonzini [mailto:[email protected]]
> On 15/09/2016 11:01, Pavel Dovgalyuk wrote:
> > +{
> > + if (replay_mode == REPLAY_MODE_RECORD) {
> > + QDict *opts = qdict_new();
> > + qdict_put(opts, "name", qstring_from_str("replay_init"));
> > + hmp_savevm(cur_mon, opts);
> > + QDECREF(opts);
> > + } else if (replay_mode == REPLAY_MODE_PLAY) {
> > + load_vmstate("replay_init");
>
> See my other message about a suggestion to remove the hardcoded snapshot
> name.
>
> Also, I think the return value of load_vmstate and hmp_savevm should be
> checked.
Load may be unsuccessful when the system is started with temporary overlay file.
This is ok.
> > + }
> > +}
> > diff --git a/vl.c b/vl.c
> > index 1c68779..6698d88 100644
> > --- a/vl.c
> > +++ b/vl.c
> > @@ -4593,6 +4593,8 @@ int main(int argc, char **argv, char **envp)
> > if (load_vmstate(loadvm) < 0) {
> > autostart = 0;
> > }
> > + } else {
> > + replay_vmstate_init();
> > }
>
> Should -loadvm be incompatible with -rr?
User either loads some initial state or relies on replay which uses
'replay_init'.
Pavel Dovgalyuk