]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Mock virProcessGetMaxMemLock()
authorAndrea Bolognani <abologna@redhat.com>
Fri, 5 Mar 2021 16:55:39 +0000 (17:55 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 8 Mar 2021 21:41:40 +0000 (22:41 +0100)
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>
src/util/virprocess.h
tests/virprocessmock.c

index 34210d6c9d62f596b5f6f5eea651bcda5245784c..dbf4148e9019a880e9ecb757f5854656bb9c69ae 100644 (file)
@@ -79,7 +79,7 @@ int virProcessSetMaxProcesses(pid_t pid, unsigned int procs);
 int virProcessSetMaxFiles(pid_t pid, unsigned int files);
 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
  * pid.  This function must use only async-signal-safe functions, as
index c9386d757a9c37bd012e7c6f3ac8deccfaf60a1e..4236099ac3ccf6cc5202348417fc32472c7290ca 100644 (file)
 #include <config.h>
 #include "virprocess.h"
 
+int
+virProcessGetMaxMemLock(pid_t pid G_GNUC_UNUSED,
+                        unsigned long long *bytes)
+{
+    *bytes = 0;
+    return 0;
+}
+
 int
 virProcessSetMaxMemLock(pid_t pid G_GNUC_UNUSED, unsigned long long bytes G_GNUC_UNUSED)
 {