From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=34503 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oepoc-0002mT-8R for qemu-devel@nongnu.org; Fri, 30 Jul 2010 09:40:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oepnv-0001Uv-7S for qemu-devel@nongnu.org; Fri, 30 Jul 2010 09:39:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26756) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oepnu-0001UU-UI for qemu-devel@nongnu.org; Fri, 30 Jul 2010 09:39:15 -0400 Date: Fri, 30 Jul 2010 10:39:06 -0300 From: Luiz Capitulino Message-ID: <20100730103906.551adacd@redhat.com> In-Reply-To: <1280345424-12918-4-git-send-email-miguel.filho@gmail.com> References: <1280345424-12918-1-git-send-email-miguel.filho@gmail.com> <1280345424-12918-4-git-send-email-miguel.filho@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 3/3] savevm: prevent snapshot overwriting and generate a default name List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Miguel Di Ciurcio Filho Cc: kwolf@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com On Wed, 28 Jul 2010 16:30:24 -0300 Miguel Di Ciurcio Filho wrote: > This patch address two issues. Then it should be split in two. > > 1) When savevm is run using an previously saved snapshot id or name, it will > delete the original and create a new one, using the same id and name and not > prompting the user of what just happened. > > This behaviour is not good, IMHO. > > We add a '-f' parameter to savevm, to really force that to happen, in case the > user really wants to. > > New behavior: > (qemu) savevm snap1 > An snapshot named 'snap1' already exists > > (qemu) savevm -f snap1 > > We do better error reporting in case '-f' is used too than before. > > 2) When savevm is run without a name or id, the name stays blank. > > This is a first step to hide the internal id, because I don't see a reason to > expose this kind of internals to the user. > > The new behavior is when savevm is run without parameters a name will be > created automaticaly, so the snapshot is accessible to the user without needing > the id when loadvm is run. > > (qemu) savevm > (qemu) info snapshots > ID TAG VM SIZE DATE VM CLOCK > 1 vm-20100728134640 978K 2010-07-28 13:46:40 00:00:08.603 > > We use a name with the format 'vm-YYYYMMDDHHMMSS'. > > TODO: I have no clue on how to create a timestamp string when using Windows. So, what happens on windows? Also, please, avoid making changes which are unrelated to the patch, like: > the_end: > - if (saved_vm_running) > + if (saved_vm_running) { > vm_start(); > + } > } > > int load_vmstate(const char *name)