Received: from eggs.gnu.org ([2001:4830:134:3::10]:45952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKQa5-0003ls-ST for qemu-devel@nongnu.org; Mon, 03 Mar 2014 05:58:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKQZz-0000VJ-Mo for qemu-devel@nongnu.org; Mon, 03 Mar 2014 05:58:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35156) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKQZz-0000VB-Fy for qemu-devel@nongnu.org; Mon, 03 Mar 2014 05:58:39 -0500 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 s23Awcku028072 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 3 Mar 2014 05:58:38 -0500 Date: Mon, 3 Mar 2014 11:58:37 +0100 From: Kevin Wolf Message-ID: <20140303105837.GD4850@dhcp-200-207.str.redhat.com> References: <87wqgflzno.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wqgflzno.fsf@blackfin.pond.sub.org> Subject: Re: [Qemu-devel] The unholy encrypted image key mess List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, Stefan Hajnoczi , Gerd Hoffmann Am 28.02.2014 um 22:01 hat Markus Armbruster geschrieben: > Questions: > > 1. Should we protect guests from state NEEDKEY? Yes. An image in state NEEDKEY isn't fully initialised, so we should make sure that it isn't used. > 2. If yes, how? > > Pause the guest when something enters state NEEDKEY? I'd hate that. > > Fail device_add in state NEEDKEY? Takes care of hot-plug, and > cold-plug is already protected by cont. 'device_add' should refuse to accept a backend that isn't fully initialised, so yes, I agree. 'change' is a bit trickier because it involves several low-level actions at once, and device_add is not one of them. What we probably really need to do is support a state where no BDS is attached to the device emulation (a BlockBackend might still be attached, not sure about this one), but the VM is still running. And then 'change' can detach the BDS, bring it back to the NEEDKEY state (unrealize in QOM speech?), magic happens and then we reattach the BDS to the guest device. We'll also want to protect other parts of qemu from not fully initialised BDSes, e.g. block jobs or NBD servers shouldn't take such an BDS as their source. Kevin