mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
tests: qemuxml2argv: modernize TPM passthrough tests
All supported qemus support FD passing so modify the tests to test the proper code path. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
@@ -186,7 +186,7 @@ virNetDevRunEthernetScript(const char *ifname ATTRIBUTE_UNUSED,
|
||||
|
||||
static void (*real_virCommandPassFD)(virCommandPtr cmd, int fd, unsigned int flags);
|
||||
|
||||
static const int testCommandPassSafeFDs[] = { -1 };
|
||||
static const int testCommandPassSafeFDs[] = { 1730, 1731 };
|
||||
|
||||
void
|
||||
virCommandPassFD(virCommandPtr cmd,
|
||||
@@ -247,3 +247,19 @@ qemuOpenChrChardevUNIXSocket(const virDomainChrSourceDef *dev ATTRIBUTE_UNUSED)
|
||||
abort();
|
||||
return 1729;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
qemuBuildTPMOpenBackendFDs(const char *tpmdev ATTRIBUTE_UNUSED,
|
||||
const char *cancel_path ATTRIBUTE_UNUSED,
|
||||
int *tpmfd,
|
||||
int *cancelfd)
|
||||
{
|
||||
if (fcntl(1730, F_GETFD) != -1 ||
|
||||
fcntl(1731, F_GETFD) != -1)
|
||||
abort();
|
||||
|
||||
*tpmfd = 1730;
|
||||
*cancelfd = 1731;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user