[PATCH] tests: Enable virpcimock on macOS

In general, it has little sense to use Linux pci mock on macOS but virPCIDeviceAddressGetIOMMUGroupNum() is relying on the filesystem layout mocked by virpcimock. And all tests that rely on correct execution of virPCIDeviceAddressGetIOMMUGroupNum() fail. Additionally, missing initialization is added to close() to avoid invocation of real_close() before it's set up. The change fixes qemuhotplugtest, qemumemlocktest and qemuxml2xmltest. Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com> --- tests/virpcimock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/virpcimock.c b/tests/virpcimock.c index 064218d275..5cd688c825 100644 --- a/tests/virpcimock.c +++ b/tests/virpcimock.c @@ -18,7 +18,7 @@ #include <config.h> -#if defined(__linux__) || defined(__FreeBSD__) +#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) # include "virmock.h" # include <unistd.h> # include <fcntl.h> @@ -1123,6 +1123,8 @@ opendir(const char *path) int close(int fd) { + init_syms(); + if (remove_fd(fd) < 0) return -1; return real_close(fd); -- 2.28.0

On Sun, 2020-10-25 at 17:26 +0300, Roman Bolshakov wrote:
@@ -1123,6 +1123,8 @@ opendir(const char *path) int close(int fd) { + init_syms();
This hunk is completely independent of the other one. Can you please split this into two separate patches? Both changes look good, they just shouldn't be in the same patch :) -- Andrea Bolognani / Red Hat / Virtualization

On Wed, Oct 28, 2020 at 08:09:51PM +0100, Andrea Bolognani wrote:
On Sun, 2020-10-25 at 17:26 +0300, Roman Bolshakov wrote:
@@ -1123,6 +1123,8 @@ opendir(const char *path) int close(int fd) { + init_syms();
This hunk is completely independent of the other one. Can you please split this into two separate patches?
Both changes look good, they just shouldn't be in the same patch :)
Sure, makes sense. I have split the patch into two. I'll will resend the series shortly. Thanks, Roman
participants (2)
-
Andrea Bolognani
-
Roman Bolshakov