[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC patch 3/3] blockjob: add devops to blockjob backen
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC patch 3/3] blockjob: add devops to blockjob backends |
Date: |
Thu, 16 Mar 2017 09:28:41 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
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