On 16/03/2017 01:46, John Snow wrote: > - BlkDevOps is traditionally only for Qdev devices, and a BlockJob is not > currently a 'device'... Do we want to loosen this restriction, find another > way to deliver callbacks to BlockJobs attached to BlkBackends, or do > something > crazy like make a BlockJob device object? > > struct JobDevice { > DeviceState parent_obj; > BlockJob *job; > } ...??
I think we want to loosen it. > - Not so sure about leaving the initial job refcount at 1, since we are giving > away a handle to this job as dev_opaque. By incrementing it to 2, however, > it's not clear whose responsibility it is to decrement it again. It would be another callback, sent at the time the dev_ops are removed. But devices have been treating dev_opaque as a weak reference, it makes sense to do the same for jobs. Paolo