On 08/18/2016 07:47 AM, Erik Skultety wrote:
> This is mainly virLogAddOutputTo* which were replaced by virLogNewOutputTo*
> and
> the previously poorly named ones virLogParseAndDefine* functions. All of these
> are unnecessary now, since all the original callers were transparently
> switched
> to the new model of separate parsing and defining logic.
>
> Signed-off-by: Erik Skultety
> ---
> src/libvirt_private.syms | 4 -
> src/util/virlog.c| 427
> ---
> src/util/virlog.h| 12 --
> 3 files changed, 443 deletions(-)
>
NOTE:
My git am -3 failed on this patch:
Applying: virlog: Remove functions that aren't used anywhere anymore
fatal: sha1 information is lacking or useless (src/libvirt_private.syms).
error: could not build fake ancestor
Patch failed at 0017 virlog: Remove functions that aren't used anywhere
anymore
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
I'm really not sure why, but I
NOTE: Existing, but IS_SPACE isn't used either.
ACK - you could/should remove IS_SPACE separately and use this implied ACK
John
> diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
> index fec0b8b..58d0d7e 100644
> --- a/src/libvirt_private.syms
> +++ b/src/libvirt_private.syms
> @@ -1842,9 +1842,7 @@ virLockSpaceReleaseResourcesForOwner;
>
>
> # util/virlog.h
> -virLogDefineFilter;
> virLogDefineFilters;
> -virLogDefineOutput;
> virLogDefineOutputs;
> virLogFilterFree;
> virLogFilterListFree;
> @@ -1864,8 +1862,6 @@ virLogNewOutputToSyslog;
> virLogOutputFree;
> virLogOutputListFree;
> virLogOutputNew;
> -virLogParseAndDefineFilters;
> -virLogParseAndDefineOutputs;
> virLogParseDefaultPriority;
> virLogParseFilter;
> virLogParseFilters;
> diff --git a/src/util/virlog.c b/src/util/virlog.c
> index 36c3a38..12e6d94 100644
> --- a/src/util/virlog.c
> +++ b/src/util/virlog.c
> @@ -279,70 +279,6 @@ virLogFilterListFree(virLogFilterPtr *list, int count)
>
>
> /**
> - * virLogDefineFilter:
> - * @match: the pattern to match
> - * @priority: the priority to give to messages matching the pattern
> - * @flags: extra flags, see virLogFilterFlags enum
> - *
> - * Defines a pattern used for log filtering, it allow to select or
> - * reject messages independently of the default priority.
> - * The filter defines a rules that will apply only to messages matching
> - * the pattern (currently if @match is a substring of the message category)
> - *
> - * Returns -1 in case of failure or the filter number if successful
> - */
> -int
> -virLogDefineFilter(const char *match,
> - virLogPriority priority,
> - unsigned int flags)
> -{
> -size_t i;
> -int ret = -1;
> -char *mdup = NULL;
> -virLogFilterPtr filter = NULL;
> -
> -virCheckFlags(VIR_LOG_STACK_TRACE, -1);
> -
> -if (virLogInitialize() < 0)
> -return -1;
> -
> -if ((match == NULL) || (priority < VIR_LOG_DEBUG) ||
> -(priority > VIR_LOG_ERROR))
> -return -1;
> -
> -virLogLock();
> -for (i = 0; i < virLogNbFilters; i++) {
> -if (STREQ(virLogFilters[i]->match, match)) {
> -virLogFilters[i]->priority = priority;
> -ret = i;
> -goto cleanup;
> -}
> -}
> -
> -if (VIR_STRDUP_QUIET(mdup, match) < 0)
> -goto cleanup;
> -
> -if (VIR_ALLOC_QUIET(filter) < 0) {
> -VIR_FREE(mdup);
> -goto cleanup;
> -}
> -
> -filter->match = mdup;
> -filter->priority = priority;
> -filter->flags = flags;
> -
> -if (VIR_APPEND_ELEMENT_QUIET(virLogFilters, virLogNbFilters, filter) < 0)
> -goto cleanup;
> -
> -virLogFiltersSerial++;
> - cleanup:
> -virLogUnlock();
> -if (ret < 0)
> -virReportOOMError();
> -return virLogNbFilters;
> -}
> -
> -/**
> * virLogResetOutputs:
> *
> * Removes the set of logging output defined.
> @@ -390,73 +326,6 @@ virLogOutputListFree(virLogOutputPtr *list, int count)
> }
>
>
> -/**
> - * virLogDefineOutput:
> - * @f: the function to call to output a message
> - * @c: the function to call to close the output (or NULL)
> - * @data: extra data passed as first arg to the function
> - * @priority: minimal priority for this filter, use 0 for none
> - * @dest: where to send output of this priority
> - * @name: optional name data associated with an output
> - * @flags: extra flag, currently unused
> - *
> - * Defines an output function for log messages. Each message once
> - * gone though filtering is emitted through each registered output.
> - *
> - * Returns -1 in case of failure or the output number if successful
> - */
> -int
> -virLogDefineOutput(virLogOutputFunc f,
> - virLogCloseFunc c,
> -