mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 07:42:56 +00:00
0be6e26469
As of previous commit, the CH driver checks for /dev/kvm and/or /dev/mshv presence. In order to make chxml2xmltest work regardless of host configuration, introduce a mock that pretends both of these files are accessible. Fixes: 51c14df9670ba2f5d193b700f39e6464e1bc18c6 Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
21 lines
361 B
C
21 lines
361 B
C
/*
|
|
* Copyright (C) 2024 Red Hat, Inc.
|
|
* SPDX-License-Identifier: LGPL-2.1-or-later
|
|
*/
|
|
|
|
#include <config.h>
|
|
#include <unistd.h>
|
|
|
|
#include "internal.h"
|
|
#include "virfile.h"
|
|
|
|
bool
|
|
virFileExists(const char *path)
|
|
{
|
|
if (STREQ(path, "/dev/kvm"))
|
|
return true;
|
|
if (STREQ(path, "/dev/mshv"))
|
|
return true;
|
|
return access(path, F_OK) == 0;
|
|
}
|