From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkpmN-00010p-8A for qemu-devel@nongnu.org; Fri, 16 Sep 2016 05:49:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkpmK-0008UQ-3U for qemu-devel@nongnu.org; Fri, 16 Sep 2016 05:49:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkpmJ-0008UE-UM for qemu-devel@nongnu.org; Fri, 16 Sep 2016 05:49:52 -0400 References: <20160915090042.6440.22516.stgit@PASHA-ISP> <20160915090054.6440.77726.stgit@PASHA-ISP> <7d034a73-77d6-d79f-7b7b-137d8408e514@redhat.com> <001a01d20fef$b9a62700$2cf27500$@ru> <002b01d20ffd$c911dfa0$5b359ee0$@ru> From: Paolo Bonzini Message-ID: <7014a82d-2d39-b99f-2127-3272da6cf3b0@redhat.com> Date: Fri, 16 Sep 2016 11:49:45 +0200 MIME-Version: 1.0 In-Reply-To: <002b01d20ffd$c911dfa0$5b359ee0$@ru> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 02/10] block: set snapshot option for block devices in blkreplay module List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgalyuk , 'Pavel Dovgalyuk' , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, quintela@redhat.com, jasowang@redhat.com, mst@redhat.com, agraf@suse.de, david@gibson.dropbear.id.au On 16/09/2016 11:36, Pavel Dovgalyuk wrote: >> From: Paolo Bonzini [mailto:paolo.bonzini@gmail.com] On Behalf Of Paolo Bonzini >> On 16/09/2016 09:55, Pavel Dovgalyuk wrote: >>>> Since you have to create >>>> overlay.qcow2 outside QEMU anyway, overlay.qcow2 might as well be the >>>> "image". That is, you could choose between: >>>> >>>> -drive driver=blkreplay,if=none,image=overlay.qcow2,id=img-blkreplay \ >>>> -rr snapshot=replay_init,... >>>> >>>> -drive driver=blkreplay,if=none,image=img-direct,id=img-blkreplay >>>> >>>> The temporary snapshot would be created if there's no "-rr snapshot" option >>>> on the command line. >>>> >>>> Does this make sense? >>> >>> There are two different parts: >>> - creating an overlay >>> - creating the snapshot >>> >>> Overlay is needed to preserve the state of the original backing file. >>> In the current version temporary overlay is always created at start of qemu. >> >> Yes, this would still be the default for rr mode. >> >>> I don't think that it is convenient forcing user to create overlay manually. >> >> Note that all I'm only saying that _only for the case where the user >> creates the overlay manually anyway_ there is no need to specify both >> image and overlay. (I also don't like particularly the hard-coded >> snapshot name replay_init, which can be overridden by -loadvm but not >> when saving). > > Ok, this seems reasonable to fix. > >> >> So there are various possibilites: >> >> First proposal: >> >> - automatically created overlay is -icount rr=record|replay (then >> snapshot name doesn't matter, it can be replay_init) >> >> - manually created overlay is -icount >> rr=record|replay,rrsnapshot=snapname (then snapshot name matters because >> you can have different snapshots in the same file) > > We can't create overlay with icount suboptions, because there could be several > block devices. Each one needs its own overlay. Right, so the overlay name is specified in each -drive option the blkreplay image. rrsnapshot is just the name of the first snapshot that is created (for rr=record, instead of requiring manual interaction with the monitor) or loaded (for rr=replay; in this case it's a convenience only). Paolo