From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WO6Tb-0000IA-QL for qemu-devel@nongnu.org; Thu, 13 Mar 2014 10:19:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WO6TT-00017f-DK for qemu-devel@nongnu.org; Thu, 13 Mar 2014 10:19:15 -0400 Received: from mail-ea0-x234.google.com ([2a00:1450:4013:c01::234]:47592) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WO6TT-00017L-6m for qemu-devel@nongnu.org; Thu, 13 Mar 2014 10:19:07 -0400 Received: by mail-ea0-f180.google.com with SMTP id m10so506866eaj.25 for ; Thu, 13 Mar 2014 07:19:06 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <5321BE56.3090909@redhat.com> Date: Thu, 13 Mar 2014 15:19:02 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1394643643-27122-1-git-send-email-armbru@redhat.com> <53218BBC.8030108@redhat.com> <5321B232.6090603@redhat.com> In-Reply-To: <5321B232.6090603@redhat.com> Content-Type: text/plain; charset=UTF-8; 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: Eric Blake , Markus Armbruster , qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com Il 13/03/2014 14:27, Eric Blake ha scritto: >>> >> + } else if (!runstate_check(RUN_STATE_PRELAUNCH) >>> >> + && !runstate_check(RUN_STATE_PAUSED)) { /* HACK */ >> > >> > Why not "if (runstate_is_running())"? > Because that lacks PRELAUNCH, but PRELAUNCH also needs the protection. Nope, PRELAUNCH does *not* need the protection. if (!runstate_check(PRELAUNCH) && !runstate_check(PAUSED)) error gives an error if runstate == anything *but* PRELAUNCH and PAUSED It's at least DEBUG, SAVE_VM and RESTORE_VM that do need it but are not included in runstate_is_running. Paolo