From nobody Sun Apr 28 16:27:39 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554296809888610.743022910373; Wed, 3 Apr 2019 06:06:49 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4DA67C00735C; Wed, 3 Apr 2019 13:06:48 +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 BB6F56014B; Wed, 3 Apr 2019 13:06:47 +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 F0BFF1803389; Wed, 3 Apr 2019 13:06:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x33D6foi015085 for ; Wed, 3 Apr 2019 09:06:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3EA4F19926; Wed, 3 Apr 2019 13:06:41 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id BAE4C19736 for ; Wed, 3 Apr 2019 13:06:40 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 3 Apr 2019 15:06:33 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/5] util: Move VIR_AUTOUNREF definition to virobject.h 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.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 03 Apr 2019 13:06:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This helper has solely to do with virObjects. Move it together with other virObject stuff. This also avoids the potential problem where VIR_AUTOUNREF uses virObjectAutoUnref which is defined in virobject.h. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/util/viralloc.h | 11 ----------- src/util/virobject.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/util/viralloc.h b/src/util/viralloc.h index a1708b772c..93ec36aae2 100644 --- a/src/util/viralloc.h +++ b/src/util/viralloc.h @@ -682,15 +682,4 @@ void virAllocTestHook(void (*func)(int, void*), void *= data); # define VIR_AUTOCLEAN(type) \ __attribute__((cleanup(VIR_AUTOCLEAN_FUNC_NAME(type)))) type - -/** - * VIR_AUTOUNREF: - * @type: type of an virObject subclass to be unref'd automatically - * - * Declares a variable of @type which will be automatically unref'd when - * control goes out of the scope. - */ -# define VIR_AUTOUNREF(type) \ - __attribute__((cleanup(virObjectAutoUnref))) type - #endif /* LIBVIRT_VIRALLOC_H */ diff --git a/src/util/virobject.h b/src/util/virobject.h index 757068fcc1..10ccb491a0 100644 --- a/src/util/virobject.h +++ b/src/util/virobject.h @@ -110,6 +110,16 @@ virObjectNew(virClassPtr klass) bool virObjectUnref(void *obj); +/** + * VIR_AUTOUNREF: + * @type: type of an virObject subclass to be unref'd automatically + * + * Declares a variable of @type which will be automatically unref'd when + * control goes out of the scope. + */ +# define VIR_AUTOUNREF(type) \ + __attribute__((cleanup(virObjectAutoUnref))) type + void virObjectAutoUnref(void *objptr); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 16:27:39 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554296817894141.45755332810643; Wed, 3 Apr 2019 06:06:57 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D65B6307D85B; Wed, 3 Apr 2019 13:06:56 +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 AE11362A14; Wed, 3 Apr 2019 13:06:56 +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 71A9018033A2; Wed, 3 Apr 2019 13:06:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x33D6gnl015095 for ; Wed, 3 Apr 2019 09:06:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 126F219736; Wed, 3 Apr 2019 13:06:42 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E2BF19926 for ; Wed, 3 Apr 2019 13:06:41 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 3 Apr 2019 15:06:34 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/5] util: Move the VIR_AUTO(CLEAN|PTR) helper macros into a separate header 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.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 03 Apr 2019 13:06:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Keeping them with viralloc.h forcibly pulls in the other stuff from viralloc.h into other header files. This in turn creates a mess as more and more headers pull in the 'viral' header file. If we want to make 'viralloc.h' omnipresent we should pick a different approach. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/Makefile.am | 2 + src/util/Makefile.inc.am | 1 + src/util/viralloc.h | 66 ----------------------------- src/util/virauthconfig.h | 1 + src/util/virautoclean.h | 90 ++++++++++++++++++++++++++++++++++++++++ src/util/virbitmap.h | 1 + src/util/virbuffer.h | 1 + src/util/virerror.h | 1 + src/util/virfirewall.h | 1 + src/util/virhash.h | 1 + src/util/virmacaddr.h | 1 + src/util/virnetdevvlan.h | 1 + src/util/virperf.h | 1 + src/util/virsocketaddr.h | 1 + 14 files changed, 103 insertions(+), 66 deletions(-) create mode 100644 src/util/virautoclean.h diff --git a/src/Makefile.am b/src/Makefile.am index a73f43c483..b3b1e172ff 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -662,6 +662,7 @@ libvirt_setuid_rpc_client_la_SOURCES =3D \ util/virarch.c \ util/viratomic.c \ util/viratomic.h \ + util/virautoclean.h \ util/virbitmap.c \ util/virbuffer.c \ util/vircgroup.c \ @@ -874,6 +875,7 @@ libvirt_nss_la_SOURCES =3D \ util/viralloc.h \ util/viratomic.c \ util/viratomic.h \ + util/virautoclean.h \ util/virbitmap.c \ util/virbitmap.h \ util/virbuffer.c \ diff --git a/src/util/Makefile.inc.am b/src/util/Makefile.inc.am index aa5c6cbe03..6b24245aa1 100644 --- a/src/util/Makefile.inc.am +++ b/src/util/Makefile.inc.am @@ -15,6 +15,7 @@ UTIL_SOURCES =3D \ util/virauth.h \ util/virauthconfig.c \ util/virauthconfig.h \ + util/virautoclean.h \ util/virbitmap.c \ util/virbitmap.h \ util/virbuffer.c \ diff --git a/src/util/viralloc.h b/src/util/viralloc.h index 93ec36aae2..92c71d9a1a 100644 --- a/src/util/viralloc.h +++ b/src/util/viralloc.h @@ -606,42 +606,6 @@ int virAllocTestCount(void); void virAllocTestOOM(int n, int m); void virAllocTestHook(void (*func)(int, void*), void *data); -# define VIR_AUTOPTR_FUNC_NAME(type) type##AutoPtrFree - -/** - * VIR_DEFINE_AUTOPTR_FUNC: - * @type: type of the variable to be freed automatically - * @func: cleanup function to be automatically called - * - * This macro defines a function for automatic freeing of - * resources allocated to a variable of type @type. This newly - * defined function works as a necessary wrapper around @func. - */ -# define VIR_DEFINE_AUTOPTR_FUNC(type, func) \ - static inline void VIR_AUTOPTR_FUNC_NAME(type)(type **_ptr) \ - { \ - if (*_ptr) \ - (func)(*_ptr); \ - *_ptr =3D NULL; \ - } - -# define VIR_AUTOCLEAN_FUNC_NAME(type) type##AutoClean - -/** - * VIR_DEFINE_AUTOCLEAN_FUNC: - * @type: type of the variable to be cleared automatically - * @func: cleanup function to be automatically called - * - * This macro defines a function for automatic clearing of - * resources in a stack'd variable of type @type. Note that @func must - * take pointer to @type. - */ -# define VIR_DEFINE_AUTOCLEAN_FUNC(type, func) \ - static inline void VIR_AUTOCLEAN_FUNC_NAME(type)(type *_ptr) \ - { \ - (func)(_ptr); \ - } - /** * VIR_AUTOFREE: * @type: type of the variable to be freed automatically @@ -652,34 +616,4 @@ void virAllocTestHook(void (*func)(int, void*), void *= data); */ # define VIR_AUTOFREE(type) __attribute__((cleanup(virFree))) type -/** - * VIR_AUTOPTR: - * @type: type of the variable to be freed automatically - * - * Macro to automatically free the memory allocated to - * the variable declared with it by calling the function - * defined by VIR_DEFINE_AUTOPTR_FUNC when the variable - * goes out of scope. - * - * Note that this macro must NOT be used with vectors! The freeing function - * will not free any elements beyond the first. - */ -# define VIR_AUTOPTR(type) \ - __attribute__((cleanup(VIR_AUTOPTR_FUNC_NAME(type)))) type * - -/** - * VIR_AUTOCLEAN: - * @type: type of the variable to be cleared automatically - * - * Macro to automatically call clearing function registered for variable o= f @type - * when the variable goes out of scope. - * The cleanup function is registered by VIR_DEFINE_AUTOCLEAN_FUNC macro f= or - * the given type. - * - * Note that this macro must NOT be used with vectors! The cleaning functi= on - * will not clean any elements beyond the first. - */ -# define VIR_AUTOCLEAN(type) \ - __attribute__((cleanup(VIR_AUTOCLEAN_FUNC_NAME(type)))) type - #endif /* LIBVIRT_VIRALLOC_H */ diff --git a/src/util/virauthconfig.h b/src/util/virauthconfig.h index 603ef89d25..9da0366e81 100644 --- a/src/util/virauthconfig.h +++ b/src/util/virauthconfig.h @@ -23,6 +23,7 @@ # include "internal.h" # include "viralloc.h" +# include "virautoclean.h" typedef struct _virAuthConfig virAuthConfig; typedef virAuthConfig *virAuthConfigPtr; diff --git a/src/util/virautoclean.h b/src/util/virautoclean.h new file mode 100644 index 0000000000..b632023c73 --- /dev/null +++ b/src/util/virautoclean.h @@ -0,0 +1,90 @@ +/* + * virautoclean.h: automatic scope-based memory clearing helper macros for + * use in header files + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + * + */ + +#ifndef LIBVIRT_VIRAUTOCLEAN_H +# define LIBVIRT_VIRAUTOCLEAN_H + +# define VIR_AUTOPTR_FUNC_NAME(type) type##AutoPtrFree + +/** + * VIR_DEFINE_AUTOPTR_FUNC: + * @type: type of the variable to be freed automatically + * @func: cleanup function to be automatically called + * + * This macro defines a function for automatic freeing of + * resources allocated to a variable of type @type. This newly + * defined function works as a necessary wrapper around @func. + */ +# define VIR_DEFINE_AUTOPTR_FUNC(type, func) \ + static inline void VIR_AUTOPTR_FUNC_NAME(type)(type **_ptr) \ + { \ + if (*_ptr) \ + (func)(*_ptr); \ + *_ptr =3D NULL; \ + } + +# define VIR_AUTOCLEAN_FUNC_NAME(type) type##AutoClean + +/** + * VIR_DEFINE_AUTOCLEAN_FUNC: + * @type: type of the variable to be cleared automatically + * @func: cleanup function to be automatically called + * + * This macro defines a function for automatic clearing of + * resources in a stack'd variable of type @type. Note that @func must + * take pointer to @type. + */ +# define VIR_DEFINE_AUTOCLEAN_FUNC(type, func) \ + static inline void VIR_AUTOCLEAN_FUNC_NAME(type)(type *_ptr) \ + { \ + (func)(_ptr); \ + } + +/** + * VIR_AUTOPTR: + * @type: type of the variable to be freed automatically + * + * Macro to automatically free the memory allocated to + * the variable declared with it by calling the function + * defined by VIR_DEFINE_AUTOPTR_FUNC when the variable + * goes out of scope. + * + * Note that this macro must NOT be used with vectors! The freeing function + * will not free any elements beyond the first. + */ +# define VIR_AUTOPTR(type) \ + __attribute__((cleanup(VIR_AUTOPTR_FUNC_NAME(type)))) type * + +/** + * VIR_AUTOCLEAN: + * @type: type of the variable to be cleared automatically + * + * Macro to automatically call clearing function registered for variable o= f @type + * when the variable goes out of scope. + * The cleanup function is registered by VIR_DEFINE_AUTOCLEAN_FUNC macro f= or + * the given type. + * + * Note that this macro must NOT be used with vectors! The cleaning functi= on + * will not clean any elements beyond the first. + */ +# define VIR_AUTOCLEAN(type) \ + __attribute__((cleanup(VIR_AUTOCLEAN_FUNC_NAME(type)))) type + +#endif /* LIBVIRT_VIRAUTOCLEAN_H */ diff --git a/src/util/virbitmap.h b/src/util/virbitmap.h index c54e203971..b4d3673292 100644 --- a/src/util/virbitmap.h +++ b/src/util/virbitmap.h @@ -24,6 +24,7 @@ # include "internal.h" # include "viralloc.h" +# include "virautoclean.h" # include diff --git a/src/util/virbuffer.h b/src/util/virbuffer.h index 18957ae02c..2f5efdf2b7 100644 --- a/src/util/virbuffer.h +++ b/src/util/virbuffer.h @@ -25,6 +25,7 @@ # include "internal.h" # include "viralloc.h" +# include "virautoclean.h" /** diff --git a/src/util/virerror.h b/src/util/virerror.h index 213bc3f606..4f691550bc 100644 --- a/src/util/virerror.h +++ b/src/util/virerror.h @@ -24,6 +24,7 @@ # include "internal.h" # include "viralloc.h" +# include "virautoclean.h" # define VIR_ERROR_MAX_LENGTH 1024 diff --git a/src/util/virfirewall.h b/src/util/virfirewall.h index e3ad1adb6b..63bf915233 100644 --- a/src/util/virfirewall.h +++ b/src/util/virfirewall.h @@ -23,6 +23,7 @@ # include "internal.h" # include "viralloc.h" +# include "virautoclean.h" typedef struct _virFirewall virFirewall; typedef virFirewall *virFirewallPtr; diff --git a/src/util/virhash.h b/src/util/virhash.h index 2df1a5d12a..b1de808b18 100644 --- a/src/util/virhash.h +++ b/src/util/virhash.h @@ -12,6 +12,7 @@ # include "viralloc.h" +# include "virautoclean.h" /* * The hash table. diff --git a/src/util/virmacaddr.h b/src/util/virmacaddr.h index 1deaf087e0..6cb0ce3264 100644 --- a/src/util/virmacaddr.h +++ b/src/util/virmacaddr.h @@ -23,6 +23,7 @@ # include "internal.h" # include "viralloc.h" +# include "virautoclean.h" # define VIR_MAC_BUFLEN 6 # define VIR_MAC_HEXLEN (VIR_MAC_BUFLEN * 2) diff --git a/src/util/virnetdevvlan.h b/src/util/virnetdevvlan.h index 2a13759550..ff4fb94abc 100644 --- a/src/util/virnetdevvlan.h +++ b/src/util/virnetdevvlan.h @@ -22,6 +22,7 @@ # include # include "viralloc.h" +# include "virautoclean.h" typedef enum { VIR_NATIVE_VLAN_MODE_DEFAULT =3D 0, diff --git a/src/util/virperf.h b/src/util/virperf.h index 3cd26563b4..b625bb6846 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -21,6 +21,7 @@ # include "virutil.h" # include "viralloc.h" +# include "virautoclean.h" /* Some Intel processor families introduced some RDT (Resource Director * Technology) features to monitor or control shared resource based on diff --git a/src/util/virsocketaddr.h b/src/util/virsocketaddr.h index f6caa4fcf5..2cc3f94b80 100644 --- a/src/util/virsocketaddr.h +++ b/src/util/virsocketaddr.h @@ -27,6 +27,7 @@ # include "internal.h" # include "viralloc.h" +# include "virautoclean.h" /* On architectures which lack these limits, define them (ie. Cygwin). * Note that the libvirt code should be robust enough to handle the --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 16:27:39 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554296818087235.71548574176416; Wed, 3 Apr 2019 06:06:58 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EB010308426A; Wed, 3 Apr 2019 13:06:56 +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 BD7F617C2B; Wed, 3 Apr 2019 13:06:56 +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 776461819AFC; Wed, 3 Apr 2019 13:06:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x33D6hFb015112 for ; Wed, 3 Apr 2019 09:06:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 09EF719926; Wed, 3 Apr 2019 13:06:43 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6038C19736 for ; Wed, 3 Apr 2019 13:06:42 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 3 Apr 2019 15:06:35 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/5] util: Don't include 'viralloc.h' into other header files 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.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 03 Apr 2019 13:06:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" 'viralloc.h' does not provide any type or macro which would be necessary in headers. Prevent leakage of the inclusion. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_capabilities.h | 1 - src/conf/node_device_util.c | 1 + src/conf/virdomainmomentobjlist.c | 1 + src/conf/virdomainsnapshotobjlist.c | 1 + src/lxc/lxc_fuse.c | 1 + src/lxc/lxc_fuse.h | 1 - src/qemu/qemu_firmware.c | 1 + src/qemu/qemu_firmware.h | 1 - src/util/virauth.c | 1 + src/util/virauthconfig.c | 1 + src/util/virauthconfig.h | 1 - src/util/virbitmap.c | 1 + src/util/virbitmap.h | 1 - src/util/virbuffer.c | 1 + src/util/virbuffer.h | 1 - src/util/vircgroupv1.c | 1 + src/util/vircgroupv2.c | 1 + src/util/vircommand.c | 1 + src/util/vircommand.h | 1 - src/util/virerror.c | 1 + src/util/virerror.h | 1 - src/util/virfile.c | 1 + src/util/virfile.h | 1 - src/util/virfirewall.c | 1 + src/util/virfirewall.h | 1 - src/util/virfirewalld.c | 1 + src/util/virhash.c | 1 + src/util/virhash.h | 1 - src/util/virjson.c | 1 + src/util/virjson.h | 1 - src/util/virmacaddr.c | 1 + src/util/virmacaddr.h | 1 - src/util/virmdev.c | 1 + src/util/virmdev.h | 1 - src/util/virnetdev.c | 1 + src/util/virnetdev.h | 1 - src/util/virnetdevip.c | 1 + src/util/virnetdevvlan.c | 1 + src/util/virnetdevvlan.h | 1 - src/util/virnetlink.c | 1 + src/util/virnetlink.h | 1 - src/util/virpci.c | 1 + src/util/virpci.h | 1 - src/util/virperf.c | 1 + src/util/virperf.h | 1 - src/util/virscsi.c | 1 + src/util/virscsi.h | 1 - src/util/virscsivhost.c | 1 + src/util/virscsivhost.h | 1 - src/util/virsocketaddr.c | 1 + src/util/virsocketaddr.h | 1 - src/util/virstring.h | 1 - src/util/virusb.c | 1 + src/util/virusb.h | 1 - tests/qemusecuritymock.c | 1 + tests/vircgroupmock.c | 1 + 56 files changed, 32 insertions(+), 24 deletions(-) diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 26f4b8c394..28e7d495c5 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -23,7 +23,6 @@ # include "internal.h" # include "domain_conf.h" -# include "viralloc.h" typedef const char * (*virDomainCapsValToStr)(int value); diff --git a/src/conf/node_device_util.c b/src/conf/node_device_util.c index d1d9c3ee49..859ff9ebbb 100644 --- a/src/conf/node_device_util.c +++ b/src/conf/node_device_util.c @@ -25,6 +25,7 @@ #include "virscsihost.h" #include "virstring.h" #include "virvhba.h" +#include "viralloc.h" #define VIR_FROM_THIS VIR_FROM_NODEDEV diff --git a/src/conf/virdomainmomentobjlist.c b/src/conf/virdomainmomentob= jlist.c index 65e82f632c..553150a4b1 100644 --- a/src/conf/virdomainmomentobjlist.c +++ b/src/conf/virdomainmomentobjlist.c @@ -28,6 +28,7 @@ #include "virerror.h" #include "virstring.h" #include "moment_conf.h" +#include "viralloc.h" /* FIXME: using virObject would allow us to not need this */ #include "snapshot_conf.h" diff --git a/src/conf/virdomainsnapshotobjlist.c b/src/conf/virdomainsnapsh= otobjlist.c index 4ddc2a4b65..46b7d8b0e7 100644 --- a/src/conf/virdomainsnapshotobjlist.c +++ b/src/conf/virdomainsnapshotobjlist.c @@ -29,6 +29,7 @@ #include "virerror.h" #include "datatypes.h" #include "virstring.h" +#include "viralloc.h" #define VIR_FROM_THIS VIR_FROM_DOMAIN_SNAPSHOT diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c index e0b77031da..4137d1b04f 100644 --- a/src/lxc/lxc_fuse.c +++ b/src/lxc/lxc_fuse.c @@ -30,6 +30,7 @@ #include "virfile.h" #include "virbuffer.h" #include "virstring.h" +#include "viralloc.h" #define VIR_FROM_THIS VIR_FROM_LXC diff --git a/src/lxc/lxc_fuse.h b/src/lxc/lxc_fuse.h index f8230e64c5..95285ae915 100644 --- a/src/lxc/lxc_fuse.h +++ b/src/lxc/lxc_fuse.h @@ -28,7 +28,6 @@ # endif # include "lxc_conf.h" -# include "viralloc.h" struct virLXCMeminfo { unsigned long long memtotal; diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index 4ce010caaa..d28905d1b4 100644 --- a/src/qemu/qemu_firmware.c +++ b/src/qemu/qemu_firmware.c @@ -33,6 +33,7 @@ #include "virjson.h" #include "virlog.h" #include "virstring.h" +#include "viralloc.h" #define VIR_FROM_THIS VIR_FROM_QEMU diff --git a/src/qemu/qemu_firmware.h b/src/qemu/qemu_firmware.h index 7f8a0e4a15..78b2d2fe07 100644 --- a/src/qemu/qemu_firmware.h +++ b/src/qemu/qemu_firmware.h @@ -22,7 +22,6 @@ # define LIBVIRT_QEMU_FIRMWARE_H # include "domain_conf.h" -# include "viralloc.h" # include "qemu_conf.h" typedef struct _qemuFirmware qemuFirmware; diff --git a/src/util/virauth.c b/src/util/virauth.c index 9c95332e76..e5994cbb7c 100644 --- a/src/util/virauth.c +++ b/src/util/virauth.c @@ -24,6 +24,7 @@ #include "virauth.h" +#include "viralloc.h" #include "virutil.h" #include "virlog.h" #include "datatypes.h" diff --git a/src/util/virauthconfig.c b/src/util/virauthconfig.c index 1de7e7ecb9..2c6379680a 100644 --- a/src/util/virauthconfig.c +++ b/src/util/virauthconfig.c @@ -26,6 +26,7 @@ #include "virlog.h" #include "virerror.h" #include "virstring.h" +#include "viralloc.h" struct _virAuthConfig { virKeyFilePtr keyfile; diff --git a/src/util/virauthconfig.h b/src/util/virauthconfig.h index 9da0366e81..cc30affa33 100644 --- a/src/util/virauthconfig.h +++ b/src/util/virauthconfig.h @@ -22,7 +22,6 @@ # define LIBVIRT_VIRAUTHCONFIG_H # include "internal.h" -# include "viralloc.h" # include "virautoclean.h" typedef struct _virAuthConfig virAuthConfig; diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c index d074f29e54..3573b973ec 100644 --- a/src/util/virbitmap.c +++ b/src/util/virbitmap.c @@ -24,6 +24,7 @@ #include #include "virbitmap.h" +#include "viralloc.h" #include "virbuffer.h" #include "c-ctype.h" #include "count-one-bits.h" diff --git a/src/util/virbitmap.h b/src/util/virbitmap.h index b4d3673292..38dc06412a 100644 --- a/src/util/virbitmap.h +++ b/src/util/virbitmap.h @@ -23,7 +23,6 @@ # define LIBVIRT_VIRBITMAP_H # include "internal.h" -# include "viralloc.h" # include "virautoclean.h" # include diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c index 2e1e4abead..54703a28d8 100644 --- a/src/util/virbuffer.c +++ b/src/util/virbuffer.c @@ -26,6 +26,7 @@ #include "virbuffer.h" #include "virerror.h" #include "virstring.h" +#include "viralloc.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/src/util/virbuffer.h b/src/util/virbuffer.h index 2f5efdf2b7..fbfed5cbf3 100644 --- a/src/util/virbuffer.h +++ b/src/util/virbuffer.h @@ -24,7 +24,6 @@ # include # include "internal.h" -# include "viralloc.h" # include "virautoclean.h" diff --git a/src/util/vircgroupv1.c b/src/util/vircgroupv1.c index c172eb8b96..6224072db0 100644 --- a/src/util/vircgroupv1.c +++ b/src/util/vircgroupv1.c @@ -39,6 +39,7 @@ #include "virstring.h" #include "virsystemd.h" #include "virerror.h" +#include "viralloc.h" VIR_LOG_INIT("util.cgroup"); diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 4084929c5a..940ee58528 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -29,6 +29,7 @@ #define LIBVIRT_VIRCGROUPPRIV_H_ALLOW #include "vircgrouppriv.h" +#include "viralloc.h" #include "vircgroup.h" #include "vircgroupbackend.h" #include "vircgroupv2.h" diff --git a/src/util/vircommand.c b/src/util/vircommand.c index 15e2f0ef1e..9e99697c55 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -42,6 +42,7 @@ #endif #define LIBVIRT_VIRCOMMANDPRIV_H_ALLOW +#include "viralloc.h" #include "vircommandpriv.h" #include "virerror.h" #include "virutil.h" diff --git a/src/util/vircommand.h b/src/util/vircommand.h index efdc5dd00d..8719deb033 100644 --- a/src/util/vircommand.h +++ b/src/util/vircommand.h @@ -24,7 +24,6 @@ # include "internal.h" # include "virbuffer.h" -# include "viralloc.h" typedef struct _virCommand virCommand; typedef virCommand *virCommandPtr; diff --git a/src/util/virerror.c b/src/util/virerror.c index 05e535d859..d26dd2b1f1 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -24,6 +24,7 @@ #include "virerror.h" #include "datatypes.h" +#include "viralloc.h" #include "virlog.h" #include "virthread.h" #include "virutil.h" diff --git a/src/util/virerror.h b/src/util/virerror.h index 4f691550bc..8f51510dc2 100644 --- a/src/util/virerror.h +++ b/src/util/virerror.h @@ -23,7 +23,6 @@ # define LIBVIRT_VIRERROR_H # include "internal.h" -# include "viralloc.h" # include "virautoclean.h" # define VIR_ERROR_MAX_LENGTH 1024 diff --git a/src/util/virfile.c b/src/util/virfile.c index ec8d85929c..cc5b029fe2 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -70,6 +70,7 @@ #include "configmake.h" #include "intprops.h" +#include "viralloc.h" #include "vircommand.h" #include "virerror.h" #include "virfile.h" diff --git a/src/util/virfile.h b/src/util/virfile.h index 3dedb7666a..5171984b6f 100644 --- a/src/util/virfile.h +++ b/src/util/virfile.h @@ -30,7 +30,6 @@ # include "internal.h" # include "virbitmap.h" # include "virstoragefile.h" -# include "viralloc.h" typedef enum { VIR_FILE_CLOSE_PRESERVE_ERRNO =3D 1 << 0, diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c index d42c734ea6..940cc9b3f9 100644 --- a/src/util/virfirewall.c +++ b/src/util/virfirewall.c @@ -25,6 +25,7 @@ #define LIBVIRT_VIRFIREWALLPRIV_H_ALLOW #include "virfirewallpriv.h" #include "virfirewalld.h" +#include "viralloc.h" #include "virerror.h" #include "virutil.h" #include "virstring.h" diff --git a/src/util/virfirewall.h b/src/util/virfirewall.h index 63bf915233..a0e81a9a46 100644 --- a/src/util/virfirewall.h +++ b/src/util/virfirewall.h @@ -22,7 +22,6 @@ # define LIBVIRT_VIRFIREWALL_H # include "internal.h" -# include "viralloc.h" # include "virautoclean.h" typedef struct _virFirewall virFirewall; diff --git a/src/util/virfirewalld.c b/src/util/virfirewalld.c index f8965eea09..7a730f2bea 100644 --- a/src/util/virfirewalld.c +++ b/src/util/virfirewalld.c @@ -26,6 +26,7 @@ #include "virfirewalld.h" #define LIBVIRT_VIRFIREWALLDPRIV_H_ALLOW #include "virfirewalldpriv.h" +#include "viralloc.h" #include "virerror.h" #include "virutil.h" #include "virlog.h" diff --git a/src/util/virhash.c b/src/util/virhash.c index 4fcdd61043..4907c1124f 100644 --- a/src/util/virhash.c +++ b/src/util/virhash.c @@ -21,6 +21,7 @@ #include "virerror.h" #include "virhash.h" +#include "viralloc.h" #include "virlog.h" #include "virhashcode.h" #include "virrandom.h" diff --git a/src/util/virhash.h b/src/util/virhash.h index b1de808b18..d2156a5ce0 100644 --- a/src/util/virhash.h +++ b/src/util/virhash.h @@ -11,7 +11,6 @@ # define LIBVIRT_VIRHASH_H -# include "viralloc.h" # include "virautoclean.h" /* diff --git a/src/util/virjson.c b/src/util/virjson.c index c519f8139e..467561c744 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -24,6 +24,7 @@ #include #include "virjson.h" +#include "viralloc.h" #include "virerror.h" #include "virlog.h" #include "virstring.h" diff --git a/src/util/virjson.h b/src/util/virjson.h index ec86603794..e362806a66 100644 --- a/src/util/virjson.h +++ b/src/util/virjson.h @@ -25,7 +25,6 @@ # include "internal.h" # include "virbitmap.h" -# include "viralloc.h" # include "virbuffer.h" # include diff --git a/src/util/virmacaddr.c b/src/util/virmacaddr.c index 3235f26182..5f825735ae 100644 --- a/src/util/virmacaddr.c +++ b/src/util/virmacaddr.c @@ -25,6 +25,7 @@ #include "virmacaddr.h" #include "virrandom.h" #include "virutil.h" +#include "viralloc.h" static const unsigned char virMacAddrBroadcastAddrRaw[VIR_MAC_BUFLEN] =3D { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; diff --git a/src/util/virmacaddr.h b/src/util/virmacaddr.h index 6cb0ce3264..55f9d61abe 100644 --- a/src/util/virmacaddr.h +++ b/src/util/virmacaddr.h @@ -22,7 +22,6 @@ # define LIBVIRT_VIRMACADDR_H # include "internal.h" -# include "viralloc.h" # include "virautoclean.h" # define VIR_MAC_BUFLEN 6 diff --git a/src/util/virmdev.c b/src/util/virmdev.c index 814dc55952..aa046f519e 100644 --- a/src/util/virmdev.c +++ b/src/util/virmdev.c @@ -24,6 +24,7 @@ #include "virerror.h" #include "virfile.h" #include "virstring.h" +#include "viralloc.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/src/util/virmdev.h b/src/util/virmdev.h index d787d354e4..0d3bc506e2 100644 --- a/src/util/virmdev.h +++ b/src/util/virmdev.h @@ -22,7 +22,6 @@ # include "internal.h" # include "virobject.h" # include "virutil.h" -# include "viralloc.h" typedef enum { VIR_MDEV_MODEL_TYPE_VFIO_PCI =3D 0, diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 699f2a0acb..5c0e9723b9 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -20,6 +20,7 @@ #include "dirname.h" #include "virnetdev.h" +#include "viralloc.h" #include "virnetlink.h" #include "virmacaddr.h" #include "virfile.h" diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h index 6f6094eebe..98357128e4 100644 --- a/src/util/virnetdev.h +++ b/src/util/virnetdev.h @@ -26,7 +26,6 @@ # include "virmacaddr.h" # include "virpci.h" # include "virnetdevvlan.h" -# include "viralloc.h" # ifdef HAVE_STRUCT_IFREQ typedef struct ifreq virIfreq; diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c index f39467f1d6..e2009fd829 100644 --- a/src/util/virnetdevip.c +++ b/src/util/virnetdevip.c @@ -27,6 +27,7 @@ #include "virstring.h" #include "virutil.h" #include "vircommand.h" +#include "viralloc.h" #if HAVE_GETIFADDRS # include diff --git a/src/util/virnetdevvlan.c b/src/util/virnetdevvlan.c index e5d65f4dba..2076cc48dc 100644 --- a/src/util/virnetdevvlan.c +++ b/src/util/virnetdevvlan.c @@ -21,6 +21,7 @@ #include "internal.h" #include "virerror.h" #include "virnetdevvlan.h" +#include "viralloc.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/src/util/virnetdevvlan.h b/src/util/virnetdevvlan.h index ff4fb94abc..c250181f69 100644 --- a/src/util/virnetdevvlan.h +++ b/src/util/virnetdevvlan.h @@ -21,7 +21,6 @@ # include -# include "viralloc.h" # include "virautoclean.h" typedef enum { diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c index 1d8467e643..7b3c6bf05f 100644 --- a/src/util/virnetlink.c +++ b/src/util/virnetlink.c @@ -33,6 +33,7 @@ #include "virthread.h" #include "virmacaddr.h" #include "virerror.h" +#include "viralloc.h" #define VIR_FROM_THIS VIR_FROM_NET diff --git a/src/util/virnetlink.h b/src/util/virnetlink.h index 9dd7b3c3ed..d3b7e6276a 100644 --- a/src/util/virnetlink.h +++ b/src/util/virnetlink.h @@ -22,7 +22,6 @@ # include "internal.h" # include "virmacaddr.h" -# include "viralloc.h" # if defined(__linux__) && defined(HAVE_LIBNL) diff --git a/src/util/virpci.c b/src/util/virpci.c index adeab66d77..871aaa392d 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -38,6 +38,7 @@ #include "virkmod.h" #include "virstring.h" #include "virutil.h" +#include "viralloc.h" VIR_LOG_INIT("util.pci"); diff --git a/src/util/virpci.h b/src/util/virpci.h index c8fc1e8bf6..e89ea8390c 100644 --- a/src/util/virpci.h +++ b/src/util/virpci.h @@ -25,7 +25,6 @@ # include "virmdev.h" # include "virobject.h" # include "virutil.h" -# include "viralloc.h" typedef struct _virPCIDevice virPCIDevice; typedef virPCIDevice *virPCIDevicePtr; diff --git a/src/util/virperf.c b/src/util/virperf.c index 65235dda6a..6ecfc29cb2 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -28,6 +28,7 @@ #include "virfile.h" #include "virstring.h" #include "virtypedparam.h" +#include "viralloc.h" VIR_LOG_INIT("util.perf"); diff --git a/src/util/virperf.h b/src/util/virperf.h index b625bb6846..f43b856723 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -20,7 +20,6 @@ # define LIBVIRT_VIRPERF_H # include "virutil.h" -# include "viralloc.h" # include "virautoclean.h" /* Some Intel processor families introduced some RDT (Resource Director diff --git a/src/util/virscsi.c b/src/util/virscsi.c index b27831f0b3..6e167067e4 100644 --- a/src/util/virscsi.c +++ b/src/util/virscsi.c @@ -34,6 +34,7 @@ #include "virutil.h" #include "virstring.h" #include "virerror.h" +#include "viralloc.h" #define SYSFS_SCSI_DEVICES "/sys/bus/scsi/devices" diff --git a/src/util/virscsi.h b/src/util/virscsi.h index 70e113b486..c04c6bd65a 100644 --- a/src/util/virscsi.h +++ b/src/util/virscsi.h @@ -23,7 +23,6 @@ # include "internal.h" # include "virobject.h" -# include "viralloc.h" typedef struct _virSCSIDevice virSCSIDevice; typedef virSCSIDevice *virSCSIDevicePtr; diff --git a/src/util/virscsivhost.c b/src/util/virscsivhost.c index 62b3e99cea..cbd9069146 100644 --- a/src/util/virscsivhost.c +++ b/src/util/virscsivhost.c @@ -26,6 +26,7 @@ #include "virerror.h" #include "virfile.h" #include "virstring.h" +#include "viralloc.h" /* For virReportOOMError() and virReportSystemError() */ #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/src/util/virscsivhost.h b/src/util/virscsivhost.h index d28773482c..0c7ec691f5 100644 --- a/src/util/virscsivhost.h +++ b/src/util/virscsivhost.h @@ -24,7 +24,6 @@ # include "internal.h" # include "virobject.h" # include "virutil.h" -# include "viralloc.h" typedef struct _virSCSIVHostDevice virSCSIVHostDevice; typedef virSCSIVHostDevice *virSCSIVHostDevicePtr; diff --git a/src/util/virsocketaddr.c b/src/util/virsocketaddr.c index ccfaeabe13..182e18aa8c 100644 --- a/src/util/virsocketaddr.c +++ b/src/util/virsocketaddr.c @@ -22,6 +22,7 @@ #include "virerror.h" #include "virstring.h" #include "virbuffer.h" +#include "viralloc.h" #include diff --git a/src/util/virsocketaddr.h b/src/util/virsocketaddr.h index 2cc3f94b80..5230cddf64 100644 --- a/src/util/virsocketaddr.h +++ b/src/util/virsocketaddr.h @@ -26,7 +26,6 @@ # endif # include "internal.h" -# include "viralloc.h" # include "virautoclean.h" /* On architectures which lack these limits, define them (ie. Cygwin). diff --git a/src/util/virstring.h b/src/util/virstring.h index b0fedf96a3..b2cd8ea53c 100644 --- a/src/util/virstring.h +++ b/src/util/virstring.h @@ -22,7 +22,6 @@ # include # include "internal.h" -# include "viralloc.h" char **virStringSplitCount(const char *string, const char *delim, diff --git a/src/util/virusb.c b/src/util/virusb.c index 3f74aa1283..d1a414af41 100644 --- a/src/util/virusb.c +++ b/src/util/virusb.c @@ -33,6 +33,7 @@ #include "virerror.h" #include "virfile.h" #include "virstring.h" +#include "viralloc.h" #define USB_SYSFS "/sys/bus/usb" #define USB_ID_LEN 10 /* "1234 5678" */ diff --git a/src/util/virusb.h b/src/util/virusb.h index 6ed71606d4..ab11a5cf50 100644 --- a/src/util/virusb.h +++ b/src/util/virusb.h @@ -23,7 +23,6 @@ # include "internal.h" # include "virobject.h" -# include "viralloc.h" # define USB_DEVFS "/dev/bus/usb/" diff --git a/tests/qemusecuritymock.c b/tests/qemusecuritymock.c index d1b17d8aa4..9889117273 100644 --- a/tests/qemusecuritymock.c +++ b/tests/qemusecuritymock.c @@ -29,6 +29,7 @@ #include "virthread.h" #include "virhash.h" #include "virstring.h" +#include "viralloc.h" #include "qemusecuritytest.h" #include "security/security_manager.h" diff --git a/tests/vircgroupmock.c b/tests/vircgroupmock.c index 9c67a44b0d..d834a1d860 100644 --- a/tests/vircgroupmock.c +++ b/tests/vircgroupmock.c @@ -34,6 +34,7 @@ # include "testutilslxc.h" # include "virstring.h" # include "virfile.h" +# include "viralloc.h" static int (*real_open)(const char *path, int flags, ...); static FILE *(*real_fopen)(const char *path, const char *mode); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 16:27:39 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554296810197731.7603730826859; Wed, 3 Apr 2019 06:06:50 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C4403882F0; Wed, 3 Apr 2019 13:06:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 843C46014E; Wed, 3 Apr 2019 13:06:48 +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 F267141F3F; Wed, 3 Apr 2019 13:06:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x33D6h7d015153 for ; Wed, 3 Apr 2019 09:06:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id D0CDF19926; Wed, 3 Apr 2019 13:06:43 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5912B19736 for ; Wed, 3 Apr 2019 13:06:43 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 3 Apr 2019 15:06:36 +0200 Message-Id: <55bafa97c3e1f8eb1dee6b4391555cbc0cdb24a5.1554296696.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/5] util: Move enum convertors into virenum.(c|h) 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.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 03 Apr 2019 13:06:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" virutil.(c|h) is a very gross collection of random code. Remove the enum handlers from there so we can limit the scope where virtutil.h is used. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/Makefile.am | 3 ++ src/access/viraccessperm.h | 1 + src/conf/capabilities.c | 1 + src/conf/cpu_conf.h | 1 + src/conf/device_conf.h | 1 + src/conf/domain_capabilities.h | 1 + src/conf/domain_conf.h | 1 + src/conf/interface_conf.h | 1 + src/conf/network_conf.h | 1 + src/conf/node_device_conf.h | 1 + src/conf/numa_conf.h | 1 + src/conf/nwfilter_conf.h | 1 + src/conf/storage_adapter_conf.h | 1 + src/conf/storage_conf.h | 1 + src/libvirt_private.syms | 19 ++++--- src/util/Makefile.inc.am | 2 + src/util/vircgroup.h | 1 + src/util/virconf.h | 1 + src/util/virenum.c | 84 +++++++++++++++++++++++++++++++ src/util/virenum.h | 80 +++++++++++++++++++++++++++++ src/util/virfirewalld.c | 1 + src/util/virgic.h | 1 + src/util/virjson.c | 1 + src/util/virkeycode.h | 1 + src/util/virmdev.h | 1 + src/util/virnetdev.h | 1 + src/util/virnetdevmacvlan.h | 1 + src/util/virnetdevvlan.h | 1 + src/util/virnetdevvportprofile.h | 1 + src/util/virpci.h | 1 + src/util/virperf.h | 1 + src/util/virprocess.h | 1 + src/util/virresctrl.h | 2 +- src/util/virsecret.h | 1 + src/util/virstorageencryption.h | 1 + src/util/virstoragefile.h | 1 + src/util/virsysinfo.h | 1 + src/util/virtypedparam.h | 1 + src/util/virutil.c | 58 --------------------- src/util/virutil.h | 54 -------------------- tools/virt-host-validate-common.h | 1 + 41 files changed, 214 insertions(+), 121 deletions(-) create mode 100644 src/util/virenum.c create mode 100644 src/util/virenum.h diff --git a/src/Makefile.am b/src/Makefile.am index b3b1e172ff..ce199d1e93 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -672,6 +672,7 @@ libvirt_setuid_rpc_client_la_SOURCES =3D \ util/vircommand.c \ util/virconf.c \ util/virdbus.c \ + util/virenum.c \ util/virerror.c \ util/virevent.c \ util/vireventpoll.c \ @@ -882,6 +883,8 @@ libvirt_nss_la_SOURCES =3D \ util/virbuffer.h \ util/vircommand.c \ util/vircommand.h \ + util/virenum.c \ + util/virenum.h \ util/virerror.c \ util/virerror.h \ util/virfile.c \ diff --git a/src/access/viraccessperm.h b/src/access/viraccessperm.h index ce3865b359..ed1f7168ca 100644 --- a/src/access/viraccessperm.h +++ b/src/access/viraccessperm.h @@ -23,6 +23,7 @@ # include "internal.h" # include "virutil.h" +# include "virenum.h" typedef enum { /** diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 47308700bb..64c04d9774 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -41,6 +41,7 @@ #include "virstring.h" #include "virtypedparam.h" #include "viruuid.h" +#include "virenum.h" #define VIR_FROM_THIS VIR_FROM_CAPABILITIES diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h index 6e810e5486..c98db65693 100644 --- a/src/conf/cpu_conf.h +++ b/src/conf/cpu_conf.h @@ -27,6 +27,7 @@ # include "virbitmap.h" # include "virarch.h" # include "numa_conf.h" +# include "virenum.h" # define VIR_CPU_VENDOR_ID_LENGTH 12 diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h index 7a3455f99f..b3299ac69d 100644 --- a/src/conf/device_conf.h +++ b/src/conf/device_conf.h @@ -31,6 +31,7 @@ # include "virbuffer.h" # include "virpci.h" # include "virnetdev.h" +# include "virenum.h" typedef enum { VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE, diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 28e7d495c5..b82c78f1f5 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -23,6 +23,7 @@ # include "internal.h" # include "domain_conf.h" +# include "virenum.h" typedef const char * (*virDomainCapsValToStr)(int value); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index ce6e5b4748..12eb71c197 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -56,6 +56,7 @@ # include "virtypedparam.h" # include "virsavecookie.h" # include "virresctrl.h" +# include "virenum.h" /* Flags for the 'type' field in virDomainDeviceDef */ typedef enum { diff --git a/src/conf/interface_conf.h b/src/conf/interface_conf.h index fd3fc7cba0..e56b158b6d 100644 --- a/src/conf/interface_conf.h +++ b/src/conf/interface_conf.h @@ -29,6 +29,7 @@ # include "virutil.h" # include "virthread.h" # include "device_conf.h" +# include "virenum.h" /* There is currently 3 types of interfaces */ diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h index 4fba8f025d..5410a57c67 100644 --- a/src/conf/network_conf.h +++ b/src/conf/network_conf.h @@ -40,6 +40,7 @@ # include "networkcommon_conf.h" # include "virobject.h" # include "virmacmap.h" +# include "virenum.h" typedef enum { VIR_NETWORK_FORWARD_NONE =3D 0, diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h index e8cb315e30..510624968f 100644 --- a/src/conf/node_device_conf.h +++ b/src/conf/node_device_conf.h @@ -31,6 +31,7 @@ # include "virvhba.h" # include "device_conf.h" # include "storage_adapter_conf.h" +# include "virenum.h" # include diff --git a/src/conf/numa_conf.h b/src/conf/numa_conf.h index 1e389397a7..ae1793a950 100644 --- a/src/conf/numa_conf.h +++ b/src/conf/numa_conf.h @@ -27,6 +27,7 @@ # include "virutil.h" # include "virbitmap.h" # include "virbuffer.h" +# include "virenum.h" typedef struct _virDomainNuma virDomainNuma; diff --git a/src/conf/nwfilter_conf.h b/src/conf/nwfilter_conf.h index de4c3b1d40..4366ccc4d1 100644 --- a/src/conf/nwfilter_conf.h +++ b/src/conf/nwfilter_conf.h @@ -33,6 +33,7 @@ # include "virsocketaddr.h" # include "virmacaddr.h" # include "virdomainobjlist.h" +# include "virenum.h" /* XXX * The config parser/structs should not be using platform specific diff --git a/src/conf/storage_adapter_conf.h b/src/conf/storage_adapter_con= f.h index 763e4ba0e9..81d73ea889 100644 --- a/src/conf/storage_adapter_conf.h +++ b/src/conf/storage_adapter_conf.h @@ -22,6 +22,7 @@ # include "virpci.h" # include "virxml.h" +# include "virenum.h" typedef enum { diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h index 87db8edadb..a8b6f72688 100644 --- a/src/conf/storage_conf.h +++ b/src/conf/storage_conf.h @@ -30,6 +30,7 @@ # include "device_conf.h" # include "object_event.h" # include "storage_adapter_conf.h" +# include "virenum.h" # include diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 23cbd27ce1..40ae82cd03 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1784,6 +1784,17 @@ ebtablesContextNew; ebtablesRemoveForwardAllowIn; +# util/virenum.h +virEnumFromString; +virEnumToString; +virTristateBoolFromBool; +virTristateBoolTypeFromString; +virTristateBoolTypeToString; +virTristateSwitchFromBool; +virTristateSwitchTypeFromString; +virTristateSwitchTypeToString; + + # util/virerror.h virDispatchError; virErrorCopyNew; @@ -3186,8 +3197,6 @@ virUSBDeviceSetUsedBy; virDoesGroupExist; virDoesUserExist; virDoubleToStr; -virEnumFromString; -virEnumToString; virFormatIntDecimal; virFormatIntPretty; virGetDeviceID; @@ -3235,12 +3244,6 @@ virSetNonBlock; virSetSockReuseAddr; virSetUIDGID; virSetUIDGIDWithCaps; -virTristateBoolFromBool; -virTristateBoolTypeFromString; -virTristateBoolTypeToString; -virTristateSwitchFromBool; -virTristateSwitchTypeFromString; -virTristateSwitchTypeToString; virUpdateSelfLastChanged; virValidateWWN; virWaitForDevices; diff --git a/src/util/Makefile.inc.am b/src/util/Makefile.inc.am index 6b24245aa1..58874cca3c 100644 --- a/src/util/Makefile.inc.am +++ b/src/util/Makefile.inc.am @@ -49,6 +49,8 @@ UTIL_SOURCES =3D \ util/virebtables.c \ util/virebtables.h \ util/virendian.h \ + util/virenum.h \ + util/virenum.c \ util/virerror.c \ util/virerror.h \ util/virerrorpriv.h \ diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h index 372009de4a..377e0fd870 100644 --- a/src/util/vircgroup.h +++ b/src/util/vircgroup.h @@ -24,6 +24,7 @@ # include "virutil.h" # include "virbitmap.h" +# include "virenum.h" struct _virCgroup; typedef struct _virCgroup virCgroup; diff --git a/src/util/virconf.h b/src/util/virconf.h index ff4c2b6615..d692e4a805 100644 --- a/src/util/virconf.h +++ b/src/util/virconf.h @@ -22,6 +22,7 @@ # define LIBVIRT_VIRCONF_H # include "virutil.h" +# include "virenum.h" /** * virConfType: diff --git a/src/util/virenum.c b/src/util/virenum.c new file mode 100644 index 0000000000..abbc74d28e --- /dev/null +++ b/src/util/virenum.c @@ -0,0 +1,84 @@ +/* + * virenum.c: enum value conversion helpers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + */ +#include + +#include "virenum.h" +#include "virstring.h" + +#define VIR_FROM_THIS VIR_FROM_NONE + +VIR_ENUM_IMPL(virTristateBool, VIR_TRISTATE_BOOL_LAST, + "default", + "yes", + "no", +); + +VIR_ENUM_IMPL(virTristateSwitch, VIR_TRISTATE_SWITCH_LAST, + "default", + "on", + "off", +); + + +virTristateBool +virTristateBoolFromBool(bool val) +{ + if (val) + return VIR_TRISTATE_BOOL_YES; + else + return VIR_TRISTATE_BOOL_NO; +} + + +virTristateSwitch +virTristateSwitchFromBool(bool val) +{ + if (val) + return VIR_TRISTATE_SWITCH_ON; + else + return VIR_TRISTATE_SWITCH_OFF; +} + + +int +virEnumFromString(const char * const *types, + unsigned int ntypes, + const char *type) +{ + size_t i; + if (!type) + return -1; + + for (i =3D 0; i < ntypes; i++) + if (STREQ(types[i], type)) + return i; + + return -1; +} + + +const char * +virEnumToString(const char * const *types, + unsigned int ntypes, + int type) +{ + if (type < 0 || type >=3D ntypes) + return NULL; + + return types[type]; +} diff --git a/src/util/virenum.h b/src/util/virenum.h new file mode 100644 index 0000000000..3ae1a70b72 --- /dev/null +++ b/src/util/virenum.h @@ -0,0 +1,80 @@ +/* + * virenum.h: enum value conversion helpers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + */ + +#ifndef LIBVIRT_VIRENUM_H +# define LIBVIRT_VIRENUM_H + +# include "internal.h" + +int +virEnumFromString(const char * const *types, + unsigned int ntypes, + const char *type); + +const char * +virEnumToString(const char * const *types, + unsigned int ntypes, + int type); + +# define VIR_ENUM_IMPL(name, lastVal, ...) \ + static const char *const name ## TypeList[] =3D { __VA_ARGS__ }; \ + const char *name ## TypeToString(int type) { \ + return virEnumToString(name ## TypeList, \ + ARRAY_CARDINALITY(name ## TypeList), \ + type); \ + } \ + int name ## TypeFromString(const char *type) { \ + return virEnumFromString(name ## TypeList, \ + ARRAY_CARDINALITY(name ## TypeList), \ + type); \ + } \ + verify(ARRAY_CARDINALITY(name ## TypeList) =3D=3D lastVal) + +# define VIR_ENUM_DECL(name) \ + const char *name ## TypeToString(int type); \ + int name ## TypeFromString(const char*type) + +typedef enum { + VIR_TRISTATE_BOOL_ABSENT =3D 0, + VIR_TRISTATE_BOOL_YES, + VIR_TRISTATE_BOOL_NO, + + VIR_TRISTATE_BOOL_LAST +} virTristateBool; + +typedef enum { + VIR_TRISTATE_SWITCH_ABSENT =3D 0, + VIR_TRISTATE_SWITCH_ON, + VIR_TRISTATE_SWITCH_OFF, + + VIR_TRISTATE_SWITCH_LAST +} virTristateSwitch; + +VIR_ENUM_DECL(virTristateBool); +VIR_ENUM_DECL(virTristateSwitch); + +virTristateBool virTristateBoolFromBool(bool val); +virTristateSwitch virTristateSwitchFromBool(bool val); + +/* the two enums must be in sync to be able to use helpers interchangeably= in + * some special cases */ +verify((int)VIR_TRISTATE_BOOL_YES =3D=3D (int)VIR_TRISTATE_SWITCH_ON); +verify((int)VIR_TRISTATE_BOOL_NO =3D=3D (int)VIR_TRISTATE_SWITCH_OFF); +verify((int)VIR_TRISTATE_BOOL_ABSENT =3D=3D (int)VIR_TRISTATE_SWITCH_ABSEN= T); + +#endif /* LIBVIRT_VIRENUM_H */ diff --git a/src/util/virfirewalld.c b/src/util/virfirewalld.c index 7a730f2bea..1e30dadff3 100644 --- a/src/util/virfirewalld.c +++ b/src/util/virfirewalld.c @@ -31,6 +31,7 @@ #include "virutil.h" #include "virlog.h" #include "virdbus.h" +#include "virenum.h" #define VIR_FROM_THIS VIR_FROM_FIREWALLD diff --git a/src/util/virgic.h b/src/util/virgic.h index 371d04f708..e54d7ec9d2 100644 --- a/src/util/virgic.h +++ b/src/util/virgic.h @@ -22,6 +22,7 @@ # define LIBVIRT_VIRGIC_H # include "virutil.h" +# include "virenum.h" typedef enum { VIR_GIC_VERSION_NONE =3D 0, diff --git a/src/util/virjson.c b/src/util/virjson.c index 467561c744..d62ae1475a 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -30,6 +30,7 @@ #include "virstring.h" #include "virutil.h" #include "virbuffer.h" +#include "virenum.h" #if WITH_YAJL # include diff --git a/src/util/virkeycode.h b/src/util/virkeycode.h index 7120fb96e6..9e94d6f61e 100644 --- a/src/util/virkeycode.h +++ b/src/util/virkeycode.h @@ -23,6 +23,7 @@ # define LIBVIRT_VIRKEYCODE_H # include "virutil.h" +# include "virenum.h" VIR_ENUM_DECL(virKeycodeSet); int virKeycodeValueFromString(virKeycodeSet codeset, const char *keyname); diff --git a/src/util/virmdev.h b/src/util/virmdev.h index 0d3bc506e2..a6e9c3c605 100644 --- a/src/util/virmdev.h +++ b/src/util/virmdev.h @@ -22,6 +22,7 @@ # include "internal.h" # include "virobject.h" # include "virutil.h" +# include "virenum.h" typedef enum { VIR_MDEV_MODEL_TYPE_VFIO_PCI =3D 0, diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h index 98357128e4..c3f64edae9 100644 --- a/src/util/virnetdev.h +++ b/src/util/virnetdev.h @@ -26,6 +26,7 @@ # include "virmacaddr.h" # include "virpci.h" # include "virnetdevvlan.h" +# include "virenum.h" # ifdef HAVE_STRUCT_IFREQ typedef struct ifreq virIfreq; diff --git a/src/util/virnetdevmacvlan.h b/src/util/virnetdevmacvlan.h index 504a8c89ae..a33ea8f29e 100644 --- a/src/util/virnetdevmacvlan.h +++ b/src/util/virnetdevmacvlan.h @@ -26,6 +26,7 @@ # include "virnetdevbandwidth.h" # include "virnetdevvportprofile.h" # include "virnetdevvlan.h" +# include "virenum.h" /* the mode type for macvtap devices */ typedef enum { diff --git a/src/util/virnetdevvlan.h b/src/util/virnetdevvlan.h index c250181f69..d986300d2a 100644 --- a/src/util/virnetdevvlan.h +++ b/src/util/virnetdevvlan.h @@ -22,6 +22,7 @@ # include # include "virautoclean.h" +# include "virenum.h" typedef enum { VIR_NATIVE_VLAN_MODE_DEFAULT =3D 0, diff --git a/src/util/virnetdevvportprofile.h b/src/util/virnetdevvportprof= ile.h index 65b4779861..5506194001 100644 --- a/src/util/virnetdevvportprofile.h +++ b/src/util/virnetdevvportprofile.h @@ -23,6 +23,7 @@ # include "viruuid.h" # include "virutil.h" # include "virmacaddr.h" +# include "virenum.h" # define LIBVIRT_IFLA_VF_PORT_PROFILE_MAX 40 diff --git a/src/util/virpci.h b/src/util/virpci.h index e89ea8390c..af98376d74 100644 --- a/src/util/virpci.h +++ b/src/util/virpci.h @@ -25,6 +25,7 @@ # include "virmdev.h" # include "virobject.h" # include "virutil.h" +# include "virenum.h" typedef struct _virPCIDevice virPCIDevice; typedef virPCIDevice *virPCIDevicePtr; diff --git a/src/util/virperf.h b/src/util/virperf.h index f43b856723..e68baa527d 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -21,6 +21,7 @@ # include "virutil.h" # include "virautoclean.h" +# include "virenum.h" /* Some Intel processor families introduced some RDT (Resource Director * Technology) features to monitor or control shared resource based on diff --git a/src/util/virprocess.h b/src/util/virprocess.h index e3944d3f1b..8e5b0c2127 100644 --- a/src/util/virprocess.h +++ b/src/util/virprocess.h @@ -27,6 +27,7 @@ # include "internal.h" # include "virbitmap.h" # include "virutil.h" +# include "virenum.h" typedef enum { VIR_PROC_POLICY_NONE =3D 0, diff --git a/src/util/virresctrl.h b/src/util/virresctrl.h index 0aa8bf7ea3..abdeb594ee 100644 --- a/src/util/virresctrl.h +++ b/src/util/virresctrl.h @@ -23,7 +23,7 @@ # include "virbitmap.h" # include "virutil.h" - +# include "virenum.h" typedef enum { VIR_CACHE_TYPE_BOTH, diff --git a/src/util/virsecret.h b/src/util/virsecret.h index a44d1bcdb6..aaeb204f7c 100644 --- a/src/util/virsecret.h +++ b/src/util/virsecret.h @@ -26,6 +26,7 @@ # include "virutil.h" # include "virxml.h" +# include "virenum.h" VIR_ENUM_DECL(virSecretUsage); diff --git a/src/util/virstorageencryption.h b/src/util/virstorageencryptio= n.h index 3fc4d970a1..68d879a63e 100644 --- a/src/util/virstorageencryption.h +++ b/src/util/virstorageencryption.h @@ -25,6 +25,7 @@ # include "virbuffer.h" # include "virsecret.h" # include "virutil.h" +# include "virenum.h" # include diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index 420c8a57f3..b71004f4ef 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -30,6 +30,7 @@ # include "virstorageencryption.h" # include "virutil.h" # include "virsecret.h" +# include "virenum.h" /* Minimum header size required to probe all known formats with * virStorageFileProbeFormat, or obtain metadata from a known format. diff --git a/src/util/virsysinfo.h b/src/util/virsysinfo.h index 835ee4c62e..c0015834bc 100644 --- a/src/util/virsysinfo.h +++ b/src/util/virsysinfo.h @@ -25,6 +25,7 @@ # include "internal.h" # include "virutil.h" # include "virbuffer.h" +# include "virenum.h" typedef enum { VIR_SYSINFO_SMBIOS, diff --git a/src/util/virtypedparam.h b/src/util/virtypedparam.h index 911ae52f6c..112f2a2af9 100644 --- a/src/util/virtypedparam.h +++ b/src/util/virtypedparam.h @@ -24,6 +24,7 @@ # include "internal.h" # include "virutil.h" +# include "virenum.h" /** * VIR_TYPED_PARAM_MULTIPLE: diff --git a/src/util/virutil.c b/src/util/virutil.c index 0d58f1ee57..760557ea29 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -84,38 +84,6 @@ verify(sizeof(gid_t) <=3D sizeof(unsigned int) && VIR_LOG_INIT("util.util"); -VIR_ENUM_IMPL(virTristateBool, VIR_TRISTATE_BOOL_LAST, - "default", - "yes", - "no", -); - -VIR_ENUM_IMPL(virTristateSwitch, VIR_TRISTATE_SWITCH_LAST, - "default", - "on", - "off", -); - - -virTristateBool -virTristateBoolFromBool(bool val) -{ - if (val) - return VIR_TRISTATE_BOOL_YES; - else - return VIR_TRISTATE_BOOL_NO; -} - - -virTristateSwitch -virTristateSwitchFromBool(bool val) -{ - if (val) - return VIR_TRISTATE_SWITCH_ON; - else - return VIR_TRISTATE_SWITCH_OFF; -} - #ifndef WIN32 @@ -437,22 +405,6 @@ virParseVersionString(const char *str, unsigned long *= version, return 0; } -int virEnumFromString(const char *const*types, - unsigned int ntypes, - const char *type) -{ - size_t i; - if (!type) - return -1; - - for (i =3D 0; i < ntypes; i++) - if (STREQ(types[i], type)) - return i; - - return -1; -} - - /** * Format @val as a base-10 decimal number, in the * buffer @buf of size @buflen. To allocate a suitable @@ -532,16 +484,6 @@ virFormatIntPretty(unsigned long long val, } -const char *virEnumToString(const char *const*types, - unsigned int ntypes, - int type) -{ - if (type < 0 || type >=3D ntypes) - return NULL; - - return types[type]; -} - /* Translates a device name of the form (regex) /^[fhv]d[a-z]+[0-9]*$/ * into the corresponding index and partition number * (e.g. sda0 =3D> (0,0), hdz2 =3D> (25,2), vdaa12 =3D> (26,12)) diff --git a/src/util/virutil.h b/src/util/virutil.h index f8d8d85d27..67edf34d55 100644 --- a/src/util/virutil.h +++ b/src/util/virutil.h @@ -72,32 +72,6 @@ int virDiskNameParse(const char *name, int *disk, int *p= artition); int virDiskNameToIndex(const char* str); char *virIndexToDiskName(int idx, const char *prefix); -int virEnumFromString(const char *const*types, - unsigned int ntypes, - const char *type); - -const char *virEnumToString(const char *const*types, - unsigned int ntypes, - int type); - -# define VIR_ENUM_IMPL(name, lastVal, ...) \ - static const char *const name ## TypeList[] =3D { __VA_ARGS__ }; \ - const char *name ## TypeToString(int type) { \ - return virEnumToString(name ## TypeList, \ - ARRAY_CARDINALITY(name ## TypeList), \ - type); \ - } \ - int name ## TypeFromString(const char *type) { \ - return virEnumFromString(name ## TypeList, \ - ARRAY_CARDINALITY(name ## TypeList), \ - type); \ - } \ - verify(ARRAY_CARDINALITY(name ## TypeList) =3D=3D lastVal) - -# define VIR_ENUM_DECL(name) \ - const char *name ## TypeToString(int type); \ - int name ## TypeFromString(const char*type) - /* No-op workarounds for functionality missing in mingw. */ # ifndef HAVE_GETUID static inline int getuid(void) @@ -180,34 +154,6 @@ bool virIsSUID(void); time_t virGetSelfLastChanged(void); void virUpdateSelfLastChanged(const char *path); -typedef enum { - VIR_TRISTATE_BOOL_ABSENT =3D 0, - VIR_TRISTATE_BOOL_YES, - VIR_TRISTATE_BOOL_NO, - - VIR_TRISTATE_BOOL_LAST -} virTristateBool; - -typedef enum { - VIR_TRISTATE_SWITCH_ABSENT =3D 0, - VIR_TRISTATE_SWITCH_ON, - VIR_TRISTATE_SWITCH_OFF, - - VIR_TRISTATE_SWITCH_LAST -} virTristateSwitch; - -VIR_ENUM_DECL(virTristateBool); -VIR_ENUM_DECL(virTristateSwitch); - -virTristateBool virTristateBoolFromBool(bool val); -virTristateSwitch virTristateSwitchFromBool(bool val); - -/* the two enums must be in sync to be able to use helpers interchangeably= in - * some special cases */ -verify((int)VIR_TRISTATE_BOOL_YES =3D=3D (int)VIR_TRISTATE_SWITCH_ON); -verify((int)VIR_TRISTATE_BOOL_NO =3D=3D (int)VIR_TRISTATE_SWITCH_OFF); -verify((int)VIR_TRISTATE_BOOL_ABSENT =3D=3D (int)VIR_TRISTATE_SWITCH_ABSEN= T); - unsigned int virGetListenFDs(void); char *virGetUNIXSocketPath(int fd); diff --git a/tools/virt-host-validate-common.h b/tools/virt-host-validate-c= ommon.h index c2e11dae01..94a5005d5d 100644 --- a/tools/virt-host-validate-common.h +++ b/tools/virt-host-validate-common.h @@ -25,6 +25,7 @@ # include "internal.h" # include "virutil.h" # include "virbitmap.h" +# include "virenum.h" typedef enum { VIR_HOST_VALIDATE_FAIL, --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 16:27:39 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554296822239650.4837623924896; Wed, 3 Apr 2019 06:07:02 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B76073082A32; Wed, 3 Apr 2019 13:07:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 83B4A1975F; Wed, 3 Apr 2019 13:07:00 +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 417EC3FB12; Wed, 3 Apr 2019 13:07:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x33D6iUR015254 for ; Wed, 3 Apr 2019 09:06:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id A50F519736; Wed, 3 Apr 2019 13:06:44 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2D05B19926 for ; Wed, 3 Apr 2019 13:06:44 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 3 Apr 2019 15:06:37 +0200 Message-Id: <3649b998c75f57085222a714a9d3ae4e77a448ed.1554296696.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/5] Include unistd.h directly by files using it 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 03 Apr 2019 13:07:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" util/virutil.h bogously included unistd.h. Drop it and replace it by including it directly where needed. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/virnwfilterbindingobj.c | 2 ++ src/libxl/libxl_domain.c | 1 + src/locking/lock_daemon_config.c | 2 ++ src/locking/lock_driver_lockd.c | 2 ++ src/logging/log_daemon_config.c | 2 ++ src/lxc/lxc_conf.c | 2 ++ src/lxc/lxc_fuse.c | 1 + src/network/leaseshelper.c | 1 + src/nwfilter/nwfilter_ebiptables_driver.c | 1 + src/remote/remote_daemon_config.c | 2 ++ src/security/security_dac.c | 1 + src/security/security_manager.c | 1 + src/storage/storage_file_fs.c | 1 + src/util/vircgroupv1.c | 1 + src/util/vircgroupv2.c | 1 + src/util/virnetdev.c | 1 + src/util/virnetdevip.c | 1 + src/util/virnetdevmacvlan.c | 2 ++ src/util/virnetdevvportprofile.c | 2 ++ src/util/virperf.c | 1 + src/util/virpidfile.c | 1 + src/util/virpolkit.c | 1 + src/util/virresctrl.c | 1 + src/util/virutil.h | 1 - tests/eventtest.c | 1 + tests/objecteventtest.c | 2 ++ tests/scsihosttest.c | 1 + tests/vboxsnapshotxmltest.c | 1 + tests/virfiletest.c | 1 + tests/virfilewrapper.c | 1 + tests/virlockspacetest.c | 1 + tests/virnetdaemontest.c | 2 ++ tests/virnetsockettest.c | 1 + tests/virnettlscontexttest.c | 1 + tests/virnettlshelpers.c | 1 + tests/virnettlssessiontest.c | 1 + tests/virscsitest.c | 1 + tests/virstoragetest.c | 1 + 38 files changed, 47 insertions(+), 1 deletion(-) diff --git a/src/conf/virnwfilterbindingobj.c b/src/conf/virnwfilterbinding= obj.c index 68afb9c434..56a9022fc5 100644 --- a/src/conf/virnwfilterbindingobj.c +++ b/src/conf/virnwfilterbindingobj.c @@ -20,6 +20,8 @@ #include +#include + #include "viralloc.h" #include "virerror.h" #include "virstring.h" diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 287406d323..935d3d86b9 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -21,6 +21,7 @@ #include #include +#include #include "libxl_domain.h" #include "libxl_capabilities.h" diff --git a/src/locking/lock_daemon_config.c b/src/locking/lock_daemon_con= fig.c index 03feeb02a5..9dc3d6e409 100644 --- a/src/locking/lock_daemon_config.c +++ b/src/locking/lock_daemon_config.c @@ -21,6 +21,8 @@ #include +#include + #include "lock_daemon_config.h" #include "virconf.h" #include "viralloc.h" diff --git a/src/locking/lock_driver_lockd.c b/src/locking/lock_driver_lock= d.c index f6371f3050..335180dafa 100644 --- a/src/locking/lock_driver_lockd.c +++ b/src/locking/lock_driver_lockd.c @@ -21,6 +21,8 @@ #include +#include + #include "lock_driver.h" #include "virconf.h" #include "viralloc.h" diff --git a/src/logging/log_daemon_config.c b/src/logging/log_daemon_confi= g.c index ec6d0686f4..626ef15403 100644 --- a/src/logging/log_daemon_config.c +++ b/src/logging/log_daemon_config.c @@ -21,6 +21,8 @@ #include +#include + #include "log_daemon_config.h" #include "virconf.h" #include "viralloc.h" diff --git a/src/lxc/lxc_conf.c b/src/lxc/lxc_conf.c index 2e4cc4f51a..a6be352b22 100644 --- a/src/lxc/lxc_conf.c +++ b/src/lxc/lxc_conf.c @@ -23,6 +23,8 @@ /* includes */ #include +#include "unistd.h" + #include "lxc_conf.h" #include "lxc_domain.h" #include "virerror.h" diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c index 4137d1b04f..b647743206 100644 --- a/src/lxc/lxc_fuse.c +++ b/src/lxc/lxc_fuse.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "lxc_fuse.h" #include "lxc_cgroup.h" diff --git a/src/network/leaseshelper.c b/src/network/leaseshelper.c index 21119b3fbb..6239da0ea1 100644 --- a/src/network/leaseshelper.c +++ b/src/network/leaseshelper.c @@ -23,6 +23,7 @@ #include +#include #include "virthread.h" #include "virfile.h" diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfil= ter_ebiptables_driver.c index 32bbf6d05c..424daeb3c7 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.c +++ b/src/nwfilter/nwfilter_ebiptables_driver.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "internal.h" diff --git a/src/remote/remote_daemon_config.c b/src/remote/remote_daemon_c= onfig.c index a56aa9065a..59f14bdbdc 100644 --- a/src/remote/remote_daemon_config.c +++ b/src/remote/remote_daemon_config.c @@ -21,6 +21,8 @@ #include +#include + #include "remote_daemon_config.h" #include "virconf.h" #include "viralloc.h" diff --git a/src/security/security_dac.c b/src/security/security_dac.c index 6f8ca8cd54..5718557411 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -22,6 +22,7 @@ #include #include #include +#include #ifdef __FreeBSD__ # include diff --git a/src/security/security_manager.c b/src/security/security_manage= r.c index 74ab0d0dd3..9bcd8f85ab 100644 --- a/src/security/security_manager.c +++ b/src/security/security_manager.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "security_driver.h" #include "security_stack.h" diff --git a/src/storage/storage_file_fs.c b/src/storage/storage_file_fs.c index 8817970f44..1570170d0e 100644 --- a/src/storage/storage_file_fs.c +++ b/src/storage/storage_file_fs.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "virerror.h" #include "storage_file_fs.h" diff --git a/src/util/vircgroupv1.c b/src/util/vircgroupv1.c index 6224072db0..7482b96a27 100644 --- a/src/util/vircgroupv1.c +++ b/src/util/vircgroupv1.c @@ -21,6 +21,7 @@ #include #ifdef __linux__ +# include # include # include # include diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 940ee58528..3264bff014 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -20,6 +20,7 @@ #include #ifdef __linux__ +# include # include # include #endif /* __linux__ */ diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 5c0e9723b9..8e098b3634 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -35,6 +35,7 @@ #include #include #include +#include #ifdef __linux__ # include diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c index e2009fd829..7fc500007f 100644 --- a/src/util/virnetdevip.c +++ b/src/util/virnetdevip.c @@ -36,6 +36,7 @@ #include #include #include +#include #ifdef __linux__ # include diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index c80a3a381f..e916ba0a0a 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util/virnetdevmacvlan.c @@ -24,6 +24,8 @@ #include +#include + #include "virnetdevmacvlan.h" #include "virmacaddr.h" #include "virerror.h" diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprof= ile.c index fb05190c02..b30204fe7f 100644 --- a/src/util/virnetdevvportprofile.c +++ b/src/util/virnetdevvportprofile.c @@ -18,6 +18,8 @@ #include +#include + #include "virnetdevvportprofile.h" #include "virerror.h" #include "viralloc.h" diff --git a/src/util/virperf.c b/src/util/virperf.c index 6ecfc29cb2..9bde5c1246 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -17,6 +17,7 @@ */ #include +#include #include #if defined HAVE_SYS_SYSCALL_H # include diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c index 999bccbee4..a6ee6e1f4b 100644 --- a/src/util/virpidfile.c +++ b/src/util/virpidfile.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "virpidfile.h" #include "virfile.h" diff --git a/src/util/virpolkit.c b/src/util/virpolkit.c index 198439cea2..5c94ae346b 100644 --- a/src/util/virpolkit.c +++ b/src/util/virpolkit.c @@ -21,6 +21,7 @@ #include #include +#include #include "virpolkit.h" #include "virerror.h" diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index 9e477fc064..e495233110 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -22,6 +22,7 @@ #include #include #include +#include #define LIBVIRT_VIRRESCTRLPRIV_H_ALLOW #include "virresctrlpriv.h" diff --git a/src/util/virutil.h b/src/util/virutil.h index 67edf34d55..52a05e7ed6 100644 --- a/src/util/virutil.h +++ b/src/util/virutil.h @@ -24,7 +24,6 @@ # define LIBVIRT_VIRUTIL_H # include "internal.h" -# include # include # ifndef MIN diff --git a/tests/eventtest.c b/tests/eventtest.c index df7570bac6..37166253cc 100644 --- a/tests/eventtest.c +++ b/tests/eventtest.c @@ -22,6 +22,7 @@ #include #include +#include #if HAVE_MACH_CLOCK_ROUTINES # include diff --git a/tests/objecteventtest.c b/tests/objecteventtest.c index 9ba082d353..b53763bc1d 100644 --- a/tests/objecteventtest.c +++ b/tests/objecteventtest.c @@ -19,6 +19,8 @@ #include +#include + #include "testutils.h" #include "virerror.h" diff --git a/tests/scsihosttest.c b/tests/scsihosttest.c index 6989e4fc4a..01cd77462b 100644 --- a/tests/scsihosttest.c +++ b/tests/scsihosttest.c @@ -25,6 +25,7 @@ # include # include +# include # include "virstring.h" # include "virerror.h" # include "virlog.h" diff --git a/tests/vboxsnapshotxmltest.c b/tests/vboxsnapshotxmltest.c index c70d7ab100..2f815a2bca 100644 --- a/tests/vboxsnapshotxmltest.c +++ b/tests/vboxsnapshotxmltest.c @@ -5,6 +5,7 @@ #ifdef WITH_VBOX # include +# include # include "vbox/vbox_snapshot_conf.h" # define VIR_FROM_THIS VIR_FROM_NONE diff --git a/tests/virfiletest.c b/tests/virfiletest.c index e2bd4953ed..6e4805b42d 100644 --- a/tests/virfiletest.c +++ b/tests/virfiletest.c @@ -19,6 +19,7 @@ #include #include +#include #include "testutils.h" #include "virfile.h" diff --git a/tests/virfilewrapper.c b/tests/virfilewrapper.c index 88441331ce..52d65800b3 100644 --- a/tests/virfilewrapper.c +++ b/tests/virfilewrapper.c @@ -21,6 +21,7 @@ #ifndef WIN32 # include +# include # include "viralloc.h" # include "virfile.h" diff --git a/tests/virlockspacetest.c b/tests/virlockspacetest.c index 991e587db6..4dd485bc0e 100644 --- a/tests/virlockspacetest.c +++ b/tests/virlockspacetest.c @@ -20,6 +20,7 @@ #include #include +#include #include "testutils.h" #include "virutil.h" diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c index 3e9b007d9b..d7b9db6641 100644 --- a/tests/virnetdaemontest.c +++ b/tests/virnetdaemontest.c @@ -18,6 +18,8 @@ #include +#include + #include "testutils.h" #include "virerror.h" #include "rpc/virnetdaemon.h" diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index 9c14989287..a7990ee5f3 100644 --- a/tests/virnetsockettest.c +++ b/tests/virnetsockettest.c @@ -23,6 +23,7 @@ # include #endif #include +#include #include "testutils.h" #include "virutil.h" diff --git a/tests/virnettlscontexttest.c b/tests/virnettlscontexttest.c index 07910c2749..b94275b943 100644 --- a/tests/virnettlscontexttest.c +++ b/tests/virnettlscontexttest.c @@ -20,6 +20,7 @@ #include #include +#include #include "testutils.h" #include "virnettlshelpers.h" diff --git a/tests/virnettlshelpers.c b/tests/virnettlshelpers.c index a6aacf4cc3..dfb747b45d 100644 --- a/tests/virnettlshelpers.c +++ b/tests/virnettlshelpers.c @@ -20,6 +20,7 @@ #include #include +#include #include "virnettlshelpers.h" #include "viralloc.h" diff --git a/tests/virnettlssessiontest.c b/tests/virnettlssessiontest.c index 41abbe7eaf..153c8929ed 100644 --- a/tests/virnettlssessiontest.c +++ b/tests/virnettlssessiontest.c @@ -20,6 +20,7 @@ #include #include +#include #include "testutils.h" #include "virnettlshelpers.h" diff --git a/tests/virscsitest.c b/tests/virscsitest.c index be3ef6234e..75c7be5822 100644 --- a/tests/virscsitest.c +++ b/tests/virscsitest.c @@ -19,6 +19,7 @@ #include +#include #include "virscsi.h" #include "testutils.h" diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 4f23511240..d20559a636 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -18,6 +18,7 @@ #include +#include #include "testutils.h" #include "vircommand.h" --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list