Received: from eggs.gnu.org ([208.118.235.92]:53244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Swvqm-0000sA-EJ for qemu-devel@nongnu.org; Thu, 02 Aug 2012 09:54:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Swvqg-0002Ay-Mc for qemu-devel@nongnu.org; Thu, 02 Aug 2012 09:54:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36657) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Swvqg-0002Au-Er for qemu-devel@nongnu.org; Thu, 02 Aug 2012 09:53:58 -0400 From: Markus Armbruster References: <1343869374-23417-1-git-send-email-lcapitulino@redhat.com> <1343869374-23417-14-git-send-email-lcapitulino@redhat.com> <87y5lx5sqi.fsf@blackfin.pond.sub.org> <501A84C8.4060508@redhat.com> Date: Thu, 02 Aug 2012 15:53:54 +0200 In-Reply-To: <501A84C8.4060508@redhat.com> (Paolo Bonzini's message of "Thu, 02 Aug 2012 15:46:48 +0200") Message-ID: <87vch12ydp.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 13/34] hmp: hmp_change(): don't rely on QERR_DEVICE_ENCRYPTED List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, Luiz Capitulino , eblake@redhat.com Paolo Bonzini writes: > Il 02/08/2012 15:27, Markus Armbruster ha scritto: >>> > + bdev_list = qmp_query_block(NULL); >>> > + for (bdev = bdev_list; bdev; bdev = bdev->next) { >>> > + if (!strcmp(bdev->value->device, device) && >>> > + blockinfo_is_encrypted(bdev->value) && >>> > + !blockinfo_key_is_set(bdev->value)) { >>> > + hmp_change_ask_user_key(mon, bdev->value); >>> > + break; >>> > + } >>> > + } > > Is this anything that an external application can reproduce? > > Perhaps we need to keep QERR_DEVICE_ENCRYPTED even if libvirt does not > use it, or at least provide an alternative mechanism (e.g. an event) to > realize its effect. Not sure I get you. External applications should use QMP. A sane way to change media in QMP needs to provide the key as argument. If the key is wrong, fail the change cleanly. In particular, don't eject then.