mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Block layer patches for 2.6 # gpg: Signature made Tue 05 Apr 2016 16:32:25 BST using RSA key ID C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" * remotes/kevin/tags/for-upstream: crypto: Avoid memory leak on failure qemu-iotests: 149: Use "/usr/bin/env python" block: Forbid I/O throttling on nodes with multiple parents for 2.6 block: forbid x-blockdev-del from acting on DriveInfo Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -1526,6 +1526,13 @@ static int bdrv_open_inherit(BlockDriverState **pbs, const char *filename,
|
||||
if (!bs) {
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (bs->throttle_state) {
|
||||
error_setg(errp, "Cannot reference an existing block device for "
|
||||
"which I/O throttling is enabled");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
bdrv_ref(bs);
|
||||
*pbs = bs;
|
||||
return 0;
|
||||
|
||||
+6
-6
@@ -196,6 +196,7 @@ block_crypto_open_opts_init(QCryptoBlockFormat format,
|
||||
OptsVisitor *ov;
|
||||
QCryptoBlockOpenOptions *ret = NULL;
|
||||
Error *local_err = NULL;
|
||||
Error *end_err = NULL;
|
||||
|
||||
ret = g_new0(QCryptoBlockOpenOptions, 1);
|
||||
ret->format = format;
|
||||
@@ -218,10 +219,9 @@ block_crypto_open_opts_init(QCryptoBlockFormat format,
|
||||
error_setg(&local_err, "Unsupported block format %d", format);
|
||||
break;
|
||||
}
|
||||
error_propagate(errp, local_err);
|
||||
local_err = NULL;
|
||||
|
||||
visit_end_struct(opts_get_visitor(ov), &local_err);
|
||||
visit_end_struct(opts_get_visitor(ov), &end_err);
|
||||
error_propagate(&local_err, end_err);
|
||||
|
||||
out:
|
||||
if (local_err) {
|
||||
@@ -242,6 +242,7 @@ block_crypto_create_opts_init(QCryptoBlockFormat format,
|
||||
OptsVisitor *ov;
|
||||
QCryptoBlockCreateOptions *ret = NULL;
|
||||
Error *local_err = NULL;
|
||||
Error *end_err = NULL;
|
||||
|
||||
ret = g_new0(QCryptoBlockCreateOptions, 1);
|
||||
ret->format = format;
|
||||
@@ -264,10 +265,9 @@ block_crypto_create_opts_init(QCryptoBlockFormat format,
|
||||
error_setg(&local_err, "Unsupported block format %d", format);
|
||||
break;
|
||||
}
|
||||
error_propagate(errp, local_err);
|
||||
local_err = NULL;
|
||||
|
||||
visit_end_struct(opts_get_visitor(ov), &local_err);
|
||||
visit_end_struct(opts_get_visitor(ov), &end_err);
|
||||
error_propagate(&local_err, end_err);
|
||||
|
||||
out:
|
||||
if (local_err) {
|
||||
|
||||
+12
@@ -2661,6 +2661,13 @@ void qmp_block_set_io_throttle(const char *device, int64_t bps, int64_t bps_rd,
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* The BlockBackend must be the only parent */
|
||||
assert(QLIST_FIRST(&bs->parents));
|
||||
if (QLIST_NEXT(QLIST_FIRST(&bs->parents), next_parent)) {
|
||||
error_setg(errp, "Cannot throttle device with multiple parents");
|
||||
goto out;
|
||||
}
|
||||
|
||||
throttle_config_init(&cfg);
|
||||
cfg.buckets[THROTTLE_BPS_TOTAL].avg = bps;
|
||||
cfg.buckets[THROTTLE_BPS_READ].avg = bps_rd;
|
||||
@@ -4027,6 +4034,11 @@ void qmp_x_blockdev_del(bool has_id, const char *id,
|
||||
error_setg(errp, "Cannot find block backend %s", id);
|
||||
return;
|
||||
}
|
||||
if (blk_legacy_dinfo(blk)) {
|
||||
error_setg(errp, "Deleting block backend added with drive-add"
|
||||
" is not supported");
|
||||
return;
|
||||
}
|
||||
if (blk_get_refcnt(blk) > 1) {
|
||||
error_setg(errp, "Block backend %s is in use", id);
|
||||
return;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/python
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat, Inc.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user