All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 2.1 0/3] Fix two recent event regressions
@ 2014-06-27 17:24 Markus Armbruster
  2014-06-27 17:24 ` [Qemu-devel] [PATCH v2 2.1 1/3] blockjob: Fix recent BLOCK_JOB_READY regression Markus Armbruster
                   ` (3 more replies)
  0 siblings, 4 replies; 26+ messages in thread
From: Markus Armbruster @ 2014-06-27 17:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, wenchaoqemu, lcapitulino, stefanha, pbonzini

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.

Kevin, Luiz, you decide how to best route these three patches.  Note
that PATCH 3 depends on Luiz's "[PATCH] qmp: add qmp-events.txt back".

v2:
* PATCH 1: Supply missing comments in schema [Kevin]
* PATCH 3: New [Luiz]

Markus Armbruster (3):
  blockjob: Fix recent BLOCK_JOB_READY regression
  blockjob: Fix recent BLOCK_JOB_ERROR regression
  docs/qmp: Fix documentation of BLOCK_JOB_READY to match code

 blockjob.c              |  8 ++++++--
 docs/qmp/qmp-events.txt | 12 ++++++++++--
 qapi/block-core.json    | 17 +++++++++++++++--
 3 files changed, 31 insertions(+), 6 deletions(-)

-- 
1.9.3

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Qemu-devel] [PATCH v2 2.1 1/3] blockjob: Fix recent BLOCK_JOB_READY regression
  2014-06-27 17:24 [Qemu-devel] [PATCH v2 2.1 0/3] Fix two recent event regressions Markus Armbruster
@ 2014-06-27 17:24 ` Markus Armbruster
  2014-07-01 17:08   ` Eric Blake
  2014-06-27 17:24 ` [Qemu-devel] [PATCH v2 2.1 2/3] blockjob: Fix recent BLOCK_JOB_ERROR regression Markus Armbruster
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 26+ messages in thread
From: Markus Armbruster @ 2014-06-27 17:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, wenchaoqemu, lcapitulino, stefanha, pbonzini

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

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

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Tested-By: Benoit Canet <benoit@irqsave.net>
---
 blockjob.c           |  6 +++++-
 qapi/block-core.json | 15 ++++++++++++++-
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/blockjob.c b/blockjob.c
index 4da86cd..37a8f1f 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -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,
diff --git a/qapi/block-core.json b/qapi/block-core.json
index af6b436..822fe16 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1551,12 +1551,25 @@
 #
 # Emitted when a block job is ready to complete
 #
+# @type: job type
+#
 # @device: device name
 #
+# @len: maximum progress value
+#
+# @offset: current progress value. On success this is equal to len.
+#          On failure this is less than len
+#
+# @speed: rate limit, bytes per second
+#
 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
 # event
 #
 # Since: 1.3
 ##
 { 'event': 'BLOCK_JOB_READY',
-  'data': { 'device': 'str' } }
+  'data': { 'type'  : 'BlockJobType',
+            'device': 'str',
+            'len'   : 'int',
+            'offset': 'int',
+            'speed' : 'int' } }
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Qemu-devel] [PATCH v2 2.1 2/3] blockjob: Fix recent BLOCK_JOB_ERROR regression
  2014-06-27 17:24 [Qemu-devel] [PATCH v2 2.1 0/3] Fix two recent event regressions Markus Armbruster
  2014-06-27 17:24 ` [Qemu-devel] [PATCH v2 2.1 1/3] blockjob: Fix recent BLOCK_JOB_READY regression Markus Armbruster
@ 2014-06-27 17:24 ` Markus Armbruster
  2014-07-01 14:42   ` Wenchao Xia
  2014-06-27 17:24 ` [Qemu-devel] [PATCH v2 2.1 3/3] docs/qmp: Fix documentation of BLOCK_JOB_READY to match code Markus Armbruster
  2014-06-27 18:37 ` [Qemu-devel] [PATCH v2 2.1 0/3] Fix two recent event regressions Kevin Wolf
  3 siblings, 1 reply; 26+ messages in thread
From: Markus Armbruster @ 2014-06-27 17:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, wenchaoqemu, lcapitulino, stefanha, pbonzini

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

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Tested-By: Benoit Canet <benoit@irqsave.net>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 blockjob.c           | 2 +-
 qapi/block-core.json | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/blockjob.c b/blockjob.c
index 37a8f1f..4d8ff45 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -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);
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 822fe16..fd5b579 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1544,7 +1544,7 @@
 { 'event': 'BLOCK_JOB_ERROR',
   'data': { 'device'   : 'str',
             'operation': 'IoOperationType',
-            'action'   : 'BlockdevOnError' } }
+            'action'   : 'BlockErrorAction' } }
 
 ##
 # @BLOCK_JOB_READY
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Qemu-devel] [PATCH v2 2.1 3/3] docs/qmp: Fix documentation of BLOCK_JOB_READY to match code
  2014-06-27 17:24 [Qemu-devel] [PATCH v2 2.1 0/3] Fix two recent event regressions Markus Armbruster
  2014-06-27 17:24 ` [Qemu-devel] [PATCH v2 2.1 1/3] blockjob: Fix recent BLOCK_JOB_READY regression Markus Armbruster
  2014-06-27 17:24 ` [Qemu-devel] [PATCH v2 2.1 2/3] blockjob: Fix recent BLOCK_JOB_ERROR regression Markus Armbruster
@ 2014-06-27 17:24 ` Markus Armbruster
  2014-06-27 17:42   ` Luiz Capitulino
  2014-07-01 17:12   ` Eric Blake
  2014-06-27 18:37 ` [Qemu-devel] [PATCH v2 2.1 0/3] Fix two recent event regressions Kevin Wolf
  3 siblings, 2 replies; 26+ messages in thread
