[virt-tools-list] [RFC Patch v2] Support job cancellation for migration, save functions
Cole Robinson
crobinso at redhat.com
Thu Dec 2 14:18:14 UTC 2010
On 12/01/2010 08:39 PM, Wen Congyang wrote:
> At 2010-12-02 05:21, Cole Robinson Write:
>> On 11/30/2010 10:35 PM, Wen Congyang wrote:
>>> # HG changeset patch
>>> # User Wen Congyang <wency at cn.fujitsu.com>
>>> # Date 1291173826 -28800
>>> # Node ID da5771e13f5a395c3fff8bcbdf2769d308034744
>>> # Parent dedbf8d0d5a34399a2baa8422b0f154a1c243bb0
>>> Support job cancellation for migration, save functions
>>>
>>> I do not use the API libvirt.jobinfo() to check whether the job is cancelled,
>>> because the jobinfo is cleared when job ends...
>>>
>>
>> Thanks for the patch. A couple suggestions. Again I added a virtinst
>> support check for jobInfo(), we can roughly use this to guess if
>> libvirt/the hypervisor supports cancel jobs as well:
>>
>> http://hg.fedorahosted.org/hg/python-virtinst/rev/871813b2dda1
>>
>> So I would recommend actually hiding the cancel button if the HV doesn't
>> support jobInfo, otherwise we will eventually get bug reports about the
>> cancel button not being clickable for other actions.
>
> Hmm, it is a good idea to hide the cancel button when we do not implement
> the cancel action or the HV doesn't support the implement.
>
> The API jobInfo can not provide any info when job ends. It can used only when
> the job is running. I think we would hide the cancel button only when
> the HV doesn't support abortJob.
>
The problem is that I don't know of a way we can check for abortJob
without possibly aborting a job :)
Since any HV that supports abortJob is likely going to also support
jobInfo, we can use jobInfo detection to decide if we want to show the
cancel button. It's probably the best guess we can make:
show_cancel = virtinst.support.check_domain_support(vm,
virtinst.support.SUPPORT_DOMAIN_JOB_INFO)
Also we don't want to show the cancel button if the virt-manager code
doesn't even register a handler for it, basically everything except
save/migrate.
Thanks,
Cole
More information about the virt-tools-list
mailing list