[libvirt] [PATCH 02/11] qemu: Split qemuDomainGetIOThreadsLive
John Ferlan
jferlan at redhat.com
Fri Oct 19 13:26:10 UTC 2018
[...]
>> if (VIR_ALLOC_N(info_ret, niothreads) < 0)
>> - goto endjob;
>> + goto cleanup;
>>
>> for (i = 0; i < niothreads; i++) {
>> virBitmapPtr map = NULL;
>>
>> if (VIR_ALLOC(info_ret[i]) < 0)
>> - goto endjob;
>> + goto cleanup;
>> info_ret[i]->iothread_id = iothreads[i]->iothread_id;
>>
>> if (!(map = virProcessGetAffinity(iothreads[i]->thread_id)))
>> - goto endjob;
>> + goto cleanup;
>
> I don't think this is a good idea. GetAffinity should be inside job too.
> SetAffinity call inside PinIOThread is inside one.
> Probably doesn't hurt us right now since the domain object is locked
> here, but regardless I think it should be inside a job.
>
> The split into two functions looks okay.
>
OK - I'll move the job logic back inside here and just have the Mon
logic do the magic fetch.
I was attempting to use a mix of the Block and Interface logic and
missed the detail regarding it being run in a job 0-).
Thanks!
John
>>
>> if (virBitmapToData(map, &info_ret[i]->cpumap,
>> &info_ret[i]->cpumaplen) < 0) {
>> virBitmapFree(map);
>> - goto endjob;
>> + goto cleanup;
>> }
>> virBitmapFree(map);
>> }
>>
>> - *info = info_ret;
>> - info_ret = NULL;
>> + VIR_STEAL_PTR(*info, info_ret);
>> ret = niothreads;
>>
>> - endjob:
>> - qemuDomainObjEndJob(driver, vm);
>> -
>> cleanup:
>> if (info_ret) {
>> for (i = 0; i < niothreads; i++)
>>
>
> Michal
>
More information about the libvir-list
mailing list