mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
conf: Add helper to return a bitmap of active iothread ids
This commit is contained in:
parent
9479642fd3
commit
e992aa21f7
@ -18411,6 +18411,35 @@ virDomainIOThreadIDAdd(virDomainDefPtr def,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* virDomainIOThreadIDMap:
|
||||
* @def: domain definition
|
||||
*
|
||||
* Returns a map of active iothreads for @def.
|
||||
*/
|
||||
virBitmapPtr
|
||||
virDomainIOThreadIDMap(virDomainDefPtr def)
|
||||
{
|
||||
unsigned int max = 0;
|
||||
size_t i;
|
||||
virBitmapPtr ret = NULL;
|
||||
|
||||
for (i = 0; i < def->niothreadids; i++) {
|
||||
if (def->iothreadids[i]->iothread_id > max)
|
||||
max = def->iothreadids[i]->iothread_id;
|
||||
}
|
||||
|
||||
if (!(ret = virBitmapNew(max)))
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < def->niothreadids; i++)
|
||||
ignore_value(virBitmapSetBit(ret, def->iothreadids[i]->iothread_id));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
virDomainIOThreadIDDel(virDomainDefPtr def,
|
||||
unsigned int iothread_id)
|
||||
|
@ -2728,6 +2728,9 @@ virDomainIOThreadIDDefPtr virDomainIOThreadIDFind(virDomainDefPtr def,
|
||||
unsigned int iothread_id);
|
||||
virDomainIOThreadIDDefPtr virDomainIOThreadIDAdd(virDomainDefPtr def,
|
||||
unsigned int iothread_id);
|
||||
|
||||
virBitmapPtr virDomainIOThreadIDMap(virDomainDefPtr def)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
|
||||
void virDomainIOThreadIDDel(virDomainDefPtr def, unsigned int iothread_id);
|
||||
void virDomainIOThreadSchedDelId(virDomainDefPtr def, unsigned int iothread_id);
|
||||
|
||||
|
@ -345,6 +345,7 @@ virDomainIOThreadIDAdd;
|
||||
virDomainIOThreadIDDefFree;
|
||||
virDomainIOThreadIDDel;
|
||||
virDomainIOThreadIDFind;
|
||||
virDomainIOThreadIDMap;
|
||||
virDomainIOThreadSchedDelId;
|
||||
virDomainKeyWrapCipherNameTypeFromString;
|
||||
virDomainKeyWrapCipherNameTypeToString;
|
||||
|
Loading…
Reference in New Issue
Block a user