aboutsummaryrefslogtreecommitdiff
path: root/qmp.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-12-12 10:08:08 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2011-12-12 10:08:08 -0600
commit9bf4896e5d565785316d2c179be91fba11fbf3fb (patch)
tree4ac5f38e5f88949dbded2562db95ddb9253c28a2 /qmp.c
parent774d5c5b1604b8443a8e42048b370b6c95dbfc40 (diff)
parent3dc853832db7bf8ac3878e0666c639d3bc02b587 (diff)
downloadqemu-9bf4896e5d565785316d2c179be91fba11fbf3fb.zip
qemu-9bf4896e5d565785316d2c179be91fba11fbf3fb.tar.gz
qemu-9bf4896e5d565785316d2c179be91fba11fbf3fb.tar.bz2
Merge remote-tracking branch 'qmp/queue/qmp' into staging
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 511dd62..d71ceb4 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();
+}