Implement public API for virDomainGetIOThreadsInfo

Add virDomainGetIOThreadInfo in order to return a list of
virDomainIOThreadInfoPtr structures which list the IOThread ID
and the CPU Affinity map for each IOThread for the domain.

For an active domain, the live data will be returned, while for
an inactive domain, the config data will be returned.

The API supports either the --live or --config flag, but not both.

Also added virDomainIOThreadsInfoFree in order to free the cpumap
and the IOThreadInfo structure.

Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
John Ferlan
2015-02-09 16:16:55 -05:00
parent cf521fc8ba
commit 11a5a0956f
4 changed files with 108 additions and 3 deletions

View File

@@ -4,7 +4,7 @@
* Description: Provides APIs for the management of domains
* Author: Daniel Veillard <veillard@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
@@ -1590,6 +1590,26 @@ int virDomainGetEmulatorPinInfo (virDomainPtr domain,
int maplen,
unsigned int flags);
/**
* virIOThreadInfo:
*
* The data structure for information about all IOThreads in a domain
*/
typedef struct _virDomainIOThreadInfo virDomainIOThreadInfo;
typedef virDomainIOThreadInfo *virDomainIOThreadInfoPtr;
struct _virDomainIOThreadInfo {
unsigned int iothread_id; /* IOThread ID */
unsigned char *cpumap; /* CPU map for thread. A pointer to an */
/* array of real CPUs (in 8-bit bytes) */
int cpumaplen; /* cpumap size */
};
void virDomainIOThreadsInfoFree(virDomainIOThreadInfoPtr info);
int virDomainGetIOThreadsInfo(virDomainPtr domain,
virDomainIOThreadInfoPtr **info,
unsigned int flags);
/**
* VIR_USE_CPU:
* @cpumap: pointer to a bit map of real CPUs (in 8-bit bytes) (IN/OUT)