qemuxml2argvmock: Mock qemuInterfaceBridgeConnect

Prepare for test cases which would want to call that function.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2023-12-01 23:11:11 +01:00
parent f9a4d24b24
commit b448abd972
2 changed files with 18 additions and 1 deletions

View File

@ -48,7 +48,7 @@ int qemuInterfaceBridgeConnect(virDomainDef *def,
virDomainNetDef *net,
int *tapfd,
size_t *tapfdSize)
ATTRIBUTE_NONNULL(2);
ATTRIBUTE_NONNULL(2) G_NO_INLINE;
int qemuInterfaceOpenVhostNet(virDomainObj *def,
virDomainNetDef *net) G_NO_INLINE;

View File

@ -113,6 +113,23 @@ virNetDevTapCreate(char **ifname,
}
}
int
qemuInterfaceBridgeConnect(virDomainDef *def G_GNUC_UNUSED,
virQEMUDriver *driver G_GNUC_UNUSED,
virDomainNetDef *net G_GNUC_UNUSED,
int *tapfd,
size_t *tapfdSize)
{
size_t i;
for (i = 0; i < *tapfdSize; i++)
tapfd[i] = STDERR_FILENO + 100 + i;
return 0;
}
int
virNetDevSetMAC(const char *ifname G_GNUC_UNUSED,
const virMacAddr *macaddr G_GNUC_UNUSED)