summaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-03-14 18:44:22 +0000
committerPeter Maydell <peter.maydell@linaro.org>2014-03-14 18:44:22 +0000
commit4191d0eb414b14bcf3eab803095566aeb9b198f0 (patch)
treeb1f06b29951d355bfd0c1682abb8c1d43f3ec6ea /block.c
parent03d51428e2da0188a0adea00cbd713cc1e967e7a (diff)
parent46dea4160d587add2f3670306c41ad9ad4064af5 (diff)
downloadqemu-4191d0eb414b14bcf3eab803095566aeb9b198f0.tar.gz
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Block pull request # gpg: Signature made Fri 14 Mar 2014 16:12:14 GMT using RSA key ID 81AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/block-pull-request: qemu-iotests: remove 085 and 087 from 'quick' group qemu-iotests: add 083 NBD client disconnect tests tests: add nbd-fault-injector.py utility nbd: close socket if connection breaks block: Explicitly specify 'unsigned long long' for VHDX 64-bit constants blockdev: Refuse to open encrypted image unless paused Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'block.c')
-rw-r--r--block.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/block.c b/block.c
index fae50c95b5..53f5b44fbb 100644
--- a/block.c
+++ b/block.c
@@ -1388,12 +1388,19 @@ done:
ret = -EINVAL;
goto close_and_fail;
}
- QDECREF(options);
if (!bdrv_key_required(bs)) {
bdrv_dev_change_media_cb(bs, true);
+ } else if (!runstate_check(RUN_STATE_PRELAUNCH)
+ && !runstate_check(RUN_STATE_INMIGRATE)
+ && !runstate_check(RUN_STATE_PAUSED)) { /* HACK */
+ error_setg(errp,
+ "Guest must be stopped for opening of encrypted image");
+ ret = -EBUSY;
+ goto close_and_fail;
}
+ QDECREF(options);
*pbs = bs;
return 0;