diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2011-11-22 17:58:31 -0200 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2011-12-06 11:40:01 -0200 |
commit | e42e818bf45f2f70cdd88a3864efcc3964039f37 (patch) | |
tree | edc33f757981f6a1a5005b1ee3229b7e38589e46 /qmp.c | |
parent | 6d3962bf848ba06296554976f9fd86af805584bb (diff) | |
download | qemu-e42e818bf45f2f70cdd88a3864efcc3964039f37.zip qemu-e42e818bf45f2f70cdd88a3864efcc3964039f37.tar.gz qemu-e42e818bf45f2f70cdd88a3864efcc3964039f37.tar.bz2 |
qapi: Convert cont
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'qmp.c')
-rw-r--r-- | qmp.c | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -117,3 +117,40 @@ SpiceInfo *qmp_query_spice(Error **errp) return NULL; }; #endif + +static void iostatus_bdrv_it(void *opaque, BlockDriverState *bs) +{ + bdrv_iostatus_reset(bs); +} + +static void encrypted_bdrv_it(void *opaque, BlockDriverState *bs) +{ + Error **err = opaque; + + if (!error_is_set(err) && bdrv_key_required(bs)) { + error_set(err, QERR_DEVICE_ENCRYPTED, bdrv_get_device_name(bs)); + } +} + +void qmp_cont(Error **errp) +{ + Error *local_err = NULL; + + if (runstate_check(RUN_STATE_INMIGRATE)) { + error_set(errp, QERR_MIGRATION_EXPECTED); + return; + } else if (runstate_check(RUN_STATE_INTERNAL_ERROR) || + runstate_check(RUN_STATE_SHUTDOWN)) { + error_set(errp, QERR_RESET_REQUIRED); + return; + } + + bdrv_iterate(iostatus_bdrv_it, NULL); + bdrv_iterate(encrypted_bdrv_it, &local_err); + if (local_err) { + error_propagate(errp, local_err); + return; + } + + vm_start(); +} |