[libvirt] [PATCH 1/4] Implement public API for virDomainGetIOThreadsInfo

John Ferlan jferlan at redhat.com
Thu Feb 12 14:05:15 UTC 2015



On 02/12/2015 08:12 AM, Daniel P. Berrange wrote:
> On Thu, Feb 12, 2015 at 08:03:44AM -0500, John Ferlan wrote:
>> Add virDomainGetIOThreadsInfo in order to returned a list of
>> virDomainIOThreadsInfoPtr structures which list the IOThread ID,
>> the thread_id, and the CPU Affinity map for each IOThread for
>> the active domain.
>>
>> Also added virDomainIOThreadsInfoFree in order to free the cpumap
>> and the array entry structure.
>>
>> For inactive domains or where IOThreads is not supported return
>> an error and an empty structure
>>
>> Signed-off-by: John Ferlan <jferlan at redhat.com>
>> ---
>>  include/libvirt/libvirt-domain.h | 22 +++++++++++++-
>>  src/driver-hypervisor.h          |  8 ++++-
>>  src/libvirt-domain.c             | 63 +++++++++++++++++++++++++++++++++++++++-
>>  src/libvirt_public.syms          |  6 ++++
>>  4 files changed, 96 insertions(+), 3 deletions(-)
>>
>> diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
>> index 4dbd7f5..54f8de4 100644
>> --- a/include/libvirt/libvirt-domain.h
>> +++ b/include/libvirt/libvirt-domain.h
>> @@ -4,7 +4,7 @@
>>   * Description: Provides APIs for the management of domains
>>   * Author: Daniel Veillard <veillard at redhat.com>
>>   *
>> - * Copyright (C) 2006-2014 Red Hat, Inc.
>> + * Copyright (C) 2006-2015 Red Hat, Inc.
>>   *
>>   * This library is free software; you can redistribute it and/or
>>   * modify it under the terms of the GNU Lesser General Public
>> @@ -1568,6 +1568,26 @@ int                     virDomainGetEmulatorPinInfo (virDomainPtr domain,
>>                                                       unsigned int flags);
>>  
>>  /**
>> + * virIOThreadsInfo:
>> + *
>> + * The data structure for information about IOThreads in a domain
>> + */
>> +typedef struct _virDomainIOThreadsInfo virDomainIOThreadsInfo;
>> +typedef virDomainIOThreadsInfo *virDomainIOThreadsInfoPtr;
>> +struct _virDomainIOThreadsInfo {
>> +    unsigned int iothread_id;         /* IOThread ID */
>> +    unsigned int thread_id;            /* Thread ID associated with IOThread */
> 
> Hmm, one thing we've avoided doing in the past is to expose the idea of PIDs
> in any of the libvirt APIs - we  never expose the QEMU PID anywhere. So I
> think I'd leave this thread_id field out of the info here, the iothread_id
> should be sufficient for apps.  The actual thread_is should only be needed
> internally by libvirt itself, in order to do pinning & so forth - we don't
> want to have apps using it todo pinning themslves.
> 

OK no problem - that's "folklore" I wasn't aware of...  Easy enough to
remove.

John




More information about the libvir-list mailing list