conf: new function virDomainDefHasVDPANet()

This function returns true if the domain has any interfaces that are
type='vdpa'.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
Laine Stump 2021-03-22 18:05:00 -04:00
parent 0c30e7221c
commit 43d8d16161
3 changed files with 18 additions and 0 deletions

View File

@ -32442,6 +32442,20 @@ virDomainDefHasMdevHostdev(const virDomainDef *def)
}
bool
virDomainDefHasVDPANet(const virDomainDef *def)
{
size_t i;
for (i = 0; i < def->nnets; i++) {
if (virDomainNetGetActualType(def->nets[i]) == VIR_DOMAIN_NET_TYPE_VDPA)
return true;
}
return false;
}
bool
virDomainDefHasOldStyleUEFI(const virDomainDef *def)
{

View File

@ -4061,6 +4061,9 @@ virDomainDefHasVFIOHostdev(const virDomainDef *def);
bool
virDomainDefHasMdevHostdev(const virDomainDef *def);
bool
virDomainDefHasVDPANet(const virDomainDef *def);
bool
virDomainDefHasOldStyleUEFI(const virDomainDef *def);

View File

@ -332,6 +332,7 @@ virDomainDefHasOldStyleROUEFI;
virDomainDefHasOldStyleUEFI;
virDomainDefHasUSB;
virDomainDefHasVcpusOffline;
virDomainDefHasVDPANet;
virDomainDefHasVFIOHostdev;
virDomainDefLifecycleActionAllowed;
virDomainDefMaybeAddController;