[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 47/56] blockjob: Make BlockJobInfo and event off
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [RFC PATCH 47/56] blockjob: Make BlockJobInfo and event offsets unsigned in QAPI/QMP |
Date: |
Mon, 7 Aug 2017 16:45:51 +0200 |
File offsets should use QAPI type 'size' (uint64_t). BlockJobInfo
members @len, offset and parameters @len, @offset of events
BLOCK_JOB_COMPLETED, BLOCK_JOB_CANCELLED, BLOCK_JOB_READY are 'int'
(int64_t). block_job_query(), block_job_event_completed(),
block_job_event_cancelled(), block_job_event_ready() get them from
BlockJob members @len and @offset, which are int64_t, but should never
be negative.
Change the BlockJobInfo members and the event parameters to 'size',
for QAPI/QMP consistency.
Signed-off-by: Markus Armbruster <address@hidden>
---
hmp.c | 8 ++++----
qapi/block-core.json | 16 ++++++++--------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/hmp.c b/hmp.c
index fae974e..867c50b 100644
--- a/hmp.c
+++ b/hmp.c
@@ -966,16 +966,16 @@ void hmp_info_block_jobs(Monitor *mon, const QDict *qdict)
while (list) {
if (strcmp(list->value->type, "stream") == 0) {
- monitor_printf(mon, "Streaming device %s: Completed %" PRId64
- " of %" PRId64 " bytes, speed limit %" PRIu64
+ monitor_printf(mon, "Streaming device %s: Completed %" PRIu64
+ " of %" PRIu64 " bytes, speed limit %" PRIu64
" bytes/s\n",
list->value->device,
list->value->offset,
list->value->len,
list->value->speed);
} else {
- monitor_printf(mon, "Type %s, device %s: Completed %" PRId64
- " of %" PRId64 " bytes, speed limit %" PRIu64
+ monitor_printf(mon, "Type %s, device %s: Completed %" PRIu64
+ " of %" PRIu64 " bytes, speed limit %" PRIu64
" bytes/s\n",
list->value->type,
list->value->device,
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 9e9f2d8..b8442f3 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -955,8 +955,8 @@
# Since: 1.1
##
{ 'struct': 'BlockJobInfo',
- 'data': {'type': 'str', 'device': 'str', 'len': 'int',
- 'offset': 'int', 'busy': 'bool', 'paused': 'bool',
+ 'data': {'type': 'str', 'device': 'str', 'len': 'size',
+ 'offset': 'size', 'busy': 'bool', 'paused': 'bool',
'speed': 'size',
'io-status': 'BlockDeviceIoStatus', 'ready': 'bool'} }
@@ -3606,8 +3606,8 @@
{ 'event': 'BLOCK_JOB_COMPLETED',
'data': { 'type' : 'BlockJobType',
'device': 'str',
- 'len' : 'int',
- 'offset': 'int',
+ 'len' : 'size',
+ 'offset': 'size',
'speed' : 'size',
'*error': 'str' } }
@@ -3642,8 +3642,8 @@
{ 'event': 'BLOCK_JOB_CANCELLED',
'data': { 'type' : 'BlockJobType',
'device': 'str',
- 'len' : 'int',
- 'offset': 'int',
+ 'len' : 'size',
+ 'offset': 'size',
'speed' : 'size' } }
##
@@ -3707,8 +3707,8 @@
{ 'event': 'BLOCK_JOB_READY',
'data': { 'type' : 'BlockJobType',
'device': 'str',
- 'len' : 'int',
- 'offset': 'int',
+ 'len' : 'size',
+ 'offset': 'size',
'speed' : 'size' } }
##
--
2.7.5
- Re: [Qemu-devel] [RFC PATCH 12/56] pc-dimm: Make size and address unsigned in QAPI/QMP, (continued)
[Qemu-devel] [RFC PATCH 26/56] block: Make BlockMeasureInfo sizes unsigned in QAPI, Markus Armbruster, 2017/08/07
[Qemu-devel] [RFC PATCH 52/56] block/nfs: Reject negative readahead-size, page-cache-size, Markus Armbruster, 2017/08/07
[Qemu-devel] [RFC PATCH 31/56] block: Make throttle byte rates and sizes unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
[Qemu-devel] [RFC PATCH 40/56] blockjob: Lift speed sign conversion out of backup_job_create(), Markus Armbruster, 2017/08/07
[Qemu-devel] [RFC PATCH 47/56] blockjob: Make BlockJobInfo and event offsets unsigned in QAPI/QMP,
Markus Armbruster <=
[Qemu-devel] [RFC PATCH 44/56] blockjob: Lift speed sign conversion out of blockdev_mirror_common(), Markus Armbruster, 2017/08/07
[Qemu-devel] [RFC PATCH 30/56] block: Make write thresholds unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
[Qemu-devel] [RFC PATCH 45/56] blockjob: Lift speed sign conversion out of commit_start() etc., Markus Armbruster, 2017/08/07
[Qemu-devel] [RFC PATCH 23/56] option: Fix type of qemu_opt_set_number() parameter @val, Markus Armbruster, 2017/08/07
[Qemu-devel] [RFC PATCH 29/56] block: Make BlockDirtyInfo byte count unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
[Qemu-devel] [RFC PATCH 43/56] blockjob: Lift speed sign conversion out of mirror_start(), Markus Armbruster, 2017/08/07
[Qemu-devel] [RFC PATCH 50/56] block: Make BLOCK_IMAGE_CORRUPTED offset, size unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
[Qemu-devel] [RFC PATCH 56/56] crypto: Make QCryptoBlockInfoLUKS offsets unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07