mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 02:04:16 +03:00
util: remove unused virKModConfig method
Using virKModConfig would not simplify any existing code. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
2d80cbc06a
commit
597fdabbc0
@ -2402,7 +2402,6 @@ virKeycodeValueTranslate;
|
||||
|
||||
|
||||
# util/virkmod.h
|
||||
virKModConfig;
|
||||
virKModIsBlacklisted;
|
||||
virKModLoad;
|
||||
virKModUnload;
|
||||
|
@ -58,25 +58,6 @@ doRmmod(const char *module, char **errbuf)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* virKModConfig:
|
||||
*
|
||||
* Get the current kernel module configuration
|
||||
*
|
||||
* Returns NULL on failure or a pointer to the output which
|
||||
* must be VIR_FREE()'d by the caller
|
||||
*/
|
||||
char *
|
||||
virKModConfig(void)
|
||||
{
|
||||
char *outbuf = NULL;
|
||||
|
||||
if (doModprobe("-c", NULL, &outbuf, NULL) < 0)
|
||||
return NULL;
|
||||
|
||||
return outbuf;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* virKModLoad:
|
||||
|
@ -23,7 +23,6 @@
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
char *virKModConfig(void);
|
||||
char *virKModLoad(const char *)
|
||||
ATTRIBUTE_NONNULL(1);
|
||||
char *virKModUnload(const char *)
|
||||
|
@ -31,33 +31,6 @@
|
||||
|
||||
# define VIR_FROM_THIS VIR_FROM_NONE
|
||||
|
||||
static int
|
||||
testKModConfig(const void *args G_GNUC_UNUSED)
|
||||
{
|
||||
int ret = -1;
|
||||
char *outbuf = NULL;
|
||||
|
||||
/* This will return the contents of a 'modprobe -c' which can differ
|
||||
* from machine to machine - be happy that we get something.
|
||||
*/
|
||||
outbuf = virKModConfig();
|
||||
if (!outbuf) {
|
||||
if (virFileIsExecutable(MODPROBE)) {
|
||||
fprintf(stderr, "Failed to get config\n");
|
||||
} else {
|
||||
/* modprobe doesn't exist, do not claim error. */
|
||||
ret = 0;
|
||||
}
|
||||
goto cleanup;
|
||||
}
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(outbuf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
checkOutput(virBufferPtr buf, const char *exp_cmd)
|
||||
{
|
||||
@ -141,8 +114,6 @@ mymain(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (virTestRun("config", testKModConfig, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virTestRun("load", testKModLoad, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virTestRun("unload", testKModUnload, NULL) < 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user