From: Markus Armbruster @ 2014-06-27 17:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, wenchaoqemu, lcapitulino, stefanha, pbonzini

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 docs/qmp/qmp-events.txt | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/docs/qmp/qmp-events.txt b/docs/qmp/qmp-events.txt
index 22fea58..44be891 100644
--- a/docs/qmp/qmp-events.txt
+++ b/docs/qmp/qmp-events.txt
@@ -157,12 +157,20 @@ Emitted when a block job is ready to complete.
 
 Data:
 
-- "device": device name (json-string)
+- "type":     Job type (json-string; "stream" for image streaming
+                                     "commit" for block commit)
+- "device":   Device name (json-string)
+- "len":      Maximum progress value (json-int)
+- "offset":   Current progress value (json-int)
+              On success this is equal to len.
+              On failure this is less than len.
+- "speed":    Rate limit, bytes per second (json-int)
 
 Example:
 
 { "event": "BLOCK_JOB_READY",
-    "data": { "device": "ide0-hd1" },
+    "data": { "device": "drive0", "type": "mirror", "speed": 0,
+              "len": 2097152, "offset": 2097152 }
     "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
 
 Note: The "ready to complete" status is always reset by a BLOCK_JOB_ERROR
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 3/3] docs/qmp: Fix documentation of BLOCK_JOB_READY to match code
  2014-06-27 17:24 ` [Qemu-devel] [PATCH v2 2.1 3/3] docs/qmp: Fix documentation of BLOCK_JOB_READY to match code Markus Armbruster
@ 2014-06-27 17:42   ` Luiz Capitulino
  2014-07-01 17:12   ` Eric Blake
  1 sibling, 0 replies; 26+ messages in thread
From: Luiz Capitulino @ 2014-06-27 17:42 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: kwolf, wenchaoqemu, qemu-devel, stefanha, pbonzini

On Fri, 27 Jun 2014 19:24:15 +0200
Markus Armbruster <armbru@redhat.com> wrote:

> Signed-off-by: Markus Armbruster <armbru@redhat.com>

I've cherry picked this one as this file only exists in qmp tree.

> ---
>  docs/qmp/qmp-events.txt | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/docs/qmp/qmp-events.txt b/docs/qmp/qmp-events.txt
> index 22fea58..44be891 100644
> --- a/docs/qmp/qmp-events.txt
> +++ b/docs/qmp/qmp-events.txt
> @@ -157,12 +157,20 @@ Emitted when a block job is ready to complete.
>  
>  Data:
>  
> -- "device": device name (json-string)
> +- "type":     Job type (json-string; "stream" for image streaming
> +                                     "commit" for block commit)
> +- "device":   Device name (json-string)
> +- "len":      Maximum progress value (json-int)
> +- "offset":   Current progress value (json-int)
> +              On success this is equal to len.
> +              On failure this is less than len.
> +- "speed":    Rate limit, bytes per second (json-int)
>  
>  Example:
>  
>  { "event": "BLOCK_JOB_READY",
> -    "data": { "device": "ide0-hd1" },
> +    "data": { "device": "drive0", "type": "mirror", "speed": 0,
> +              "len": 2097152, "offset": 2097152 }
>      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
>  
>  Note: The "ready to complete" status is always reset by a BLOCK_JOB_ERROR

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 0/3] Fix two recent event regressions
  2014-06-27 17:24 [Qemu-devel] [PATCH v2 2.1 0/3] Fix two recent event regressions Markus Armbruster
                   ` (2 preceding siblings ...)
  2014-06-27 17:24 ` [Qemu-devel] [PATCH v2 2.1 3/3] docs/qmp: Fix documentation of BLOCK_JOB_READY to match code Markus Armbruster
@ 2014-06-27 18:37 ` Kevin Wolf
  3 siblings, 0 replies; 26+ messages in thread
From: Kevin Wolf @ 2014-06-27 18:37 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: wenchaoqemu, qemu-devel, lcapitulino, stefanha, pbonzini

Am 27.06.2014 um 19:24 hat Markus Armbruster geschrieben:
> 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.
> 
> Kevin, Luiz, you decide how to best route these three patches.  Note
> that PATCH 3 depends on Luiz's "[PATCH] qmp: add qmp-events.txt back".
> 
> v2:
> * PATCH 1: Supply missing comments in schema [Kevin]
> * PATCH 3: New [Luiz]

Thanks, applied patches 1 and 2 to the block branch.

Kevin

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 2/3] blockjob: Fix recent BLOCK_JOB_ERROR regression
  2014-06-27 17:24 ` [Qemu-devel] [PATCH v2 2.1 2/3] blockjob: Fix recent BLOCK_JOB_ERROR regression Markus Armbruster
@ 2014-07-01 14:42   ` Wenchao Xia
  2014-07-01 16:46     ` Paolo Bonzini
  0 siblings, 1 reply; 26+ messages in thread
From: Wenchao Xia @ 2014-07-01 14:42 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: kwolf, pbonzini, stefanha, lcapitulino

于 2014/6/28 1:24, Markus Armbruster 写道:
> Commit 5a2d2cb screwed up the the value of members device and action,
> breaking tests/qemu-iotests/041.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> Tested-By: Benoit Canet <benoit@irqsave.net>
> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
> ---
>   blockjob.c           | 2 +-
>   qapi/block-core.json | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/blockjob.c b/blockjob.c
> index 37a8f1f..4d8ff45 100644
> --- a/blockjob.c
> +++ b/blockjob.c
> @@ -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);
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index 822fe16..fd5b579 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -1544,7 +1544,7 @@
>   { 'event': 'BLOCK_JOB_ERROR',
>     'data': { 'device'   : 'str',
>               'operation': 'IoOperationType',
> -            'action'   : 'BlockdevOnError' } }
> +            'action'   : 'BlockErrorAction' } }
>   
  It is my mistake to use BlockdevOnError in code incorrectly.
The define as 'BlockdevOnError' before is on purpose, since the
doc for 'BlockErrorAction' says: stop means a VM is stoped, but
for block-job it is not true, so I chosed a different type, and
'BlockdevOnError' seems the right one(see the doc for it). We can
fix it in C caller or add doc in .json file later.
  I am occupied by other things these days, thanks for fixing
the bugs introduced by me!


>   ##
>   # @BLOCK_JOB_READY
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 2/3] blockjob: Fix recent BLOCK_JOB_ERROR regression
  2014-07-01 14:42   ` Wenchao Xia
