Global priority can be changed from outside as well. So far, updating priority is filter driven, meaning that source priority can only be changed when filters change. To assure, users can change the global priority from outside, make the serial more generic, so that any change to priority would trigger source update. --- src/util/virlog.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/util/virlog.c b/src/util/virlog.c index 8e14a9e..a837e17 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -87,7 +87,7 @@ struct _virLogFilter { unsigned int flags; }; -static int virLogFiltersSerial = 1; +static int virLogSerial = 1; static virLogFilterPtr *virLogFilters; static size_t virLogNbFilters; @@ -280,7 +280,7 @@ virLogResetFilters(void) virLogFilterListFree(virLogFilters, virLogNbFilters); virLogFilters = NULL; virLogNbFilters = 0; - virLogFiltersSerial++; + virLogSerial++; } @@ -483,7 +483,7 @@ static void virLogSourceUpdate(virLogSourcePtr source) { virLogLock(); - if (source->serial < virLogFiltersSerial) { + if (source->serial < virLogSerial) { unsigned int priority = virLogDefaultPriority; unsigned int flags = 0; size_t i; @@ -498,7 +498,7 @@ virLogSourceUpdate(virLogSourcePtr source) source->priority = priority; source->flags = flags; - source->serial = virLogFiltersSerial; + source->serial = virLogSerial; } virLogUnlock(); } @@ -582,7 +582,7 @@ virLogVMessage(virLogSourcePtr source, * thread is updating log filter list concurrently * with a log message emission. */ - if (source->serial < virLogFiltersSerial) + if (source->serial < virLogSerial) virLogSourceUpdate(source); if (priority < source->priority) goto cleanup; @@ -1686,7 +1686,7 @@ virLogDefineFilters(virLogFilterPtr *filters, size_t nfilters) virLogResetFilters(); virLogFilters = filters; virLogNbFilters = nfilters; - virLogFiltersSerial++; + virLogSerial++; virLogUnlock(); return virLogNbFilters; -- 2.4.3 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list