conf: Introduce virDomainMemoryFindByDeviceAlias()

This function will be needed in the next commit where we will
want to find virtio-mem given its alias by QEMU on the monitor.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2021-06-21 11:58:37 +02:00
parent 59e9fb98f5
commit dcd9f8e2c5
3 changed files with 23 additions and 0 deletions

View File

@ -16621,6 +16621,23 @@ virDomainMemoryFindByDeviceInfo(virDomainDef *def,
}
virDomainMemoryDef *
virDomainMemoryFindByDeviceAlias(virDomainDef *def,
const char *alias)
{
size_t i;
for (i = 0; i < def->nmems; i++) {
virDomainMemoryDef *tmp = def->mems[i];
if (STREQ_NULLABLE(tmp->info.alias, alias))
return tmp;
}
return NULL;
}
/**
* virDomainMemoryInsert:
*

View File

@ -3816,6 +3816,11 @@ virDomainMemoryFindByDeviceInfo(virDomainDef *dev,
int *pos)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
virDomainMemoryDef *
virDomainMemoryFindByDeviceAlias(virDomainDef *def,
const char *alias)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
int virDomainShmemDefInsert(virDomainDef *def, virDomainShmemDef *shmem)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
bool virDomainShmemDefEquals(virDomainShmemDef *src, virDomainShmemDef *dst)

View File

@ -508,6 +508,7 @@ virDomainMemballoonModelTypeFromString;
virDomainMemballoonModelTypeToString;
virDomainMemoryDefFree;
virDomainMemoryFindByDef;
virDomainMemoryFindByDeviceAlias;
virDomainMemoryFindByDeviceInfo;
virDomainMemoryFindInactiveByDef;
virDomainMemoryInsert;