Skip to contentSkip to conversation

Fix two recent event regressions

PATCH Superseded Markus Armbruster 4 participants 9 messages Jun 27, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Fix two recent event regressions

This series plus Paolo's "[PATCH for 2.1] qdev: correctly send DEVICE_DELETED for recursively-deleted devices" makes qemu-iotests check -qcow2 again pass for me.

Luiz offered to take it through his tree.

Markus Armbruster (2):
blockjob: Fix recent BLOCK_JOB_READY regression
blockjob: Fix recent BLOCK_JOB_ERROR regression

 blockjob.c           | 8 ++++++--
 qapi/block-core.json | 8 ++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)
Signature · 1 line
1.9.3
#1 lore raw

PATCH 1/2 blockjob: Fix recent BLOCK_JOB_READY regression

Commit bcada37 dropped the (undocumented) members type, len, offset, speed, breaking tests/qemu-iotests/040 and 041.

Restore them. This fixes 040, and partially fixes 041.

---
 blockjob.c           | 6 +++++-
 qapi/block-core.json | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
blockjob.c +5 -1
index 4da86cd..37a8f1f 100644
@@ -256,7 +256,11 @@ void block_job_event_completed(BlockJob *job, const char *msg)
 
 void block_job_event_ready(BlockJob *job)
 {
-    qapi_event_send_block_job_ready(bdrv_get_device_name(job->bs), &error_abort);
+    qapi_event_send_block_job_ready(job->driver->job_type,
+                                    bdrv_get_device_name(job->bs),
+                                    job->len,
+                                    job->offset,
+                                    job->speed, &error_abort);
 }
 
 BlockErrorAction block_job_error_action(BlockJob *job, BlockDriverState *bs,
qapi/block-core.json +5 -1
index af6b436..8f42f24 100644
@@ -1559,4 +1559,8 @@
 # Since: 1.3
 ##
 { 'event': 'BLOCK_JOB_READY',
-  'data': { 'device': 'str' } }
+  'data': { 'type'  : 'BlockJobType',
+            'device': 'str',
+            'len'   : 'int',
+            'offset': 'int',
+            'speed' : 'int' } }
Signature · 1 line
1.9.3
#5 lore raw

PATCH 2/2 blockjob: Fix recent BLOCK_JOB_ERROR regression

In reply to Markus Armbruster

Commit 5a2d2cb screwed up the the value of members device and action, breaking tests/qemu-iotests/041.

---
 blockjob.c           | 2 +-
 qapi/block-core.json | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
blockjob.c +1 -1
index 37a8f1f..4d8ff45 100644
@@ -286,7 +286,7 @@ BlockErrorAction block_job_error_action(BlockJob *job, BlockDriverState *bs,
     default:
         abort();
     }
-    qapi_event_send_block_job_error(bdrv_get_device_name(bs),
+    qapi_event_send_block_job_error(bdrv_get_device_name(job->bs),
                                     is_read ? IO_OPERATION_TYPE_READ :
                                     IO_OPERATION_TYPE_WRITE,
                                     action, &error_abort);
qapi/block-core.json +1 -1
index 8f42f24..c339d05 100644
@@ -1544,7 +1544,7 @@
 { 'event': 'BLOCK_JOB_ERROR',
   'data': { 'device'   : 'str',
             'operation': 'IoOperationType',
-            'action'   : 'BlockdevOnError' } }
+            'action'   : 'BlockErrorAction' } }
 
 ##
 # @BLOCK_JOB_READY
Signature · 1 line
1.9.3
Tested-by Benoit Canet on the v1 series
#7 lore raw
In reply to Markus Armbruster
Quoted 6 lines · Markus Armbruster

This series plus Paolo's "[PATCH for 2.1] qdev: correctly send DEVICE_DELETED for recursively-deleted devices" makes qemu-iotests check -qcow2 again pass for me.

Luiz offered to take it through his tree.

Quoted 12 lines

Markus Armbruster (2):
blockjob: Fix recent BLOCK_JOB_READY regression
blockjob: Fix recent BLOCK_JOB_ERROR regression

 blockjob.c           | 8 ++++++--
 qapi/block-core.json | 8 ++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)
Signature · 1 line
1.9.3

For what it worth.

#2 lore raw

Re: [Qemu-devel] [PATCH 2.1 1/2] blockjob: Fix recent BLOCK_JOB_READY regression

In reply to Markus Armbruster

Am 27.06.2014 um 15:47 hat Markus Armbruster geschrieben:

Quoted 33 lines

Commit bcada37 dropped the (undocumented) members type, len, offset, speed, breaking tests/qemu-iotests/040 and 041.

Restore them. This fixes 040, and partially fixes 041.

---
 blockjob.c           | 6 +++++-
 qapi/block-core.json | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
blockjob.c +5 -1
index 4da86cd..37a8f1f 100644
@@ -256,7 +256,11 @@ void block_job_event_completed(BlockJob *job, const char *msg)
 
 void block_job_event_ready(BlockJob *job)
 {
-    qapi_event_send_block_job_ready(bdrv_get_device_name(job->bs), &error_abort);
+    qapi_event_send_block_job_ready(job->driver->job_type,
+                                    bdrv_get_device_name(job->bs),
+                                    job->len,
+                                    job->offset,
+                                    job->speed, &error_abort);
 }
 
 BlockErrorAction block_job_error_action(BlockJob *job, BlockDriverState *bs,
qapi/block-core.json +0 -0
index af6b436..8f42f24 100644

qapi/block-core.json line 1566

Quoted 9 lines
qapi/block-core.json +5 -1
@@ -1559,4 +1559,8 @@
 # Since: 1.3
 ##
 { 'event': 'BLOCK_JOB_READY',
-  'data': { 'device': 'str' } }
+  'data': { 'type'  : 'BlockJobType',
+            'device': 'str',
+            'len'   : 'int',
+            'offset': 'int',
+            'speed' : 'int' } }

