From nobody Mon Feb 9 18:18:13 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1560874533; cv=none; d=zoho.com; s=zohoarc; b=B2xc9qxv9zRoEyAzwD18zWTT22syfX/nBTfyInUrJmsnzlV+QmiHrhRo6WizoqP5mXWUG/Fn2YjrI23uIAgamNGfgDWuqsibvREBHy9oXU8BMYxUBm35z471Mrg6pVGrEcnFC6fdxIZ8x+qzTt0RYOFQ9lFMckoE85R3YRIHOfY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874533; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=qY6ToiO6XzmcvNsl+txpId14qCtu1j7W42KpzX3CR00=; b=mNYrGHy8JRys1ObaZ0yEBB51MyDQA7rzHDZtaSBKxiy3yIQmA7ynO/uSL2VMvP7tj+ep1LZJUa5YUn9rO95+fUUSQtzqKqCHs6ZtrJGkGcfcns8ME7U0TX5ZwlE6d+nohQJiswtCvzCoh6FUz3x2z3VF/Ty8fLFD0WRWZw3v7Vs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1560874533562176.12441008959377; Tue, 18 Jun 2019 09:15:33 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ECE2230024A4; Tue, 18 Jun 2019 16:15:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C205E1001DDA; Tue, 18 Jun 2019 16:15:30 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 854891806B1D; Tue, 18 Jun 2019 16:15:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5IGDRPM024179 for ; Tue, 18 Jun 2019 12:13:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id D037660FAB; Tue, 18 Jun 2019 16:13:27 +0000 (UTC) Received: from aegolius.redhat.com (ovpn-117-198.phx2.redhat.com [10.3.117.198]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9DC6E5C2E4 for ; Tue, 18 Jun 2019 16:13:27 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:41 -0500 Message-Id: <20190618161316.1722-12-jjongsma@redhat.com> In-Reply-To: <20190618161316.1722-1-jjongsma@redhat.com> References: <20190618161316.1722-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 11/46] src/security: use #pragma once in headers X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 18 Jun 2019 16:15:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/security/security_apparmor.h | 13 +++++-------- src/security/security_dac.h | 7 ++----- src/security/security_driver.h | 11 ++++------- src/security/security_manager.h | 13 +++++-------- src/security/security_nop.h | 7 ++----- src/security/security_selinux.h | 5 +---- src/security/security_stack.h | 7 ++----- src/security/security_util.h | 5 +---- 8 files changed, 22 insertions(+), 46 deletions(-) diff --git a/src/security/security_apparmor.h b/src/security/security_appar= mor.h index 730f72ff98..7b54eefd8d 100644 --- a/src/security/security_apparmor.h +++ b/src/security/security_apparmor.h @@ -16,15 +16,12 @@ * . */ =20 -#ifndef LIBVIRT_SECURITY_APPARMOR_H -# define LIBVIRT_SECURITY_APPARMOR_H +#pragma once =20 -# include "security_driver.h" +#include "security_driver.h" =20 extern virSecurityDriver virAppArmorSecurityDriver; =20 -# define AA_PREFIX "libvirt-" -# define PROFILE_NAME_SIZE 8 + VIR_UUID_STRING_BUFLEN /* AA_PREFIX + uuid= */ -# define MAX_FILE_LEN (1024*1024*10) /* 10MB limit for sanity check= */ - -#endif /* LIBVIRT_SECURITY_APPARMOR_H */ +#define AA_PREFIX "libvirt-" +#define PROFILE_NAME_SIZE 8 + VIR_UUID_STRING_BUFLEN /* AA_PREFIX + uuid = */ +#define MAX_FILE_LEN (1024*1024*10) /* 10MB limit for sanity check = */ diff --git a/src/security/security_dac.h b/src/security/security_dac.h index 318ca06d75..444e5dcf89 100644 --- a/src/security/security_dac.h +++ b/src/security/security_dac.h @@ -18,10 +18,9 @@ * POSIX DAC security driver */ =20 -#ifndef LIBVIRT_SECURITY_DAC_H -# define LIBVIRT_SECURITY_DAC_H +#pragma once =20 -# include "security_driver.h" +#include "security_driver.h" =20 extern virSecurityDriver virSecurityDriverDAC; =20 @@ -37,5 +36,3 @@ void virSecurityDACSetMountNamespace(virSecurityManagerPt= r mgr, =20 void virSecurityDACSetChownCallback(virSecurityManagerPtr mgr, virSecurityManagerDACChownCallback cho= wnCallback); - -#endif /* LIBVIRT_SECURITY_DAC_H */ diff --git a/src/security/security_driver.h b/src/security/security_driver.h index 36cf9da037..9d0ab4e14a 100644 --- a/src/security/security_driver.h +++ b/src/security/security_driver.h @@ -16,13 +16,12 @@ * . */ =20 -#ifndef LIBVIRT_SECURITY_DRIVER_H -# define LIBVIRT_SECURITY_DRIVER_H +#pragma once =20 -# include "internal.h" -# include "domain_conf.h" +#include "internal.h" +#include "domain_conf.h" =20 -# include "security_manager.h" +#include "security_manager.h" =20 /* * Return values for security driver probing: the driver will determine @@ -216,5 +215,3 @@ struct _virSecurityDriver { =20 virSecurityDriverPtr virSecurityDriverLookup(const char *name, const char *virtDriver); - -#endif /* LIBVIRT_SECURITY_DRIVER_H */ diff --git a/src/security/security_manager.h b/src/security/security_manage= r.h index 7e174a33ee..88ed9919a2 100644 --- a/src/security/security_manager.h +++ b/src/security/security_manager.h @@ -18,12 +18,11 @@ * . */ =20 -#ifndef LIBVIRT_SECURITY_MANAGER_H -# define LIBVIRT_SECURITY_MANAGER_H +#pragma once =20 -# include "domain_conf.h" -# include "vircommand.h" -# include "virstoragefile.h" +#include "domain_conf.h" +#include "vircommand.h" +#include "virstoragefile.h" =20 typedef struct _virSecurityManager virSecurityManager; typedef virSecurityManager *virSecurityManagerPtr; @@ -36,7 +35,7 @@ typedef enum { VIR_SECURITY_MANAGER_MOUNT_NAMESPACE =3D 1 << 5, } virSecurityManagerNewFlags; =20 -# define VIR_SECURITY_MANAGER_NEW_MASK \ +#define VIR_SECURITY_MANAGER_NEW_MASK \ (VIR_SECURITY_MANAGER_DEFAULT_CONFINED | \ VIR_SECURITY_MANAGER_REQUIRE_CONFINED | \ VIR_SECURITY_MANAGER_PRIVILEGED) @@ -207,5 +206,3 @@ virSecurityManagerMetadataLock(virSecurityManagerPtr mg= r, void virSecurityManagerMetadataUnlock(virSecurityManagerPtr mgr, virSecurityManagerMetadataLockStatePtr *s= tate); - -#endif /* LIBVIRT_SECURITY_MANAGER_H */ diff --git a/src/security/security_nop.h b/src/security/security_nop.h index 31e46420b1..94ced9802c 100644 --- a/src/security/security_nop.h +++ b/src/security/security_nop.h @@ -17,11 +17,8 @@ * */ =20 -#ifndef LIBVIRT_SECURITY_NOP_H -# define LIBVIRT_SECURITY_NOP_H +#pragma once =20 -# include "security_driver.h" +#include "security_driver.h" =20 extern virSecurityDriver virSecurityDriverNop; - -#endif /* LIBVIRT_SECURITY_NOP_H */ diff --git a/src/security/security_selinux.h b/src/security/security_selinu= x.h index dfd2b73baa..eb992bd53b 100644 --- a/src/security/security_selinux.h +++ b/src/security/security_selinux.h @@ -16,9 +16,6 @@ * . */ =20 -#ifndef LIBVIRT_SECURITY_SELINUX_H -# define LIBVIRT_SECURITY_SELINUX_H +#pragma once =20 extern virSecurityDriver virSecurityDriverSELinux; - -#endif /* LIBVIRT_SECURITY_SELINUX_H */ diff --git a/src/security/security_stack.h b/src/security/security_stack.h index 8c264d967a..e35f149bed 100644 --- a/src/security/security_stack.h +++ b/src/security/security_stack.h @@ -18,10 +18,9 @@ * Stacked security driver */ =20 -#ifndef LIBVIRT_SECURITY_STACK_H -# define LIBVIRT_SECURITY_STACK_H +#pragma once =20 -# include "security_driver.h" +#include "security_driver.h" =20 extern virSecurityDriver virSecurityDriverStack; =20 @@ -34,5 +33,3 @@ virSecurityStackGetPrimary(virSecurityManagerPtr mgr); =20 virSecurityManagerPtr* virSecurityStackGetNested(virSecurityManagerPtr mgr); - -#endif /* LIBVIRT_SECURITY_STACK_H */ diff --git a/src/security/security_util.h b/src/security/security_util.h index bc977ed65d..aacac5c64c 100644 --- a/src/security/security_util.h +++ b/src/security/security_util.h @@ -16,8 +16,7 @@ * . */ =20 -#ifndef LIBVIRT_SECURITY_UTIL_H -# define LIBVIRT_SECURITY_UTIL_H +#pragma once =20 int virSecurityGetRememberedLabel(const char *name, @@ -28,5 +27,3 @@ int virSecuritySetRememberedLabel(const char *name, const char *path, const char *label); - -#endif /* LIBVIRT_SECURITY_UTIL_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list