From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bko0d-0002yP-Ne for qemu-devel@nongnu.org; Fri, 16 Sep 2016 03:56:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bko0Y-0004JS-Pa for qemu-devel@nongnu.org; Fri, 16 Sep 2016 03:56:31 -0400 Received: from mail.ispras.ru ([83.149.199.45]:34610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bko0Y-0004Gs-IN for qemu-devel@nongnu.org; Fri, 16 Sep 2016 03:56:26 -0400 From: "Pavel Dovgalyuk" References: <20160915090042.6440.22516.stgit@PASHA-ISP> <20160915090105.6440.95131.stgit@PASHA-ISP> In-Reply-To: Date: Fri, 16 Sep 2016 10:56:10 +0300 Message-ID: <001b01d20fef$ca246970$5e6d3c50$@ru> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-Language: ru Subject: Re: [Qemu-devel] [PATCH v2 04/10] replay: save/load initial state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Paolo Bonzini' , 'Pavel Dovgalyuk' , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, mst@redhat.com, jasowang@redhat.com, quintela@redhat.com, agraf@suse.de, david@gibson.dropbear.id.au > From: Paolo Bonzini [mailto:pbonzini@redhat.com] > 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