@ 2014-07-01 16:46     ` Paolo Bonzini
  2014-07-02  6:46       ` Markus Armbruster
  0 siblings, 1 reply; 26+ messages in thread
From: Paolo Bonzini @ 2014-07-01 16:46 UTC (permalink / raw)
  To: Wenchao Xia, Markus Armbruster, qemu-devel; +Cc: kwolf, stefanha, lcapitulino

Il 01/07/2014 16:42, Wenchao Xia ha scritto:
>> diff --git a/qapi/block-core.json b/qapi/block-core.json
>> index 822fe16..fd5b579 100644
>> --- a/qapi/block-core.json
>> +++ b/qapi/block-core.json
>> @@ -1544,7 +1544,7 @@
>>   { 'event': 'BLOCK_JOB_ERROR',
>>     'data': { 'device'   : 'str',
>>               'operation': 'IoOperationType',
>> -            'action'   : 'BlockdevOnError' } }
>> +            'action'   : 'BlockErrorAction' } }
>>   
>   It is my mistake to use BlockdevOnError in code incorrectly.
> The define as 'BlockdevOnError' before is on purpose, since the
> doc for 'BlockErrorAction' says: stop means a VM is stoped, but
> for block-job it is not true, so I chosed a different type, and
> 'BlockdevOnError' seems the right one(see the doc for it). We can
> fix it in C caller or add doc in .json file later.

I think consistency between BLOCK_IO_ERROR and BLOCK_JOB_ERROR is
better.  Let's fix the BlockErrorAction documentation instead.

Paolo

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 1/3] blockjob: Fix recent BLOCK_JOB_READY regression
  2014-06-27 17:24 ` [Qemu-devel] [PATCH v2 2.1 1/3] blockjob: Fix recent BLOCK_JOB_READY regression Markus Armbruster
@ 2014-07-01 17:08   ` Eric Blake
  2014-07-01 17:10     ` Paolo Bonzini
  0 siblings, 1 reply; 26+ messages in thread
From: Eric Blake @ 2014-07-01 17:08 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel
  Cc: kwolf, pbonzini, wenchaoqemu, stefanha, lcapitulino

[-- Attachment #1: Type: text/plain, Size: 1387 bytes --]

On 06/27/2014 11:24 AM, Markus Armbruster wrote:
> Commit bcada37 dropped the (up to now undocumented) members type, len,
> offset, speed, breaking tests/qemu-iotests/040 and 041.
> 
> Restore and document them.  This fixes 040, and partially fixes 041.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> Tested-By: Benoit Canet <benoit@irqsave.net>
> ---
>  blockjob.c           |  6 +++++-
>  qapi/block-core.json | 15 ++++++++++++++-
>  2 files changed, 19 insertions(+), 2 deletions(-)

Nothing wrong with this commit, but a design issue that I've recently
run into:

what happens if management misses the BLOCK_JOB_COMPLETED event?  How is
it supposed to learn whether the job succeeded or failed?
'query-blockjobs' no longer reports the job (because it is completed),
so all information about the job is lost.  Normally, we've tried hard to
make sure that all information learned from an event can also be polled
(the ideal is use of events to minimize cpu overhead, but to rely on the
poll in situations where events may have been lost such as on a libvirtd
restart).

Should we enhance job failure to be sticky, in that it not only causes
an event, but also remains around so that it can be reported in the next
'query-blockjobs'?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 1/3] blockjob: Fix recent BLOCK_JOB_READY regression
  2014-07-01 17:08   ` Eric Blake
@ 2014-07-01 17:10     ` Paolo Bonzini
  2014-07-02  6:55       ` Markus Armbruster
  0 siblings, 1 reply; 26+ messages in thread
From: Paolo Bonzini @ 2014-07-01 17:10 UTC (permalink / raw)
  To: Eric Blake, Markus Armbruster, qemu-devel
  Cc: kwolf, wenchaoqemu, stefanha, lcapitulino

Il 01/07/2014 19:08, Eric Blake ha scritto:
> On 06/27/2014 11:24 AM, Markus Armbruster wrote:
>> Commit bcada37 dropped the (up to now undocumented) members type, len,
>> offset, speed, breaking tests/qemu-iotests/040 and 041.
>>
>> Restore and document them.  This fixes 040, and partially fixes 041.
>>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> Tested-By: Benoit Canet <benoit@irqsave.net>
>> ---
>>  blockjob.c           |  6 +++++-
>>  qapi/block-core.json | 15 ++++++++++++++-
>>  2 files changed, 19 insertions(+), 2 deletions(-)
>
> Nothing wrong with this commit, but a design issue that I've recently
> run into:
>
> what happens if management misses the BLOCK_JOB_COMPLETED event?  How is
> it supposed to learn whether the job succeeded or failed?
> 'query-blockjobs' no longer reports the job (because it is completed),
> so all information about the job is lost.  Normally, we've tried hard to
> make sure that all information learned from an event can also be polled
> (the ideal is use of events to minimize cpu overhead, but to rely on the
> poll in situations where events may have been lost such as on a libvirtd
> restart).
>
> Should we enhance job failure to be sticky, in that it not only causes
> an event, but also remains around so that it can be reported in the next
> 'query-blockjobs'?

I think this fixes itself automatically if you use 
rerror=stop/werror=stop on block jobs.  At least that was part of the 
design, whether the implementation gets it right I cannot say without 
looking at the code more carefully.

Paolo

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 3/3] docs/qmp: Fix documentation of BLOCK_JOB_READY to match code
  2014-06-27 17:24 ` [Qemu-devel] [PATCH v2 2.1 3/3] docs/qmp: Fix documentation of BLOCK_JOB_READY to match code Markus Armbruster
  2014-06-27 17:42   ` Luiz Capitulino
