diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-06-24 13:06:13 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-06-24 13:06:13 +0100 |
commit | 089a39486f2c47994c6c0d34ac7abf34baf40d9d (patch) | |
tree | 07bf9220989162df8d29b99568d13ce6d5261822 /block/qcow2-refcount.c | |
parent | 27acb9dd2407f41550e453b85aa5ebf1bd618b79 (diff) | |
parent | d622cb5879ca8006d5482158e4e3b272a068c301 (diff) | |
download | qemu-089a39486f2c47994c6c0d34ac7abf34baf40d9d.zip qemu-089a39486f2c47994c6c0d34ac7abf34baf40d9d.tar.gz qemu-089a39486f2c47994c6c0d34ac7abf34baf40d9d.tar.bz2 |
Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging
* remotes/qmp-unstable/queue/qmp: (43 commits)
monitor: protect event emission
monitor: protect outbuf and mux_out with mutex
qemu-char: make writes thread-safe
qemu-char: move pty_chr_update_read_handler around
qemu-char: do not call chr_write directly
qemu-char: introduce qemu_chr_alloc
qapi event: clean up
qapi event: convert QUORUM events
qapi event: convert GUEST_PANICKED
qapi event: convert BALLOON_CHANGE
qmp: convert ACPI_DEVICE_OST event
qapi event: convert SPICE events
qapi event: convert VNC events
qapi event: convert NIC_RX_FILTER_CHANGED
qapi event: convert other BLOCK_JOB events
qapi event: convert BLOCK_IMAGE_CORRUPTED
qapi event: convert BLOCK_IO_ERROR and BLOCK_JOB_ERROR
qapi event: convert DEVICE_TRAY_MOVED
qapi event: convert DEVICE_DELETED
qapi event: convert WATCHDOG
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'block/qcow2-refcount.c')
-rw-r--r-- | block/qcow2-refcount.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 9507aef..cc6cf74 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -27,6 +27,7 @@ #include "block/qcow2.h" #include "qemu/range.h" #include "qapi/qmp/types.h" +#include "qapi-event.h" static int64_t alloc_clusters_noref(BlockDriverState *bs, uint64_t size); static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs, @@ -1807,7 +1808,6 @@ int qcow2_pre_write_overlap_check(BlockDriverState *bs, int ign, int64_t offset, } else if (ret > 0) { int metadata_ol_bitnr = ffs(ret) - 1; char *message; - QObject *data; assert(metadata_ol_bitnr < QCOW2_OL_MAX_BITNR); @@ -1816,12 +1816,14 @@ int qcow2_pre_write_overlap_check(BlockDriverState *bs, int ign, int64_t offset, metadata_ol_names[metadata_ol_bitnr]); message = g_strdup_printf("Prevented %s overwrite", metadata_ol_names[metadata_ol_bitnr]); - data = qobject_from_jsonf("{ 'device': %s, 'msg': %s, 'offset': %" - PRId64 ", 'size': %" PRId64 " }", bs->device_name, message, - offset, size); - monitor_protocol_event(QEVENT_BLOCK_IMAGE_CORRUPTED, data); + qapi_event_send_block_image_corrupted(bdrv_get_device_name(bs), + message, + true, + offset, + true, + size, + &error_abort); g_free(message); - qobject_decref(data); qcow2_mark_corrupt(bs); bs->drv = NULL; /* make BDS unusable */ |