tests: Mock virProcessGetMaxMemLock()

Up until now we've implicitly relied on the fact that failures
reported from this function were simply ignored, but that's
about to change and so we need a proper mock.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Andrea Bolognani 2021-03-05 17:55:39 +01:00
parent b431f3c7fd
commit 6564cb01e1
2 changed files with 9 additions and 1 deletions

View File

@ -79,7 +79,7 @@ int virProcessSetMaxProcesses(pid_t pid, unsigned int procs);
int virProcessSetMaxFiles(pid_t pid, unsigned int files); int virProcessSetMaxFiles(pid_t pid, unsigned int files);
int virProcessSetMaxCoreSize(pid_t pid, unsigned long long bytes); int virProcessSetMaxCoreSize(pid_t pid, unsigned long long bytes);
int virProcessGetMaxMemLock(pid_t pid, unsigned long long *bytes); int virProcessGetMaxMemLock(pid_t pid, unsigned long long *bytes) G_GNUC_NO_INLINE;
/* Callback to run code within the mount namespace tied to the given /* Callback to run code within the mount namespace tied to the given
* pid. This function must use only async-signal-safe functions, as * pid. This function must use only async-signal-safe functions, as

View File

@ -21,6 +21,14 @@
#include <config.h> #include <config.h>
#include "virprocess.h" #include "virprocess.h"
int
virProcessGetMaxMemLock(pid_t pid G_GNUC_UNUSED,
unsigned long long *bytes)
{
*bytes = 0;
return 0;
}
int int
virProcessSetMaxMemLock(pid_t pid G_GNUC_UNUSED, unsigned long long bytes G_GNUC_UNUSED) virProcessSetMaxMemLock(pid_t pid G_GNUC_UNUSED, unsigned long long bytes G_GNUC_UNUSED)
{ {