From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WO7FK-0006kg-5t for qemu-devel@nongnu.org; Thu, 13 Mar 2014 11:08:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WO7FE-0002vp-4J for qemu-devel@nongnu.org; Thu, 13 Mar 2014 11:08:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WO7FD-0002vb-SX for qemu-devel@nongnu.org; Thu, 13 Mar 2014 11:08:28 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2DF8NQq004836 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 13 Mar 2014 11:08:23 -0400 Message-ID: <5321C9E3.8010905@redhat.com> Date: Thu, 13 Mar 2014 16:08:19 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1394643643-27122-1-git-send-email-armbru@redhat.com> <53218BBC.8030108@redhat.com> <87a9cuw81r.fsf@blackfin.pond.sub.org> <5321BD63.8010007@redhat.com> <87zjkuqh2q.fsf@blackfin.pond.sub.org> In-Reply-To: <87zjkuqh2q.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] blockdev: Refuse to open encrypted image unless paused List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com Il 13/03/2014 16:00, Markus Armbruster ha scritto: > Paolo Bonzini writes: > >> Il 13/03/2014 14:18, Markus Armbruster ha scritto: >>> Paolo Bonzini writes: >>> >>>> Il 12/03/2014 18:00, Markus Armbruster ha scritto: >>>>> + } else if (!runstate_check(RUN_STATE_PRELAUNCH) >>>>> + && !runstate_check(RUN_STATE_PAUSED)) { /* HACK */ >>>> >>>> Why not "if (runstate_is_running())"? >>> >>> The predicate actually wanted here is "monitor command 'cont' required >>> to get the guest running", because 'cont' is where the protection is. >>> My run state test is a crude approximation. >>> >> >> Got it. Then you need to add at least a check for >> "runstate_check(RUN_STATE_INMIGRATE)", otherwise you break incoming >> migration. > > You're right: main() goes from RUN_STATE_PRELAUNCH to > RUN_STATE_INMIGRATE right when it sees -incoming. > >> Actually, I think only SAVE_VM/RESTORE_VM/DEBUG are >> problematic, but I understand why you preferred a conservative >> test (sufficient condition, not necessary). > > Exactly. > >> You are singling out prelaunch and inmigrate because drive_init >> will reset autostart to 0 for an encrypted image, right? > > Yes. Then with the check modified, Reviewed-by: Paolo Bonzini Paolo