1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-25 01:34:11 +03:00

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 bool
virDomainDefHasOldStyleUEFI(const virDomainDef *def) virDomainDefHasOldStyleUEFI(const virDomainDef *def)
{ {

View File

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

View File

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