aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-06-23 10:38:00 +0100
committerPeter Maydell <peter.maydell@linaro.org>2015-06-23 10:38:00 +0100
commita3206972a9eab65ec8e8f9ae320ad628ba4b58f1 (patch)
treef5109b0cced9784dde30aa2877aea30651933eee /block
parent0c8ff723bd29e5c8b2ca989f857ae5c37ec49c4e (diff)
parenta0b1a66ea39bca011108734147a72232a4d08c7a (diff)
downloadqemu-a3206972a9eab65ec8e8f9ae320ad628ba4b58f1.zip
qemu-a3206972a9eab65ec8e8f9ae320ad628ba4b58f1.tar.gz
qemu-a3206972a9eab65ec8e8f9ae320ad628ba4b58f1.tar.bz2
Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2015-06-22' into staging
Monitor patches # gpg: Signature made Mon Jun 22 18:56:18 2015 BST using RSA key ID EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" * remotes/armbru/tags/pull-monitor-2015-06-22: (24 commits) Include monitor/monitor.h exactly where needed Include qapi/qmp/qerror.h exactly where needed qerror: Move #include out of qerror.h qerror: Finally unused, clean up qmp: Wean off qerror_report() tpm: Avoid qerror_report() outside QMP command handlers qerror: Clean up QERR_ macros to expand into a single string qerror: Eliminate QERR_DEVICE_NOT_FOUND vl: Use error_report() for --display errors vl: Avoid qerror_report() outside QMP command handlers QemuOpts: Wean off qerror_report_err() qdev-monitor: Propagate errors through qdev_device_add() qdev-monitor: Propagate errors through set_property() qdev-monitor: Convert qbus_find() to Error qdev-monitor: Fix check for full bus qdev-monitor: Stop error avalanche in qbus_find_recursive() disas: Remove uses of CPU env monitor: Split mon_get_cpu fn to remove ENV_GET_CPU monitor: Fix failure path for "S" argument monitor: Point to "help" command on syntax error ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'block')
-rw-r--r--block/backup.c5
-rw-r--r--block/commit.c3
-rw-r--r--block/curl.c1
-rw-r--r--block/dmg.c1
-rw-r--r--block/io.c1
-rw-r--r--block/iscsi.c1
-rw-r--r--block/mirror.c9
-rw-r--r--block/qapi.c8
-rw-r--r--block/qcow.c5
-rw-r--r--block/qcow2-snapshot.c1
-rw-r--r--block/qcow2.c4
-rw-r--r--block/qed.c4
-rw-r--r--block/quorum.c9
-rw-r--r--block/raw-posix.c2
-rw-r--r--block/raw-win32.c1
-rw-r--r--block/snapshot.c5
-rw-r--r--block/ssh.c2
-rw-r--r--block/stream.c5
-rw-r--r--block/vhdx-log.c1
-rw-r--r--block/vmdk.c14
-rw-r--r--block/vvfat.c5
21 files changed, 51 insertions, 36 deletions
diff --git a/block/backup.c b/block/backup.c
index d3f648d..4a1af68 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -19,6 +19,7 @@
#include "block/block.h"
#include "block/block_int.h"
#include "block/blockjob.h"
+#include "qapi/qmp/qerror.h"
#include "qemu/ratelimit.h"
#define BACKUP_CLUSTER_BITS 16
@@ -197,7 +198,7 @@ static void backup_set_speed(BlockJob *job, int64_t speed, Error **errp)
BackupBlockJob *s = container_of(job, BackupBlockJob, common);
if (speed < 0) {
- error_set(errp, QERR_INVALID_PARAMETER, "speed");
+ error_setg(errp, QERR_INVALID_PARAMETER, "speed");
return;
}
ratelimit_set_speed(&s->limit, speed / BDRV_SECTOR_SIZE, SLICE_TIME);
@@ -472,7 +473,7 @@ void backup_start(BlockDriverState *bs, BlockDriverState *target,
if ((on_source_error == BLOCKDEV_ON_ERROR_STOP ||
on_source_error == BLOCKDEV_ON_ERROR_ENOSPC) &&
!bdrv_iostatus_is_enabled(bs)) {
- error_set(errp, QERR_INVALID_PARAMETER, "on-source-error");
+ error_setg(errp, QERR_INVALID_PARAMETER, "on-source-error");
return;
}
diff --git a/block/commit.c b/block/commit.c
index cfa2bbe..7312a5b 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -15,6 +15,7 @@
#include "trace.h"
#include "block/block_int.h"
#include "block/blockjob.h"
+#include "qapi/qmp/qerror.h"
#include "qemu/ratelimit.h"
enum {
@@ -186,7 +187,7 @@ static void commit_set_speed(BlockJob *job, int64_t speed, Error **errp)
CommitBlockJob *s = container_of(job, CommitBlockJob, common);
if (speed < 0) {
- error_set(errp, QERR_INVALID_PARAMETER, "speed");
+ error_setg(errp, QERR_INVALID_PARAMETER, "speed");
return;
}
ratelimit_set_speed(&s->limit, speed / BDRV_SECTOR_SIZE, SLICE_TIME);
diff --git a/block/curl.c b/block/curl.c
index bbee3ca..3a2b63e 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -24,6 +24,7 @@
#include "qemu-common.h"
#include "block/block_int.h"
#include "qapi/qmp/qbool.h"
+#include "qapi/qmp/qstring.h"
#include <curl/curl.h>
// #define DEBUG_CURL
diff --git a/block/dmg.c b/block/dmg.c
index 825c49d..9f25281 100644
--- a/block/dmg.c
+++ b/block/dmg.c
@@ -24,6 +24,7 @@
#include "qemu-common.h"
#include "block/block_int.h"
#include "qemu/bswap.h"
+#include "qemu/error-report.h"
#include "qemu/module.h"
#include <zlib.h>
#ifdef CONFIG_BZIP2
diff --git a/block/io.c b/block/io.c
index bb4f787..9cc729b 100644
--- a/block/io.c
+++ b/block/io.c
@@ -26,6 +26,7 @@
#include "block/blockjob.h"
#include "block/block_int.h"
#include "block/throttle-groups.h"
+#include "qemu/error-report.h"
#define NOT_DONE 0x7fffffff /* used while emulated sync operation in progress */
diff --git a/block/iscsi.c b/block/iscsi.c
index 14e97a6..5f7b60c 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -38,6 +38,7 @@
#include "qemu/iov.h"
#include "sysemu/sysemu.h"
#include "qmp-commands.h"
+#include "qapi/qmp/qstring.h"
#include <iscsi/iscsi.h>
#include <iscsi/scsi-lowlevel.h>
diff --git a/block/mirror.c b/block/mirror.c
index 58f391a..048e452 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -14,6 +14,7 @@
#include "trace.h"
#include "block/blockjob.h"
#include "block/block_int.h"
+#include "qapi/qmp/qerror.h"
#include "qemu/ratelimit.h"
#include "qemu/bitmap.h"
@@ -573,7 +574,7 @@ static void mirror_set_speed(BlockJob *job, int64_t speed, Error **errp)
MirrorBlockJob *s = container_of(job, MirrorBlockJob, common);
if (speed < 0) {
- error_set(errp, QERR_INVALID_PARAMETER, "speed");
+ error_setg(errp, QERR_INVALID_PARAMETER, "speed");
return;
}
ratelimit_set_speed(&s->limit, speed / BDRV_SECTOR_SIZE, SLICE_TIME);
@@ -598,8 +599,8 @@ static void mirror_complete(BlockJob *job, Error **errp)
return;
}
if (!s->synced) {
- error_set(errp, QERR_BLOCK_JOB_NOT_READY,
- bdrv_get_device_name(job->bs));
+ error_setg(errp, QERR_BLOCK_JOB_NOT_READY,
+ bdrv_get_device_name(job->bs));
return;
}
@@ -667,7 +668,7 @@ static void mirror_start_job(BlockDriverState *bs, BlockDriverState *target,
if ((on_source_error == BLOCKDEV_ON_ERROR_STOP ||
on_source_error == BLOCKDEV_ON_ERROR_ENOSPC) &&
!bdrv_iostatus_is_enabled(bs)) {
- error_set(errp, QERR_INVALID_PARAMETER, "on-source-error");
+ error_setg(errp, QERR_INVALID_PARAMETER, "on-source-error");
return;
}
diff --git a/block/qapi.c b/block/qapi.c
index a738148..2ce5097 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -520,13 +520,7 @@ static void dump_qobject(fprintf_function func_fprintf, void *f,
}
case QTYPE_QBOOL: {
QBool *value = qobject_to_qbool(obj);
- func_fprintf(f, "%s", qbool_get_int(value) ? "true" : "false");
- break;
- }
- case QTYPE_QERROR: {
- QString *value = qerror_human((QError *)obj);
- func_fprintf(f, "%s", qstring_get_str(value));
- QDECREF(value);
+ func_fprintf(f, "%s", qbool_get_bool(value) ? "true" : "false");
break;
}
default:
diff --git a/block/qcow.c b/block/qcow.c
index 911e59f..733627f 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -25,6 +25,7 @@
#include "block/block_int.h"
#include "qemu/module.h"
#include <zlib.h>
+#include "qapi/qmp/qerror.h"
#include "qemu/aes.h"
#include "migration/migration.h"
@@ -123,8 +124,8 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
char version[64];
snprintf(version, sizeof(version), "QCOW version %" PRIu32,
header.version);
- error_set(errp, QERR_UNKNOWN_BLOCK_FORMAT_FEATURE,
- bdrv_get_device_or_node_name(bs), "qcow", version);
+ error_setg(errp, QERR_UNKNOWN_BLOCK_FORMAT_FEATURE,
+ bdrv_get_device_or_node_name(bs), "qcow", version);
ret = -ENOTSUP;
goto fail;
}
diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c
index 17bb211..b6f58c1 100644
--- a/block/qcow2-snapshot.c
+++ b/block/qcow2-snapshot.c
@@ -25,6 +25,7 @@
#include "qemu-common.h"
#include "block/block_int.h"
#include "block/qcow2.h"
+#include "qemu/error-report.h"
void qcow2_free_snapshots(BlockDriverState *bs)
{
diff --git a/block/qcow2.c b/block/qcow2.c
index c4f6938..d522ec7 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -207,8 +207,8 @@ static void GCC_FMT_ATTR(3, 4) report_unsupported(BlockDriverState *bs,
vsnprintf(msg, sizeof(msg), fmt, ap);
va_end(ap);
- error_set(errp, QERR_UNKNOWN_BLOCK_FORMAT_FEATURE,
- bdrv_get_device_or_node_name(bs), "qcow2", msg);
+ error_setg(errp, QERR_UNKNOWN_BLOCK_FORMAT_FEATURE,
+ bdrv_get_device_or_node_name(bs), "qcow2", msg);
}
static void report_unsupported_feature(BlockDriverState *bs,
diff --git a/block/qed.c b/block/qed.c
index 5bbe069..954ed00 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -407,8 +407,8 @@ static int bdrv_qed_open(BlockDriverState *bs, QDict *options, int flags,
char buf[64];
snprintf(buf, sizeof(buf), "%" PRIx64,
s->header.features & ~QED_FEATURE_MASK);
- error_set(errp, QERR_UNKNOWN_BLOCK_FORMAT_FEATURE,
- bdrv_get_device_or_node_name(bs), "QED", buf);
+ error_setg(errp, QERR_UNKNOWN_BLOCK_FORMAT_FEATURE,
+ bdrv_get_device_or_node_name(bs), "QED", buf);
return -ENOTSUP;
}
if (!qed_is_cluster_size_valid(s->header.cluster_size)) {
diff --git a/block/quorum.c b/block/quorum.c
index 77e55b2..a7df17c 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -18,6 +18,7 @@
#include "block/block_int.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qdict.h"
+#include "qapi/qmp/qerror.h"
#include "qapi/qmp/qint.h"
#include "qapi/qmp/qjson.h"
#include "qapi/qmp/qlist.h"
@@ -800,8 +801,8 @@ static int quorum_valid_threshold(int threshold, int num_children, Error **errp)
{
if (threshold < 1) {
- error_set(errp, QERR_INVALID_PARAMETER_VALUE,
- "vote-threshold", "value >= 1");
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
+ "vote-threshold", "value >= 1");
return -ERANGE;
}
@@ -1024,9 +1025,9 @@ static void quorum_refresh_filename(BlockDriverState *bs)
qdict_put_obj(opts, QUORUM_OPT_VOTE_THRESHOLD,
QOBJECT(qint_from_int(s->threshold)));
qdict_put_obj(opts, QUORUM_OPT_BLKVERIFY,
- QOBJECT(qbool_from_int(s->is_blkverify)));
+ QOBJECT(qbool_from_bool(s->is_blkverify)));
qdict_put_obj(opts, QUORUM_OPT_REWRITE,
- QOBJECT(qbool_from_int(s->rewrite_corrupted)));
+ QOBJECT(qbool_from_bool(s->rewrite_corrupted)));
qdict_put_obj(opts, "children", QOBJECT(children));
bs->full_open_options = opts;
diff --git a/block/raw-posix.c b/block/raw-posix.c
index 44ade8c..a967464 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -22,6 +22,7 @@
* THE SOFTWARE.
*/
#include "qemu-common.h"
+#include "qemu/error-report.h"
#include "qemu/timer.h"
#include "qemu/log.h"
#include "block/block_int.h"
@@ -31,6 +32,7 @@
#include "qemu/iov.h"
#include "raw-aio.h"
#include "qapi/util.h"
+#include "qapi/qmp/qstring.h"
#if defined(__APPLE__) && (__MACH__)
#include <paths.h>
diff --git a/block/raw-win32.c b/block/raw-win32.c
index dae5d2f..68f2338 100644
--- a/block/raw-win32.c
+++ b/block/raw-win32.c
@@ -29,6 +29,7 @@
#include "trace.h"
#include "block/thread-pool.h"
#include "qemu/iov.h"
+#include "qapi/qmp/qstring.h"
#include <windows.h>
#include <winioctl.h>
diff --git a/block/snapshot.c b/block/snapshot.c
index 50ae610..19395ae 100644
--- a/block/snapshot.c
+++ b/block/snapshot.c
@@ -24,6 +24,7 @@
#include "block/snapshot.h"
#include "block/block_int.h"
+#include "qapi/qmp/qerror.h"
QemuOptsList internal_snapshot_opts = {
.name = "snapshot",
@@ -229,7 +230,7 @@ int bdrv_snapshot_delete(BlockDriverState *bs,
{
BlockDriver *drv = bs->drv;
if (!drv) {
- error_set(errp, QERR_DEVICE_HAS_NO_MEDIUM, bdrv_get_device_name(bs));
+ error_setg(errp, QERR_DEVICE_HAS_NO_MEDIUM, bdrv_get_device_name(bs));
return -ENOMEDIUM;
}
if (!snapshot_id && !name) {
@@ -315,7 +316,7 @@ int bdrv_snapshot_load_tmp(BlockDriverState *bs,
BlockDriver *drv = bs->drv;
if (!drv) {
- error_set(errp, QERR_DEVICE_HAS_NO_MEDIUM, bdrv_get_device_name(bs));
+ error_setg(errp, QERR_DEVICE_HAS_NO_MEDIUM, bdrv_get_device_name(bs));
return -ENOMEDIUM;
}
if (!snapshot_id && !name) {
diff --git a/block/ssh.c b/block/ssh.c
index f466cbf..aebb18c 100644
--- a/block/ssh.c
+++ b/block/ssh.c
@@ -30,9 +30,11 @@
#include <libssh2_sftp.h>
#include "block/block_int.h"
+#include "qemu/error-report.h"
#include "qemu/sockets.h"
#include "qemu/uri.h"
#include "qapi/qmp/qint.h"
+#include "qapi/qmp/qstring.h"
/* DEBUG_SSH=1 enables the DPRINTF (debugging printf) statements in
* this block driver code.
diff --git a/block/stream.c b/block/stream.c
index a628901..ab0bd05 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -14,6 +14,7 @@
#include "trace.h"
#include "block/block_int.h"
#include "block/blockjob.h"
+#include "qapi/qmp/qerror.h"
#include "qemu/ratelimit.h"
enum {
@@ -227,7 +228,7 @@ static void stream_set_speed(BlockJob *job, int64_t speed, Error **errp)
StreamBlockJob *s = container_of(job, StreamBlockJob, common);
if (speed < 0) {
- error_set(errp, QERR_INVALID_PARAMETER, "speed");
+ error_setg(errp, QERR_INVALID_PARAMETER, "speed");
return;
}
ratelimit_set_speed(&s->limit, speed / BDRV_SECTOR_SIZE, SLICE_TIME);
@@ -250,7 +251,7 @@ void stream_start(BlockDriverState *bs, BlockDriverState *base,
if ((on_error == BLOCKDEV_ON_ERROR_STOP ||
on_error == BLOCKDEV_ON_ERROR_ENOSPC) &&
!bdrv_iostatus_is_enabled(bs)) {
- error_set(errp, QERR_INVALID_PARAMETER, "on-error");
+ error_setg(errp, QERR_INVALID_PARAMETER, "on-error");
return;
}
diff --git a/block/vhdx-log.c b/block/vhdx-log.c
index 6547bec..47fec63 100644
--- a/block/vhdx-log.c
+++ b/block/vhdx-log.c
@@ -19,6 +19,7 @@
*/
#include "qemu-common.h"
#include "block/block_int.h"
+#include "qemu/error-report.h"
#include "qemu/module.h"
#include "block/vhdx.h"
diff --git a/block/vmdk.c b/block/vmdk.c
index be9263a..fbaab67 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -25,6 +25,8 @@
#include "qemu-common.h"
#include "block/block_int.h"
+#include "qapi/qmp/qerror.h"
+#include "qemu/error-report.h"
#include "qemu/module.h"
#include "migration/migration.h"
#include <zlib.h>
@@ -645,8 +647,8 @@ static int vmdk_open_vmdk4(BlockDriverState *bs,
char buf[64];
snprintf(buf, sizeof(buf), "VMDK version %" PRId32,
le32_to_cpu(header.version));
- error_set(errp, QERR_UNKNOWN_BLOCK_FORMAT_FEATURE,
- bdrv_get_device_or_node_name(bs), "vmdk", buf);
+ error_setg(errp, QERR_UNKNOWN_BLOCK_FORMAT_FEATURE,
+ bdrv_get_device_or_node_name(bs), "vmdk", buf);
return -ENOTSUP;
} else if (le32_to_cpu(header.version) == 3 && (flags & BDRV_O_RDWR)) {
/* VMware KB 2064959 explains that version 3 added support for
@@ -1688,12 +1690,12 @@ static int vmdk_create_extent(const char *filename, int64_t filesize,
/* write all the data */
ret = bdrv_pwrite(bs, 0, &magic, sizeof(magic));
if (ret < 0) {
- error_set(errp, QERR_IO_ERROR);
+ error_setg(errp, QERR_IO_ERROR);
goto exit;
}
ret = bdrv_pwrite(bs, sizeof(magic), &header, sizeof(header));
if (ret < 0) {
- error_set(errp, QERR_IO_ERROR);
+ error_setg(errp, QERR_IO_ERROR);
goto exit;
}
@@ -1713,7 +1715,7 @@ static int vmdk_create_extent(const char *filename, int64_t filesize,
ret = bdrv_pwrite(bs, le64_to_cpu(header.rgd_offset) * BDRV_SECTOR_SIZE,
gd_buf, gd_buf_size);
if (ret < 0) {
- error_set(errp, QERR_IO_ERROR);
+ error_setg(errp, QERR_IO_ERROR);
goto exit;
}
@@ -1725,7 +1727,7 @@ static int vmdk_create_extent(const char *filename, int64_t filesize,
ret = bdrv_pwrite(bs, le64_to_cpu(header.gd_offset) * BDRV_SECTOR_SIZE,
gd_buf, gd_buf_size);
if (ret < 0) {
- error_set(errp, QERR_IO_ERROR);
+ error_setg(errp, QERR_IO_ERROR);
goto exit;
}
diff --git a/block/vvfat.c b/block/vvfat.c
index e803589..c35550c 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -30,6 +30,7 @@
#include "migration/migration.h"
#include "qapi/qmp/qint.h"
#include "qapi/qmp/qbool.h"
+#include "qapi/qmp/qstring.h"
#ifndef S_IWGRP
#define S_IWGRP 0
@@ -1059,8 +1060,8 @@ static void vvfat_parse_filename(const char *filename, QDict *options,
/* Fill in the options QDict */
qdict_put(options, "dir", qstring_from_str(filename));
qdict_put(options, "fat-type", qint_from_int(fat_type));
- qdict_put(options, "floppy", qbool_from_int(floppy));
- qdict_put(options, "rw", qbool_from_int(rw));
+ qdict_put(options, "floppy", qbool_from_bool(floppy));
+ qdict_put(options, "rw", qbool_from_bool(rw));
}
static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,