@ 2014-07-01 17:12   ` Eric Blake
  2014-07-02  6:49     ` Markus Armbruster
  2014-07-02  7:55     ` Paolo Bonzini
  1 sibling, 2 replies; 26+ messages in thread
From: Eric Blake @ 2014-07-01 17:12 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel
  Cc: kwolf, pbonzini, wenchaoqemu, stefanha, lcapitulino

[-- Attachment #1: Type: text/plain, Size: 1534 bytes --]

On 06/27/2014 11:24 AM, Markus Armbruster wrote:
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  docs/qmp/qmp-events.txt | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/docs/qmp/qmp-events.txt b/docs/qmp/qmp-events.txt
> index 22fea58..44be891 100644
> --- a/docs/qmp/qmp-events.txt
> +++ b/docs/qmp/qmp-events.txt
> @@ -157,12 +157,20 @@ Emitted when a block job is ready to complete.
>  
>  Data:
>  
> -- "device": device name (json-string)
> +- "type":     Job type (json-string; "stream" for image streaming
> +                                     "commit" for block commit)
> +- "device":   Device name (json-string)
> +- "len":      Maximum progress value (json-int)
> +- "offset":   Current progress value (json-int)
> +              On success this is equal to len.
> +              On failure this is less than len.
> +- "speed":    Rate limit, bytes per second (json-int)
>  

Design question - if BLOCK_JOB_READY reports failure (that is, offset <
len), are we still guaranteed to get a BLOCK_JOB_COMPLETED that also
reports failure, or does 'query-blockjobs' completely forget about the
job? If the job is completely lost, what recourse does management have
to learn about the failure (that is, if libvirtd restarts, how will it
learn whether a previously running job was aborted due to an error, if
it missed the event)?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 2/3] blockjob: Fix recent BLOCK_JOB_ERROR regression
  2014-07-01 16:46     ` Paolo Bonzini
@ 2014-07-02  6:46       ` Markus Armbruster
  2014-07-02  8:20         ` Paolo Bonzini
  0 siblings, 1 reply; 26+ messages in thread
From: Markus Armbruster @ 2014-07-02  6:46 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: kwolf, lcapitulino, Wenchao Xia, stefanha, qemu-devel

Paolo Bonzini <pbonzini@redhat.com> writes:

> Il 01/07/2014 16:42, Wenchao Xia ha scritto:
>>> diff --git a/qapi/block-core.json b/qapi/block-core.json
>>> index 822fe16..fd5b579 100644
>>> --- a/qapi/block-core.json
>>> +++ b/qapi/block-core.json
>>> @@ -1544,7 +1544,7 @@
>>>   { 'event': 'BLOCK_JOB_ERROR',
>>>     'data': { 'device'   : 'str',
>>>               'operation': 'IoOperationType',
>>> -            'action'   : 'BlockdevOnError' } }
>>> +            'action'   : 'BlockErrorAction' } }
>>>   
>>   It is my mistake to use BlockdevOnError in code incorrectly.
>> The define as 'BlockdevOnError' before is on purpose, since the
>> doc for 'BlockErrorAction' says: stop means a VM is stoped, but
>> for block-job it is not true, so I chosed a different type, and
>> 'BlockdevOnError' seems the right one(see the doc for it). We can
>> fix it in C caller or add doc in .json file later.
>
> I think consistency between BLOCK_IO_ERROR and BLOCK_JOB_ERROR is
> better.

Moreover, BlockdevOnError's enospc is meaningless here.

>          Let's fix the BlockErrorAction documentation instead.

I didn't quite understand what's wrong with it; I expect a patch will
enlighten me :)

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 3/3] docs/qmp: Fix documentation of BLOCK_JOB_READY to match code
  2014-07-01 17:12   ` Eric Blake
@ 2014-07-02  6:49     ` Markus Armbruster
  2014-07-02  8:48       ` Kevin Wolf
  2014-07-02  7:55     ` Paolo Bonzini
  1 sibling, 1 reply; 26+ messages in thread
From: Markus Armbruster @ 2014-07-02  6:49 UTC (permalink / raw)
  To: Eric Blake
  Cc: kwolf, wenchaoqemu, qemu-devel, lcapitulino, stefanha, pbonzini

Eric Blake <eblake@redhat.com> writes:

> On 06/27/2014 11:24 AM, Markus Armbruster wrote:
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  docs/qmp/qmp-events.txt | 12 ++++++++++--
>>  1 file changed, 10 insertions(+), 2 deletions(-)
>> 
>> diff --git a/docs/qmp/qmp-events.txt b/docs/qmp/qmp-events.txt
>> index 22fea58..44be891 100644
>> --- a/docs/qmp/qmp-events.txt
>> +++ b/docs/qmp/qmp-events.txt
>> @@ -157,12 +157,20 @@ Emitted when a block job is ready to complete.
>>  
>>  Data:
>>  
>> -- "device": device name (json-string)
>> +- "type":     Job type (json-string; "stream" for image streaming
>> +                                     "commit" for block commit)
>> +- "device":   Device name (json-string)
>> +- "len":      Maximum progress value (json-int)
>> +- "offset":   Current progress value (json-int)
>> +              On success this is equal to len.
>> +              On failure this is less than len.
>> +- "speed":    Rate limit, bytes per second (json-int)
>>  
>
> Design question - if BLOCK_JOB_READY reports failure (that is, offset <
> len), are we still guaranteed to get a BLOCK_JOB_COMPLETED that also
> reports failure, or does 'query-blockjobs' completely forget about the
> job?

Good one.  It's underspecified, as far as I can tell.  First step to fix
that is to find out what the code does.

>      If the job is completely lost, what recourse does management have
> to learn about the failure (that is, if libvirtd restarts, how will it
> learn whether a previously running job was aborted due to an error, if
> it missed the event)?

Let's worry about that when we know what the code does.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 1/3] blockjob: Fix recent BLOCK_JOB_READY regression
  2014-07-01 17:10     ` Paolo Bonzini
@ 2014-07-02  6:55       ` Markus Armbruster
  2014-07-02  8:23         ` Paolo Bonzini
  0 siblings, 1 reply; 26+ messages in thread
From: Markus Armbruster @ 2014-07-02  6:55 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: kwolf, wenchaoqemu, qemu-devel, lcapitulino, stefanha

Paolo Bonzini <pbonzini@redhat.com> writes:

> Il 01/07/2014 19:08, Eric Blake ha scritto:
>> On 06/27/2014 11:24 AM, Markus Armbruster wrote:
>>> Commit bcada37 dropped the (up to now undocumented) members type, len,
>>> offset, speed, breaking tests/qemu-iotests/040 and 041.
>>>
>>> Restore and document them.  This fixes 040, and partially fixes 041.
>>>
>>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>>> Tested-By: Benoit Canet <benoit@irqsave.net>
>>> ---
>>>  blockjob.c           |  6 +++++-
>>>  qapi/block-core.json | 15 ++++++++++++++-
>>>  2 files changed, 19 insertions(+), 2 deletions(-)
>>
>> Nothing wrong with this commit, but a design issue that I've recently
>> run into:
>>
>> what happens if management misses the BLOCK_JOB_COMPLETED event?  How is
>> it supposed to learn whether the job succeeded or failed?
>> 'query-blockjobs' no longer reports the job (because it is completed),
>> so all information about the job is lost.  Normally, we've tried hard to
>> make sure that all information learned from an event can also be polled

Yes.  Every time we neglect that, we find out it's a design bug later.

We should review all events for pollability, and add "how to poll"
information to their documentation.  Then enforce presence of "how to
poll" information in review.

>> (the ideal is use of events to minimize cpu overhead, but to rely on the
>> poll in situations where events may have been lost such as on a libvirtd
>> restart).
>>
>> Should we enhance job failure to be sticky, in that it not only causes
>> an event, but also remains around so that it can be reported in the next
>> 'query-blockjobs'?
>
> I think this fixes itself automatically if you use
> rerror=stop/werror=stop on block jobs.  At least that was part of the
> design, whether the implementation gets it right I cannot say without
> looking at the code more carefully.

What if an underlying device doesn't support [rw]error=stop?  Not all
do...

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 3/3] docs/qmp: Fix documentation of BLOCK_JOB_READY to match code
  2014-07-01 17:12   ` Eric Blake
  2014-07-02  6:49     ` Markus Armbruster
@ 2014-07-02  7:55     ` Paolo Bonzini
  1 sibling, 0 replies; 26+ messages in thread
From: Paolo Bonzini @ 2014-07-02  7:55 UTC (permalink / raw)
  To: Eric Blake, Markus Armbruster, qemu-devel
  Cc: kwolf, wenchaoqemu, stefanha, lcapitulino

Il 01/07/2014 19:12, Eric Blake ha scritto:
> On 06/27/2014 11:24 AM, Markus Armbruster wrote:
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  docs/qmp/qmp-events.txt | 12 ++++++++++--
>>  1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/docs/qmp/qmp-events.txt b/docs/qmp/qmp-events.txt
>> index 22fea58..44be891 100644
>> --- a/docs/qmp/qmp-events.txt
>> +++ b/docs/qmp/qmp-events.txt
>> @@ -157,12 +157,20 @@ Emitted when a block job is ready to complete.
>>
>>  Data:
>>
>> -- "device": device name (json-string)
>> +- "type":     Job type (json-string; "stream" for image streaming
>> +                                     "commit" for block commit)
>> +- "device":   Device name (json-string)
>> +- "len":      Maximum progress value (json-int)
>> +- "offset":   Current progress value (json-int)
>> +              On success this is equal to len.
>> +              On failure this is less than len.
>> +- "speed":    Rate limit, bytes per second (json-int)
>>
>
> Design question - if BLOCK_JOB_READY reports failure (that is, offset <
> len), are we still guaranteed to get a BLOCK_JOB_COMPLETED that also
> reports failure, or does 'query-blockjobs' completely forget about the
> job? If the job is completely lost, what recourse does management have
> to learn about the failure (that is, if libvirtd restarts, how will it
> learn whether a previously running job was aborted due to an error, if
> it missed the event)?

If you use rerror=stop/werror=stop you do have the behavior you request. 
  The job will not abort, it will be paused and libvirt will be able to 
see the error.  In fact, that was the rationale for adding 
rerror=stop/werror=stop to streaming (where you can just restart a 
failed job and only have to do minimal extra work, unlike mirror and 
commit).

There may be a couple of holes in the logic (for example a failure in 
bdrv_change_backing_file), but they can be plugged if necessary.

Paolo

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 2/3] blockjob: Fix recent BLOCK_JOB_ERROR regression
  2014-07-02  6:46       ` Markus Armbruster
@ 2014-07-02  8:20         ` Paolo Bonzini
  0 siblings, 0 replies; 26+ messages in thread
From: Paolo Bonzini @ 2014-07-02  8:20 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: kwolf, lcapitulino, Wenchao Xia, stefanha, qemu-devel

Il 02/07/2014 08:46, Markus Armbruster ha scritto:
>> > I think consistency between BLOCK_IO_ERROR and BLOCK_JOB_ERROR is
>> > better.
> Moreover, BlockdevOnError's enospc is meaningless here.
>
>> >          Let's fix the BlockErrorAction documentation instead.
> I didn't quite understand what's wrong with it; I expect a patch will
> enlighten me :)

For BLOCK_JOB_ERROR, "stop" means the job is paused rather than the VM. 
  I have more documentation work queued for hard freeze, so you or 
Wenchao should feel free to submit this bit too. ;)

Paolo

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 1/3] blockjob: Fix recent BLOCK_JOB_READY regression
  2014-07-02  6:55       ` Markus Armbruster
@ 2014-07-02  8:23         ` Paolo Bonzini
  2014-07-02  8:44           ` Kevin Wolf
  2014-07-02 14:58           ` Markus Armbruster
  0 siblings, 2 replies; 26+ messages in thread
From: Paolo Bonzini @ 2014-07-02  8:23 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: kwolf, wenchaoqemu, qemu-devel, lcapitulino, stefanha

Il 02/07/2014 08:55, Markus Armbruster ha scritto:
>> > I think this fixes itself automatically if you use
>> > rerror=stop/werror=stop on block jobs.  At least that was part of the
>> > design, whether the implementation gets it right I cannot say without
>> > looking at the code more carefully.
> What if an underlying device doesn't support [rw]error=stop?  Not all
> do...

Then the "fix" is to add support to the underlying device.  IDE, SCSI 
and virtio-blk (plus virtio-scsi via SCSI of course) are covered; the 
main one that's left out is SD.

Paolo

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 1/3] blockjob: Fix recent BLOCK_JOB_READY regression
  2014-07-02  8:23         ` Paolo Bonzini
@ 2014-07-02  8:44           ` Kevin Wolf
  2014-07-02  8:59             ` Paolo Bonzini
  2014-07-02 14:58           ` Markus Armbruster
  1 sibling, 1 reply; 26+ messages in thread
From: Kevin Wolf @ 2014-07-02  8:44 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: wenchaoqemu, qemu-devel, Markus Armbruster, lcapitulino, stefanha

Am 02.07.2014 um 10:23 hat Paolo Bonzini geschrieben:
> Il 02/07/2014 08:55, Markus Armbruster ha scritto:
> >>> I think this fixes itself automatically if you use
> >>> rerror=stop/werror=stop on block jobs.  At least that was part of the
> >>> design, whether the implementation gets it right I cannot say without
> >>> looking at the code more carefully.
> >What if an underlying device doesn't support [rw]error=stop?  Not all
> >do...
> 
> Then the "fix" is to add support to the underlying device.  IDE,
> SCSI and virtio-blk (plus virtio-scsi via SCSI of course) are
> covered; the main one that's left out is SD.

Isn't block job rerror/werror completely independent from the guest
device using the same BDS? They are different users, so if we somehow
coupled them, that would be a design problem (which I think we were
careful enough to avoid).

Kevin

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 3/3] docs/qmp: Fix documentation of BLOCK_JOB_READY to match code
  2014-07-02  6:49     ` Markus Armbruster
@ 2014-07-02  8:48       ` Kevin Wolf
  0 siblings, 0 replies; 26+ messages in thread
From: Kevin Wolf @ 2014-07-02  8:48 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: wenchaoqemu, qemu-devel, lcapitulino, stefanha, pbonzini

Am 02.07.2014 um 08:49 hat Markus Armbruster geschrieben:
> Eric Blake <eblake@redhat.com> writes:
> 
> > On 06/27/2014 11:24 AM, Markus Armbruster wrote:
> >> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> >> ---
> >>  docs/qmp/qmp-events.txt | 12 ++++++++++--
> >>  1 file changed, 10 insertions(+), 2 deletions(-)
> >> 
> >> diff --git a/docs/qmp/qmp-events.txt b/docs/qmp/qmp-events.txt
> >> index 22fea58..44be891 100644
> >> --- a/docs/qmp/qmp-events.txt
> >> +++ b/docs/qmp/qmp-events.txt
> >> @@ -157,12 +157,20 @@ Emitted when a block job is ready to complete.
> >>  
> >>  Data:
> >>  
> >> -- "device": device name (json-string)
> >> +- "type":     Job type (json-string; "stream" for image streaming
> >> +                                     "commit" for block commit)
> >> +- "device":   Device name (json-string)
> >> +- "len":      Maximum progress value (json-int)
> >> +- "offset":   Current progress value (json-int)
> >> +              On success this is equal to len.
> >> +              On failure this is less than len.
> >> +- "speed":    Rate limit, bytes per second (json-int)
> >>  
> >
> > Design question - if BLOCK_JOB_READY reports failure (that is, offset <
> > len), are we still guaranteed to get a BLOCK_JOB_COMPLETED that also
> > reports failure, or does 'query-blockjobs' completely forget about the
> > job?
> 
> Good one.  It's underspecified, as far as I can tell.  First step to fix
> that is to find out what the code does.

As far as I can see, BLOCK_JOB_READY implies success up to the point
where the event was emitted. Should we document that len = offset in all
cases? Perhaps add an assertion to block_job_event_ready(), too?

Kevin

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 1/3] blockjob: Fix recent BLOCK_JOB_READY regression
  2014-07-02  8:44           ` Kevin Wolf
@ 2014-07-02  8:59             ` Paolo Bonzini
  0 siblings, 0 replies; 26+ messages in thread
From: Paolo Bonzini @ 2014-07-02  8:59 UTC (permalink / raw)
  To: Kevin Wolf
  Cc: wenchaoqemu, qemu-devel, Markus Armbruster, lcapitulino, stefanha

Il 02/07/2014 10:44, Kevin Wolf ha scritto:
>> > Then the "fix" is to add support to the underlying device.  IDE,
>> > SCSI and virtio-blk (plus virtio-scsi via SCSI of course) are
>> > covered; the main one that's left out is SD.
> Isn't block job rerror/werror completely independent from the guest
> device using the same BDS? They are different users, so if we somehow
> coupled them, that would be a design problem (which I think we were
> careful enough to avoid).

It is independent, but for some reason rerror/werror cannot be used on 
block jobs unless iostatus is enabled on the source BDS too.  Off-hand I 
don't remember why.

Paolo

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 1/3] blockjob: Fix recent BLOCK_JOB_READY regression
  2014-07-02  8:23         ` Paolo Bonzini
  2014-07-02  8:44           ` Kevin Wolf
@ 2014-07-02 14:58           ` Markus Armbruster
  2014-07-02 15:03             ` Paolo Bonzini
  1 sibling, 1 reply; 26+ messages in thread
From: Markus Armbruster @ 2014-07-02 14:58 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: kwolf, lcapitulino, wenchaoqemu, stefanha, qemu-devel

Paolo Bonzini <pbonzini@redhat.com> writes:

> Il 02/07/2014 08:55, Markus Armbruster ha scritto:
>>> > I think this fixes itself automatically if you use
>>> > rerror=stop/werror=stop on block jobs.  At least that was part of the
>>> > design, whether the implementation gets it right I cannot say without
>>> > looking at the code more carefully.
>> What if an underlying device doesn't support [rw]error=stop?  Not all
>> do...
>
> Then the "fix" is to add support to the underlying device.  IDE, SCSI
> and virtio-blk (plus virtio-scsi via SCSI of course) are covered;

Where "covered" means "device model calls bdrv_error_action() somewhere"
rather than "device model calls bdrv_error_action() exactly when it
should".

Case in point: SCSI calls it when UNMAP fails, but IDE doesn't call it
when TRIM fails.  IDE and virtio-blk call it for I/O beyond the end of
the medium, but SCSI doesn't.

This is of course fixable.  I'm working on it.

>                                                                   the
> main one that's left out is SD.

Qdevified devices with a qdev_prop_drive: isa-fdc, sysbus-fdc,
SUNW,fdtwo, nand, onenand, cfi.pflash01, cfi.pflash02, spapr-nvram,
scsi-generic, nvme.  SD isn't in this list, because it still hasn't been
qdevified.  There may be more.

I'm afraid we're better at adding more devices than we are at updating
devices to current interfaces.

Thus, I'm inclined to accept existence of devices that don't (reliably)
support [rw]error=stop as yet another sad fact of life.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 1/3] blockjob: Fix recent BLOCK_JOB_READY regression
  2014-07-02 14:58           ` Markus Armbruster
@ 2014-07-02 15:03             ` Paolo Bonzini
  2014-07-02 16:05               ` Eric Blake
  2014-07-03  7:19               ` Markus Armbruster
  0 siblings, 2 replies; 26+ messages in thread
From: Paolo Bonzini @ 2014-07-02 15:03 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: kwolf, lcapitulino, wenchaoqemu, stefanha, qemu-devel

Il 02/07/2014 16:58, Markus Armbruster ha scritto:
> Paolo Bonzini <pbonzini@redhat.com> writes:
>
>> Il 02/07/2014 08:55, Markus Armbruster ha scritto:
>>>>> I think this fixes itself automatically if you use
>>>>> rerror=stop/werror=stop on block jobs.  At least that was part of the
>>>>> design, whether the implementation gets it right I cannot say without
>>>>> looking at the code more carefully.
>>> What if an underlying device doesn't support [rw]error=stop?  Not all
>>> do...
>>
>> Then the "fix" is to add support to the underlying device.  IDE, SCSI
>> and virtio-blk (plus virtio-scsi via SCSI of course) are covered;
>
> Where "covered" means "device model calls bdrv_error_action() somewhere"
> rather than "device model calls bdrv_error_action() exactly when it
> should".
>
> Case in point: SCSI calls it when UNMAP fails, but IDE doesn't call it
> when TRIM fails.  IDE and virtio-blk call it for I/O beyond the end of
> the medium, but SCSI doesn't.
>
> This is of course fixable.  I'm working on it.
>
>>                                                                   the
>> main one that's left out is SD.
>
> Qdevified devices with a qdev_prop_drive: isa-fdc, sysbus-fdc,
> SUNW,fdtwo, nand, onenand, cfi.pflash01, cfi.pflash02, spapr-nvram,
> scsi-generic, nvme.  SD isn't in this list, because it still hasn't been
> qdevified.  There may be more.

I think there is a page with unfinished transition.  Can you add this one?

Paolo

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 1/3] blockjob: Fix recent BLOCK_JOB_READY regression
  2014-07-02 15:03             ` Paolo Bonzini
@ 2014-07-02 16:05               ` Eric Blake
  2014-07-03  7:19               ` Markus Armbruster
  1 sibling, 0 replies; 26+ messages in thread
From: Eric Blake @ 2014-07-02 16:05 UTC (permalink / raw)
  To: Paolo Bonzini, Markus Armbruster
  Cc: kwolf, qemu-devel, wenchaoqemu, stefanha, lcapitulino

[-- Attachment #1: Type: text/plain, Size: 1335 bytes --]

On 07/02/2014 09:03 AM, Paolo Bonzini wrote:

>>>> What if an underlying device doesn't support [rw]error=stop?  Not all
>>>> do...
>>>
>>> Then the "fix" is to add support to the underlying device.  IDE, SCSI
>>> and virtio-blk (plus virtio-scsi via SCSI of course) are covered;
>>
>> Where "covered" means "device model calls bdrv_error_action() somewhere"
>> rather than "device model calls bdrv_error_action() exactly when it
>> should".
>>
>> Case in point: SCSI calls it when UNMAP fails, but IDE doesn't call it
>> when TRIM fails.  IDE and virtio-blk call it for I/O beyond the end of
>> the medium, but SCSI doesn't.
>>
>> This is of course fixable.  I'm working on it.
>>
>>>                                                                   the
>>> main one that's left out is SD.
>>
>> Qdevified devices with a qdev_prop_drive: isa-fdc, sysbus-fdc,
>> SUNW,fdtwo, nand, onenand, cfi.pflash01, cfi.pflash02, spapr-nvram,
>> scsi-generic, nvme.  SD isn't in this list, because it still hasn't been
>> qdevified.  There may be more.
> 
> I think there is a page with unfinished transition.  Can you add this one?

Listed: http://wiki.qemu.org/CodeTransitions#Reliable_block_job_polling

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 1/3] blockjob: Fix recent BLOCK_JOB_READY regression
  2014-07-02 15:03             ` Paolo Bonzini
  2014-07-02 16:05               ` Eric Blake
@ 2014-07-03  7:19               ` Markus Armbruster
  2014-07-03  9:25                 ` Paolo Bonzini
  1 sibling, 1 reply; 26+ messages in thread
From: Markus Armbruster @ 2014-07-03  7:19 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: kwolf, qemu-devel, wenchaoqemu, stefanha, lcapitulino

Paolo Bonzini <pbonzini@redhat.com> writes:

> Il 02/07/2014 16:58, Markus Armbruster ha scritto:
>> Paolo Bonzini <pbonzini@redhat.com> writes:
>>
>>> Il 02/07/2014 08:55, Markus Armbruster ha scritto:
>>>>>> I think this fixes itself automatically if you use
>>>>>> rerror=stop/werror=stop on block jobs.  At least that was part of the
>>>>>> design, whether the implementation gets it right I cannot say without
>>>>>> looking at the code more carefully.
>>>> What if an underlying device doesn't support [rw]error=stop?  Not all
>>>> do...
>>>
>>> Then the "fix" is to add support to the underlying device.  IDE, SCSI
>>> and virtio-blk (plus virtio-scsi via SCSI of course) are covered;
>>
>> Where "covered" means "device model calls bdrv_error_action() somewhere"
>> rather than "device model calls bdrv_error_action() exactly when it
>> should".
>>
>> Case in point: SCSI calls it when UNMAP fails, but IDE doesn't call it
>> when TRIM fails.  IDE and virtio-blk call it for I/O beyond the end of
>> the medium, but SCSI doesn't.
>>
>> This is of course fixable.  I'm working on it.
>>
>>>                                                                   the
>>> main one that's left out is SD.
>>
>> Qdevified devices with a qdev_prop_drive: isa-fdc, sysbus-fdc,
>> SUNW,fdtwo, nand, onenand, cfi.pflash01, cfi.pflash02, spapr-nvram,
>> scsi-generic, nvme.  SD isn't in this list, because it still hasn't been
>> qdevified.  There may be more.
>
> I think there is a page with unfinished transition.  Can you add this one?

Do you mean the transition to qdev?

If yes, isn't that covered by "Making all devices QOM objects"?
Sometimes we create new transitions faster than we finish them...

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 1/3] blockjob: Fix recent BLOCK_JOB_READY regression
  2014-07-03  7:19               ` Markus Armbruster
@ 2014-07-03  9:25                 ` Paolo Bonzini
  2014-07-03 15:06                   ` Markus Armbruster
  0 siblings, 1 reply; 26+ messages in thread
From: Paolo Bonzini @ 2014-07-03  9:25 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: kwolf, lcapitulino, qemu-devel, stefanha, wenchaoqemu

Il 03/07/2014 09:19, Markus Armbruster ha scritto:
>> > I think there is a page with unfinished transition.  Can you add this one?
> Do you mean the transition to qdev?
>
> If yes, isn't that covered by "Making all devices QOM objects"?
> Sometimes we create new transitions faster than we finish them...

No, I meant the transition to supporting rerror/werror.  Eric started 
the patch and I edited it.

Paolo

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2.1 1/3] blockjob: Fix recent BLOCK_JOB_READY regression
  2014-07-03  9:25                 ` Paolo Bonzini
@ 2014-07-03 15:06                   ` Markus Armbruster
  0 siblings, 0 replies; 26+ messages in thread
From: Markus Armbruster @ 2014-07-03 15:06 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: kwolf, wenchaoqemu, qemu-devel, stefanha, lcapitulino

Paolo Bonzini <pbonzini@redhat.com> writes:

> Il 03/07/2014 09:19, Markus Armbruster ha scritto:
>>> > I think there is a page with unfinished transition.  Can you add this one?
>> Do you mean the transition to qdev?
>>
>> If yes, isn't that covered by "Making all devices QOM objects"?
>> Sometimes we create new transitions faster than we finish them...
>
> No, I meant the transition to supporting rerror/werror.  Eric started
> the patch and I edited it.

Okay.  I just added another section on I/O accounting, which is almost
as incomplete.

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2014-07-03 15:07 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-27 17:24 [Qemu-devel] [PATCH v2 2.1 0/3] Fix two recent event regressions Markus Armbruster
2014-06-27 17:24 ` [Qemu-devel] [PATCH v2 2.1 1/3] blockjob: Fix recent BLOCK_JOB_READY regression Markus Armbruster
2014-07-01 17:08   ` Eric Blake
2014-07-01 17:10     ` Paolo Bonzini
2014-07-02  6:55       ` Markus Armbruster
2014-07-02  8:23         ` Paolo Bonzini
2014-07-02  8:44           ` Kevin Wolf
2014-07-02  8:59             ` Paolo Bonzini
2014-07-02 14:58           ` Markus Armbruster
2014-07-02 15:03             ` Paolo Bonzini
2014-07-02 16:05               ` Eric Blake
2014-07-03  7:19               ` Markus Armbruster
2014-07-03  9:25                 ` Paolo Bonzini
2014-07-03 15:06                   ` Markus Armbruster
2014-06-27 17:24 ` [Qemu-devel] [PATCH v2 2.1 2/3] blockjob: Fix recent BLOCK_JOB_ERROR regression Markus Armbruster
2014-07-01 14:42   ` Wenchao Xia
2014-07-01 16:46     ` Paolo Bonzini
2014-07-02  6:46       ` Markus Armbruster
2014-07-02  8:20         ` Paolo Bonzini
2014-06-27 17:24 ` [Qemu-devel] [PATCH v2 2.1 3/3] docs/qmp: Fix documentation of BLOCK_JOB_READY to match code Markus Armbruster
2014-06-27 17:42   ` Luiz Capitulino
2014-07-01 17:12   ` Eric Blake
2014-07-02  6:49     ` Markus Armbruster
2014-07-02  8:48       ` Kevin Wolf
2014-07-02  7:55     ` Paolo Bonzini
2014-06-27 18:37 ` [Qemu-devel] [PATCH v2 2.1 0/3] Fix two recent event regressions Kevin Wolf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.