Re: [REPOST PATCH v2 02/12] qemu: Split qemuDomainGetIOThreadsLive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 11/15/18 4:55 AM, Michal Privoznik wrote:
> On 11/05/2018 01:58 PM, John Ferlan wrote:
>> Separate out the fetch of the IOThread monitor call into a separate
>> helper so that a subsequent domain statistics change can fetch the raw
>> IOThread data and parse it as it sees fit.
>>
>> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
>> ---
>>  src/qemu/qemu_driver.c | 48 ++++++++++++++++++++++++++----------------
>>  1 file changed, 30 insertions(+), 18 deletions(-)
>>
>> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
>> index a52e2495d5..e13633c1e0 100644
>> --- a/src/qemu/qemu_driver.c
>> +++ b/src/qemu/qemu_driver.c
>> @@ -5486,39 +5486,52 @@ qemuDomainGetMaxVcpus(virDomainPtr dom)
>>                                           VIR_DOMAIN_VCPU_MAXIMUM));
>>  }
>>  
>> +
>>  static int
>> -qemuDomainGetIOThreadsLive(virQEMUDriverPtr driver,
>> -                           virDomainObjPtr vm,
>> -                           virDomainIOThreadInfoPtr **info)
>> +qemuDomainGetIOThreadsMon(virQEMUDriverPtr driver,
>> +                          virDomainObjPtr vm,
>> +                          qemuMonitorIOThreadInfoPtr **iothreads)
>>  {
>>      qemuDomainObjPrivatePtr priv;
>> -    qemuMonitorIOThreadInfoPtr *iothreads = NULL;
>> -    virDomainIOThreadInfoPtr *info_ret = NULL;
>>      int niothreads = 0;
>> -    size_t i;
>> -    int ret = -1;
>> -
>> -    if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0)
>> -        goto cleanup;
>>  
>>      if (!virDomainObjIsActive(vm)) {
>>          virReportError(VIR_ERR_OPERATION_INVALID, "%s",
>>                         _("cannot list IOThreads for an inactive domain"));
> 
> I wonder if this check should go into qemuDomainGetIOThreadsLive() right
> after BeginJob(). Rationale behind is that in the next patch, the
> qemuDomainGetStatsIOThread() does the same check already and then it
> calls this function which does the check again. Not crucial though.
> 

Good point - I'll move it (and change return -1 to goto endjob ;-))

Tks

John

[...]

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux