From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O4Kzd-00058d-Tb for qemu-devel@nongnu.org; Tue, 20 Apr 2010 17:28:30 -0400 Received: from [140.186.70.92] (port=47309 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O4Kzc-000581-AR for qemu-devel@nongnu.org; Tue, 20 Apr 2010 17:28:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O4Kza-0006Ph-DK for qemu-devel@nongnu.org; Tue, 20 Apr 2010 17:28:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61167) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O4Kza-0006PY-5l for qemu-devel@nongnu.org; Tue, 20 Apr 2010 17:28:26 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3KLSPdA031687 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 20 Apr 2010 17:28:25 -0400 From: Juan Quintela In-Reply-To: <1271797792-24571-5-git-send-email-lcapitulino@redhat.com> (Luiz Capitulino's message of "Tue, 20 Apr 2010 18:09:34 -0300") References: <1271797792-24571-1-git-send-email-lcapitulino@redhat.com> <1271797792-24571-5-git-send-email-lcapitulino@redhat.com> Date: Tue, 20 Apr 2010 23:28:23 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH 04/22] savevm: do_loadvm(): Always resume the VM List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: kwolf@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com Luiz Capitulino wrote: > do_loadvm(), which implements the 'loadvm' Monitor command, pauses > the emulation to load the saved VM, however it will only resume > it if the loading succeeds. > > In other words, if the user issues 'loadvm' and it fails, the > end result will be an error message and a paused VM. > > This seems an undesirable side effect to me because, most of the > time, if a Monitor command fails the best thing we can do is to > leave the VM as it were before the command was executed. > > FIXME: This will try to run a potentially corrupted image, the > solution is to split load_vmstate() in two and only keep > the VM paused if qemu_loadvm_state() fails. Any of the other errors in loadvm also requires you to not load the state. > Signed-off-by: Luiz Capitulino Nack. This can cause disk corruption. You tried to load a vm image, failed the load somehow (notice the somehow) and you try to run it anyways. That is a recipe for disaster. If load_vmstate() fails -> you don't run. Current code is a mess, but don't do things worse. Later, Juan.