On Thu, 02 Aug 2012 15:46:48 +0200 Paolo Bonzini <pbonz...@redhat.com> wrote:
> 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? Yes, that should be possible. But thinking a bit more about this, the real question is whether we want them to do it. I guess not, as the fact that qmp_bdrv_open_encrypted() doesn't close the bs on error is probably a bug. > 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. Yes, maybe that's better. hmp_cont() wouldn't change much though, as it still needs to figure out which device needs a key.