Received: from eggs.gnu.org ([2001:4830:134:3::10]:52599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WO77u-0004ej-1A for qemu-devel@nongnu.org; Thu, 13 Mar 2014 11:01:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WO77o-00080a-1G for qemu-devel@nongnu.org; Thu, 13 Mar 2014 11:00:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44285) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WO77n-00080U-PR for qemu-devel@nongnu.org; Thu, 13 Mar 2014 11:00:47 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2DF0kt3024692 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 13 Mar 2014 11:00:46 -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> Date: Thu, 13 Mar 2014 16:00:29 +0100 In-Reply-To: <5321BD63.8010007@redhat.com> (Paolo Bonzini's message of "Thu, 13 Mar 2014 15:14:59 +0100") Message-ID: <87zjkuqh2q.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 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.