summaryrefslogtreecommitdiff
path: root/qmp.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2011-11-22 17:58:31 -0200
committerLuiz Capitulino <lcapitulino@redhat.com>2011-12-06 11:40:01 -0200
commite42e818bf45f2f70cdd88a3864efcc3964039f37 (patch)
treeedc33f757981f6a1a5005b1ee3229b7e38589e46 /qmp.c
parent6d3962bf848ba06296554976f9fd86af805584bb (diff)
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.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/qmp.c b/qmp.c
index 511dd624b5..d71ceb4e4d 100644
--- a/qmp.c
+++ b/qmp.c
@@ -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();
+}