Re: [Qemu-devel] [RFC v2 PATCH 3/6] blockdev: rename block_stream_cb to a generic block_job_cb

2012-09-07 Thread Paolo Bonzini
Il 07/09/2012 19:04, Jeff Cody ha scritto:
> On 09/07/2012 12:27 PM, Paolo Bonzini wrote:
>> Il 30/08/2012 20:47, Jeff Cody ha scritto:
>>> @@ -53,6 +53,8 @@ static const int if_max_devs[IF_COUNT] = {
>>>  [IF_SCSI] = 7,
>>>  };
>>>  
>>> +static void block_job_cb(void *opaque, int ret);
>>> +
>>>  /*
>>>   * We automatically delete the drive when a device using it gets
>>>   * unplugged.  Questionable feature, but we can't just drop it.
>>
>> Can you avoid the forward declaration?
>>
>> Paolo
>>
> 
> Yes, sure - honestly, I added this patch in, but I assumed that the
> similar patch of yours to support mirroring would go in first, making
> this patch moot.

I now took this patch of yours in my tree (minus the forward
declaration), so...

Paolo




Re: [Qemu-devel] [RFC v2 PATCH 3/6] blockdev: rename block_stream_cb to a generic block_job_cb

2012-09-07 Thread Jeff Cody
On 09/07/2012 12:27 PM, Paolo Bonzini wrote:
> Il 30/08/2012 20:47, Jeff Cody ha scritto:
>> @@ -53,6 +53,8 @@ static const int if_max_devs[IF_COUNT] = {
>>  [IF_SCSI] = 7,
>>  };
>>  
>> +static void block_job_cb(void *opaque, int ret);
>> +
>>  /*
>>   * We automatically delete the drive when a device using it gets
>>   * unplugged.  Questionable feature, but we can't just drop it.
> 
> Can you avoid the forward declaration?
> 
> Paolo
> 

Yes, sure - honestly, I added this patch in, but I assumed that the
similar patch of yours to support mirroring would go in first, making
this patch moot.



Re: [Qemu-devel] [RFC v2 PATCH 3/6] blockdev: rename block_stream_cb to a generic block_job_cb

2012-09-07 Thread Paolo Bonzini
Il 30/08/2012 20:47, Jeff Cody ha scritto:
> @@ -53,6 +53,8 @@ static const int if_max_devs[IF_COUNT] = {
>  [IF_SCSI] = 7,
>  };
>  
> +static void block_job_cb(void *opaque, int ret);
> +
>  /*
>   * We automatically delete the drive when a device using it gets
>   * unplugged.  Questionable feature, but we can't just drop it.

Can you avoid the forward declaration?

Paolo



[Qemu-devel] [RFC v2 PATCH 3/6] blockdev: rename block_stream_cb to a generic block_job_cb

2012-08-30 Thread Jeff Cody

Signed-off-by: Jeff Cody 
---
 blockdev.c   | 8 +---
 trace-events | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/blockdev.c b/blockdev.c
index 7c83baa..68d65fb 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -53,6 +53,8 @@ static const int if_max_devs[IF_COUNT] = {
 [IF_SCSI] = 7,
 };
 
+static void block_job_cb(void *opaque, int ret);
+
 /*
  * We automatically delete the drive when a device using it gets
  * unplugged.  Questionable feature, but we can't just drop it.
@@ -1063,12 +1065,12 @@ static QObject *qobject_from_block_job(BlockJob *job)
   job->speed);
 }
 
-static void block_stream_cb(void *opaque, int ret)
+static void block_job_cb(void *opaque, int ret)
 {
 BlockDriverState *bs = opaque;
 QObject *obj;
 
-trace_block_stream_cb(bs, bs->job, ret);
+trace_block_job_cb(bs, bs->job, ret);
 
 assert(bs->job);
 obj = qobject_from_block_job(bs->job);
@@ -1110,7 +1112,7 @@ void qmp_block_stream(const char *device, bool has_base,
 }
 
 stream_start(bs, base_bs, base, has_speed ? speed : 0,
- block_stream_cb, bs, &local_err);
+ block_job_cb, bs, &local_err);
 if (error_is_set(&local_err)) {
 error_propagate(errp, local_err);
 return;
diff --git a/trace-events b/trace-events
index 9eb8f10..8d7a8d3 100644
--- a/trace-events
+++ b/trace-events
@@ -79,7 +79,7 @@ commit_start(void *bs, void *base, void *top, void *s, void 
*co, void *opaque, i
 
 # blockdev.c
 qmp_block_job_cancel(void *job) "job %p"
-block_stream_cb(void *bs, void *job, int ret) "bs %p job %p ret %d"
+block_job_cb(void *bs, void *job, int ret) "bs %p job %p ret %d"
 qmp_block_stream(void *bs, void *job) "bs %p job %p"
 
 # hw/virtio-blk.c
-- 
1.7.11.2