Please document the added fields in the comment above the definition.

Looks good otherwise.

Kevin

#3 lore raw

Re: [Qemu-devel] [PATCH 2.1 1/2] blockjob: Fix recent BLOCK_JOB_READY regression

In reply to Kevin Wolf
Quoted 39 lines · Kevin Wolf

Am 27.06.2014 um 15:47 hat Markus Armbruster geschrieben:

Quoted 38 lines

Commit bcada37 dropped the (undocumented) members type, len, offset, speed, breaking tests/qemu-iotests/040 and 041.

Restore them. This fixes 040, and partially fixes 041.

---
 blockjob.c           | 6 +++++-
 qapi/block-core.json | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
blockjob.c +5 -1
index 4da86cd..37a8f1f 100644
@@ -256,7 +256,11 @@ void block_job_event_completed(BlockJob *job,
 const char *msg)
 
 void block_job_event_ready(BlockJob *job)
 {
- qapi_event_send_block_job_ready(bdrv_get_device_name(job->bs),
 &error_abort);
+    qapi_event_send_block_job_ready(job->driver->job_type,
+                                    bdrv_get_device_name(job->bs),
+                                    job->len,
+                                    job->offset,
+                                    job->speed, &error_abort);
 }

BlockErrorAction block_job_error_action(BlockJob *job, BlockDriverState *bs,

qapi/block-core.json +0 -0
index af6b436..8f42f24 100644
@@ -1559,4 +1559,8 @@
 # Since: 1.3
 ##
 { 'event': 'BLOCK_JOB_READY',
Quoted 8 lines

qapi/block-core.json line 1566

Quoted 6 lines
qapi/block-core.json +5 -1
-  'data': { 'device': 'str' } }
+  'data': { 'type'  : 'BlockJobType',
+            'device': 'str',
+            'len'   : 'int',
+            'offset': 'int',
+            'speed' : 'int' } }

Please document the added fields in the comment above the definition.

I hesistated, because it's not obvious to me whether we want all these members from a design point of view, and then I forgot in my haste to get the fix out.

Unwanted fields (if any) should be marked deprecated.

Anyway, I'll post a quick fix adding docs, for immediate commit. We can then discuss further doc changes. Plenty of time for those.

Quoted 1 line

Looks good otherwise.

Thanks!

#4 lore raw

Re: [Qemu-devel] [PATCH 2.1 1/2] blockjob: Fix recent BLOCK_JOB_READY regression

In reply to Kevin Wolf
Quoted 37 lines · On Fri, 27 Jun 2014 18:28:47 +0200 Kevin Wolf <[email protected]> wrote:

Am 27.06.2014 um 15:47 hat Markus Armbruster geschrieben:

Quoted 36 lines

Commit bcada37 dropped the (undocumented) members type, len, offset, speed, breaking tests/qemu-iotests/040 and 041.

Restore them. This fixes 040, and partially fixes 041.

---
 blockjob.c           | 6 +++++-
 qapi/block-core.json | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
blockjob.c +5 -1
index 4da86cd..37a8f1f 100644
@@ -256,7 +256,11 @@ void block_job_event_completed(BlockJob *job, const char *msg)
 
 void block_job_event_ready(BlockJob *job)
 {
-    qapi_event_send_block_job_ready(bdrv_get_device_name(job->bs), &error_abort);
+    qapi_event_send_block_job_ready(job->driver->job_type,
+                                    bdrv_get_device_name(job->bs),
+                                    job->len,
+                                    job->offset,
+                                    job->speed, &error_abort);
 }
 
 BlockErrorAction block_job_error_action(BlockJob *job, BlockDriverState *bs,
qapi/block-core.json +0 -0
index af6b436..8f42f24 100644
@@ -1559,4 +1559,8 @@
 # Since: 1.3
 ##
 { 'event': 'BLOCK_JOB_READY',
Quoted 8 lines

qapi/block-core.json line 1566

Quoted 6 lines
qapi/block-core.json +5 -1
-  'data': { 'device': 'str' } }
+  'data': { 'type'  : 'BlockJobType',
+            'device': 'str',
+            'len'   : 'int',
+            'offset': 'int',
+            'speed' : 'int' } }

Please document the added fields in the comment above the definition.

We have to add them to docs/qmp/qmp-events.txt too.

Markus, you can add a diff in this thread and I'll squash it with the patch.

Reviewed-by on the v1 series
#8 lore raw
In reply to Markus Armbruster
Quoted 5 lines · On Fri, 27 Jun 2014 15:47:20 +0200 Markus Armbruster <[email protected]> wrote:

This series plus Paolo's "[PATCH for 2.1] qdev: correctly send DEVICE_DELETED for recursively-deleted devices" makes qemu-iotests check -qcow2 again pass for me.

Luiz offered to take it through his tree.

Kevin is going to take them via block tree:

Quoted 9 lines

Markus Armbruster (2):
blockjob: Fix recent BLOCK_JOB_READY regression
blockjob: Fix recent BLOCK_JOB_ERROR regression

 blockjob.c           | 8 ++++++--
 qapi/block-core.json | 8 ++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)