summaryrefslogtreecommitdiff
path: root/src/util/viraudit.h
Commit message (Collapse)AuthorAgeFilesLines
* lib: Drop internal virXXXPtr typedefsMichal Privoznik2021-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | Historically, we declared pointer type to our types: typedef struct _virXXX virXXX; typedef virXXX *virXXXPtr; But usefulness of such declaration is questionable, at best. Unfortunately, we can't drop every such declaration - we have to carry some over, because they are part of public API (e.g. virDomainPtr). But for internal types - we can do drop them and use what every other C project uses 'virXXX *'. This change was generated by a very ugly shell script that generated sed script which was then called over each file in the repository. For the shell script refer to the cover letter: https://listman.redhat.com/archives/libvir-list/2021-March/msg00537.html Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
* Use G_GNUC_PRINTF instead of ATTRIBUTE_FMT_PRINTFJán Tomko2019-10-151-1/+1
| | | | | Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
* util: misc: use #pragma once in headersJonathon Jongsma2019-06-191-9/+6
| | | | | | Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
* Enforce a standard header file guard symbol nameDaniel P. Berrangé2018-12-141-3/+3
| | | | | | | | | | | | | | Require that all headers are guarded by a symbol named LIBVIRT_$FILENAME where $FILENAME is the uppercased filename, with all characters outside a-z changed into '_'. Note we do not use a leading __ because that is technically a namespace reserved for the toolchain. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Fix many mistakes & inconsistencies in header file layoutDaniel P. Berrangé2018-12-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a syntax-check script that validates header files use a common layout: /* ...copyright header... */ <one blank line> #ifndef SYMBOL # define SYMBOL ....content.... #endif /* SYMBOL */ For any file ending priv.h, before the #ifndef, we will require a guard to prevent bogus imports: #ifndef SYMBOL_ALLOW # error .... #endif /* SYMBOL_ALLOW */ <one blank line> The many mistakes this script identifies are then fixed. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* audit: Log only an info message if audit_level < 2 and audit is not supportedMarc Hartmayer2017-12-131-1/+1
| | | | | | | | | | | | Replace the error message during startup of libvirtd with an info message if audit_level < 2 and audit is not supported by the kernel. Audit is not supported by the current kernel if the kernel does not have audit compiled in or if audit is disabled (e.g. by the kernel cmdline). Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* Remove backslash alignment attemptsAndrea Bolognani2017-11-031-4/+4
| | | | | | | | | | | | | | | | | | Right-aligning backslashes when defining macros or using complex commands in Makefiles looks cute, but as soon as any changes is required to the code you end up with either distractingly broken alignment or unnecessarily big diffs where most of the changes are just pushing all backslashes a few characters to one side. Generated using $ git grep -El '[[:blank:]][[:blank:]]\\$' | \ grep -E '*\.([chx]|am|mk)$$' | \ while read f; do \ sed -Ei 's/[[:blank:]]*[[:blank:]]\\$/ \\/g' "$f"; \ done Signed-off-by: Andrea Bolognani <abologna@redhat.com>
* maint: Replace tabs with spaces in all source files in repoErik Skultety2017-10-181-2/+2
| | | | | | | | | | | | | So we have a syntax-check rule to catch all tab indents but it naturally can't catch tab spacing, i.e. as a delimiter. This patch is a result of running 'vim -en +retab +wq' (using tabstop=8 softtabstop=4 shiftwidth=4 expandtab) on each file from a list generated by the following: find . -regextype gnu-awk \ -regex ".*\.(rng|syms|html|s?[ch]|py|pl|php(\.code)?)(\.in)?" \ | xargs git grep -lP "\t" Signed-off-by: Erik Skultety <eskultet@redhat.com>
* audit: use bool for audit log choiceEric Blake2014-10-291-2/+2
| | | | | | | | | | We weren't ever using the value for anything other than being non-zero. * src/util/viraudit.h (virAuditLog): Change signature. * src/util/viraudit.c (virAuditLog): Update user. * daemon/libvirtd.c (main): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
* util: use typedefs for enums in "src/util/" directoryJulio Faracco2014-05-051-3/+3
| | | | | | | | | | In "src/util/" there are many enumeration (enum) declarations. Sometimes, it's better using a typedef for variable types, function types and other usages. Other enumeration will be changed to typedef's in the future. Signed-off-by: Julio Faracco <jcfaracco@gmail.com> Signed-off-by: Eric Blake <eblake@redhat.com>
* Turn virLogSource into a struct instead of an enumDaniel P. Berrange2014-03-181-4/+6
| | | | | | | | | | | As part of the goal to get away from doing string matching on filenames when deciding whether to emit a log message, turn the virLogSource enum into a struct which contains a log "name". There will eventually be one virLogSource instance statically declared per source file. To minimise churn in this commit though, a single global instance is used. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Change logging category parameter into an enumDaniel P. Berrange2012-09-281-3/+3
| | | | | | | | The 'const char *category' parameter only has a few possible values now that the filename has been separated. Turn this parameter into an enum instead. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* maint: fix up copyright notice inconsistenciesEric Blake2012-09-201-1/+1
| | | | | | | | | https://www.gnu.org/licenses/gpl-howto.html recommends that the 'If not, see <url>.' phrase be a separate sentence. * tests/securityselinuxhelper.c: Remove doubled line. * tests/securityselinuxtest.c: Likewise. * globally: s/; If/. If/
* Desert the FSF address in copyrightOsier Yang2012-07-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | Per the FSF address could be changed from time to time, and GNU recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html) You should have received a copy of the GNU General Public License along with Foobar. If not, see <http://www.gnu.org/licenses/>. This patch removes the explicit FSF address, and uses above instead (of course, with inserting 'Lesser' before 'General'). Except a bunch of files for security driver, all others are changed automatically, the copyright for securify files are not complete, that's why to do it manually: src/security/security_selinux.h src/security/security_driver.h src/security/security_selinux.c src/security/security_apparmor.h src/security/security_apparmor.c src/security/security_driver.c
* maint: rename virtaudit to match file contentsEric Blake2011-07-121-0/+59
* src/util/virtaudit.[ch]: Rename... * src/util/viraudit.[ch]: ...to match virAudit* API. * src/Makefile.am (UTIL_SOURCES): Reflect rename. * daemon/libvirtd.c: Likewise. * po/POTFILES.in: Likewise. * src/libvirt_private.syms: Likewise. * src/qemu/qemu_audit.c: Likewise.