From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WO6Pd-0003JC-Kf for qemu-devel@nongnu.org; Thu, 13 Mar 2014 10:15:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WO6PX-0008AN-MC for qemu-devel@nongnu.org; Thu, 13 Mar 2014 10:15:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15723) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WO6PX-00089R-E0 for qemu-devel@nongnu.org; Thu, 13 Mar 2014 10:15:03 -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.14.4/8.14.4) with ESMTP id s2DEF25k019154 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 13 Mar 2014 10:15:02 -0400 Message-ID: <5321BD63.8010007@redhat.com> Date: Thu, 13 Mar 2014 15:14:59 +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> In-Reply-To: <87a9cuw81r.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=ISO-8859-15 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 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. Actually, I think only SAVE_VM/RESTORE_VM/DEBUG are problematic, but I understand why you preferred a conservative test (sufficient condition, not necessary). You are singling out prelaunch and inmigrate because drive_init will reset autostart to 0 for an encrypted image, right? Paolo