Received: from eggs.gnu.org ([2001:4830:134:3::10]:37892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WONHO-0001NK-LC for qemu-devel@nongnu.org; Fri, 14 Mar 2014 04:15:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WONHH-0004Bo-Pp for qemu-devel@nongnu.org; Fri, 14 Mar 2014 04:15:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46612) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WONHH-0004Bg-GP for qemu-devel@nongnu.org; Fri, 14 Mar 2014 04:15:39 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2E8Fcnj008090 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 14 Mar 2014 04:15:38 -0400 From: Markus Armbruster 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> <5321C9E3.8010905@redhat.com> Date: Fri, 14 Mar 2014 09:15:35 +0100 In-Reply-To: <5321C9E3.8010905@redhat.com> (Paolo Bonzini's message of "Thu, 13 Mar 2014 16:08:19 +0100") Message-ID: <87vbvhkxg8.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain 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: Paolo Bonzini Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com Paolo Bonzini writes: > 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 Will do. I'm refraining from adding your R-by, because I need to update tests, too. Thanks!