mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
qapi: Convert cont
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
6d3962bf84
commit
e42e818bf4
8 changed files with 107 additions and 65 deletions
32
hmp.c
32
hmp.c
|
@ -561,3 +561,35 @@ void hmp_pmemsave(Monitor *mon, const QDict *qdict)
|
|||
qmp_pmemsave(addr, size, filename, &errp);
|
||||
hmp_handle_error(mon, &errp);
|
||||
}
|
||||
|
||||
static void hmp_cont_cb(void *opaque, int err)
|
||||
{
|
||||
Monitor *mon = opaque;
|
||||
|
||||
if (!err) {
|
||||
hmp_cont(mon, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void hmp_cont(Monitor *mon, const QDict *qdict)
|
||||
{
|
||||
Error *errp = NULL;
|
||||
|
||||
qmp_cont(&errp);
|
||||
if (error_is_set(&errp)) {
|
||||
if (error_is_type(errp, QERR_DEVICE_ENCRYPTED)) {
|
||||
const char *device;
|
||||
|
||||
/* The device is encrypted. Ask the user for the password
|
||||
and retry */
|
||||
|
||||
device = error_get_field(errp, "device");
|
||||
assert(device != NULL);
|
||||
|
||||
monitor_read_block_device_key(mon, device, hmp_cont_cb, mon);
|
||||
error_free(errp);
|
||||
return;
|
||||
}
|
||||
hmp_handle_error(mon, &errp);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue