All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/2] small fix of block job
@ 2016-06-23  8:57 Changlong Xie
  2016-06-23  8:57 ` [Qemu-devel] [PATCH v2 1/2] blockjob: assert(cb) when create job Changlong Xie
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Changlong Xie @ 2016-06-23  8:57 UTC (permalink / raw)
  To: qemu devel, Jeff Cody
  Cc: Stefan Hajnoczi, Fam Zheng, Max Reitz, Kevin Wolf, Paolo Bonzini,
	Eric Blake, Wen Congyang, Changlong Xie

V2
p1: put assert(cb) in block_job_create

Changlong Xie (2):
  blockjob: assert(cb) when create job
  mirror: fix misleading comments

 block/backup.c | 1 -
 block/mirror.c | 2 +-
 blockjob.c     | 1 +
 3 files changed, 2 insertions(+), 2 deletions(-)

-- 
1.9.3

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

* [Qemu-devel] [PATCH v2 1/2] blockjob: assert(cb) when create job
  2016-06-23  8:57 [Qemu-devel] [PATCH v2 0/2] small fix of block job Changlong Xie
@ 2016-06-23  8:57 ` Changlong Xie
  2016-06-29  2:56   ` Jeff Cody
  2016-06-23  8:57 ` [Qemu-devel] [PATCH v2 2/2] mirror: fix misleading comments Changlong Xie
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Changlong Xie @ 2016-06-23  8:57 UTC (permalink / raw)
  To: qemu devel, Jeff Cody
  Cc: Stefan Hajnoczi, Fam Zheng, Max Reitz, Kevin Wolf, Paolo Bonzini,
	Eric Blake, Wen Congyang, Changlong Xie

Callback for block job should always exist

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Suggested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
---
 block/backup.c | 1 -
 blockjob.c     | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/backup.c b/block/backup.c
index 581269b..f87f8d5 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -489,7 +489,6 @@ void backup_start(BlockDriverState *bs, BlockDriverState *target,
 
     assert(bs);
     assert(target);
-    assert(cb);
 
     if (bs == target) {
         error_setg(errp, "Source and target cannot be the same");
diff --git a/blockjob.c b/blockjob.c
index 90c4e26..205da9d 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -110,6 +110,7 @@ void *block_job_create(const BlockJobDriver *driver, BlockDriverState *bs,
     BlockBackend *blk;
     BlockJob *job;
 
+    assert(cb);
     if (bs->job) {
         error_setg(errp, QERR_DEVICE_IN_USE, bdrv_get_device_name(bs));
         return NULL;
-- 
1.9.3

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

* [Qemu-devel] [PATCH v2 2/2] mirror: fix misleading comments
  2016-06-23  8:57 [Qemu-devel] [PATCH v2 0/2] small fix of block job Changlong Xie
  2016-06-23  8:57 ` [Qemu-devel] [PATCH v2 1/2] blockjob: assert(cb) when create job Changlong Xie
@ 2016-06-23  8:57 ` Changlong Xie
  2016-06-29  2:57   ` Jeff Cody
  2016-06-23  9:30 ` [Qemu-devel] [PATCH v2 0/2] small fix of block job Fam Zheng
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Changlong Xie @ 2016-06-23  8:57 UTC (permalink / raw)
  To: qemu devel, Jeff Cody
  Cc: Stefan Hajnoczi, Fam Zheng, Max Reitz, Kevin Wolf, Paolo Bonzini,
	Eric Blake, Wen Congyang, Changlong Xie

s/target bs/to_replace/, also we check to_replace bs is not
blocked in qmp_drive_mirror() not here

Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
---
 block/mirror.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/mirror.c b/block/mirror.c
index a04ed9c..4420a15 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -769,7 +769,7 @@ static void mirror_complete(BlockJob *job, Error **errp)
         }
     }
 
-    /* check the target bs is not blocked and block all operations on it */
+    /* block all operations on to_replace bs */
     if (s->replaces) {
         AioContext *replace_aio_context;
 
-- 
1.9.3

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

* Re: [Qemu-devel] [PATCH v2 0/2] small fix of block job
  2016-06-23  8:57 [Qemu-devel] [PATCH v2 0/2] small fix of block job Changlong Xie
  2016-06-23  8:57 ` [Qemu-devel] [PATCH v2 1/2] blockjob: assert(cb) when create job Changlong Xie
  2016-06-23  8:57 ` [Qemu-devel] [PATCH v2 2/2] mirror: fix misleading comments Changlong Xie
@ 2016-06-23  9:30 ` Fam Zheng
  2016-06-24 10:07 ` Stefan Hajnoczi
  2016-06-29  2:57 ` Jeff Cody
  4 siblings, 0 replies; 8+ messages in thread
From: Fam Zheng @ 2016-06-23  9:30 UTC (permalink / raw)
  To: Changlong Xie
  Cc: qemu devel, Jeff Cody, Stefan Hajnoczi, Max Reitz, Kevin Wolf,
	Paolo Bonzini, Eric Blake, Wen Congyang

On Thu, 06/23 16:57, Changlong Xie wrote:
> V2
> p1: put assert(cb) in block_job_create
> 
> Changlong Xie (2):
>   blockjob: assert(cb) when create job
>   mirror: fix misleading comments
> 

Reviewed-by: Fam Zheng <famz@redhat.com>

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

* Re: [Qemu-devel] [PATCH v2 0/2] small fix of block job
  2016-06-23  8:57 [Qemu-devel] [PATCH v2 0/2] small fix of block job Changlong Xie
                   ` (2 preceding siblings ...)
  2016-06-23  9:30 ` [Qemu-devel] [PATCH v2 0/2] small fix of block job Fam Zheng
@ 2016-06-24 10:07 ` Stefan Hajnoczi
  2016-06-29  2:57 ` Jeff Cody
  4 siblings, 0 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2016-06-24 10:07 UTC (permalink / raw)
  To: Changlong Xie
  Cc: qemu devel, Jeff Cody, Kevin Wolf, Fam Zheng, Max Reitz,
	Stefan Hajnoczi, Paolo Bonzini

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

On Thu, Jun 23, 2016 at 04:57:19PM +0800, Changlong Xie wrote:
> V2
> p1: put assert(cb) in block_job_create
> 
> Changlong Xie (2):
>   blockjob: assert(cb) when create job
>   mirror: fix misleading comments
> 
>  block/backup.c | 1 -
>  block/mirror.c | 2 +-
>  blockjob.c     | 1 +
>  3 files changed, 2 insertions(+), 2 deletions(-)
> 
> -- 
> 1.9.3
> 
> 
> 
> 

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [Qemu-devel] [PATCH v2 1/2] blockjob: assert(cb) when create job
  2016-06-23  8:57 ` [Qemu-devel] [PATCH v2 1/2] blockjob: assert(cb) when create job Changlong Xie
@ 2016-06-29  2:56   ` Jeff Cody
  0 siblings, 0 replies; 8+ messages in thread
From: Jeff Cody @ 2016-06-29  2:56 UTC (permalink / raw)
  To: Changlong Xie
  Cc: qemu devel, Stefan Hajnoczi, Fam Zheng, Max Reitz, Kevin Wolf,
	Paolo Bonzini, Eric Blake, Wen Congyang

On Thu, Jun 23, 2016 at 04:57:20PM +0800, Changlong Xie wrote:
> Callback for block job should always exist
> 
> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> Suggested-by: Kevin Wolf <kwolf@redhat.com>
> Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com>

Reviewed-by: Jeff Cody <jcody@redhat.com>

> ---
>  block/backup.c | 1 -
>  blockjob.c     | 1 +
>  2 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/backup.c b/block/backup.c
> index 581269b..f87f8d5 100644
> --- a/block/backup.c
> +++ b/block/backup.c
> @@ -489,7 +489,6 @@ void backup_start(BlockDriverState *bs, BlockDriverState *target,
>  
>      assert(bs);
>      assert(target);
> -    assert(cb);
>  
>      if (bs == target) {
>          error_setg(errp, "Source and target cannot be the same");
> diff --git a/blockjob.c b/blockjob.c
> index 90c4e26..205da9d 100644
> --- a/blockjob.c
> +++ b/blockjob.c
> @@ -110,6 +110,7 @@ void *block_job_create(const BlockJobDriver *driver, BlockDriverState *bs,
>      BlockBackend *blk;
>      BlockJob *job;
>  
> +    assert(cb);
>      if (bs->job) {
>          error_setg(errp, QERR_DEVICE_IN_USE, bdrv_get_device_name(bs));
>          return NULL;
> -- 
> 1.9.3
> 
> 
> 

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

* Re: [Qemu-devel] [PATCH v2 2/2] mirror: fix misleading comments
  2016-06-23  8:57 ` [Qemu-devel] [PATCH v2 2/2] mirror: fix misleading comments Changlong Xie
@ 2016-06-29  2:57   ` Jeff Cody
  0 siblings, 0 replies; 8+ messages in thread
From: Jeff Cody @ 2016-06-29  2:57 UTC (permalink / raw)
  To: Changlong Xie
  Cc: qemu devel, Stefan Hajnoczi, Fam Zheng, Max Reitz, Kevin Wolf,
	Paolo Bonzini, Eric Blake, Wen Congyang

On Thu, Jun 23, 2016 at 04:57:21PM +0800, Changlong Xie wrote:
> s/target bs/to_replace/, also we check to_replace bs is not
> blocked in qmp_drive_mirror() not here
> 
> Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com>

Reviewed-by: Jeff Cody <jcody@redhat.com>
> ---
>  block/mirror.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/mirror.c b/block/mirror.c
> index a04ed9c..4420a15 100644
> --- a/block/mirror.c
> +++ b/block/mirror.c
> @@ -769,7 +769,7 @@ static void mirror_complete(BlockJob *job, Error **errp)
>          }
>      }
>  
> -    /* check the target bs is not blocked and block all operations on it */
> +    /* block all operations on to_replace bs */
>      if (s->replaces) {
>          AioContext *replace_aio_context;
>  
> -- 
> 1.9.3
> 
> 
> 

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

* Re: [Qemu-devel] [PATCH v2 0/2] small fix of block job
  2016-06-23  8:57 [Qemu-devel] [PATCH v2 0/2] small fix of block job Changlong Xie
                   ` (3 preceding siblings ...)
  2016-06-24 10:07 ` Stefan Hajnoczi
@ 2016-06-29  2:57 ` Jeff Cody
  4 siblings, 0 replies; 8+ messages in thread
From: Jeff Cody @ 2016-06-29  2:57 UTC (permalink / raw)
  To: Changlong Xie
  Cc: qemu devel, Stefan Hajnoczi, Fam Zheng, Max Reitz, Kevin Wolf,
	Paolo Bonzini, Eric Blake, Wen Congyang

On Thu, Jun 23, 2016 at 04:57:19PM +0800, Changlong Xie wrote:
> V2
> p1: put assert(cb) in block_job_create
> 
> Changlong Xie (2):
>   blockjob: assert(cb) when create job
>   mirror: fix misleading comments
> 
>  block/backup.c | 1 -
>  block/mirror.c | 2 +-
>  blockjob.c     | 1 +
>  3 files changed, 2 insertions(+), 2 deletions(-)
> 
> -- 
> 1.9.3
> 
> 
> 

Thanks,

Applied to my block branch:

git://github.com/codyprime/qemu-kvm-jtc.git block

-Jeff

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

end of thread, other threads:[~2016-06-29  2:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-23  8:57 [Qemu-devel] [PATCH v2 0/2] small fix of block job Changlong Xie
2016-06-23  8:57 ` [Qemu-devel] [PATCH v2 1/2] blockjob: assert(cb) when create job Changlong Xie
2016-06-29  2:56   ` Jeff Cody
2016-06-23  8:57 ` [Qemu-devel] [PATCH v2 2/2] mirror: fix misleading comments Changlong Xie
2016-06-29  2:57   ` Jeff Cody
2016-06-23  9:30 ` [Qemu-devel] [PATCH v2 0/2] small fix of block job Fam Zheng
2016-06-24 10:07 ` Stefan Hajnoczi
2016-06-29  2:57 ` Jeff Cody

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.