[libvirt] [PATCH 0/9] Batch removal of gnulib modules

This is a series of patches collecting gnulib module removals. Patches from Jano and Pavel have alreadny my R-bs but at least one of my patches does not. Jano, I couldn't find your patch for removal of the mkostemp functions so please provide it. I'll push it later today once I get Jano's patch so that we have only one point of disruption. Ján Tomko (3): gnulib: remove use of 'byteswap' module gnulib: remove use of 'vsnprintf' module bootstrap: remove regex module Pavel Hrdina (4): bootstrap.conf: remove usage of snprintf gnulib module syntax-check: update of sprintf rule to mention g_snpritnf syntax-check: forbid usage of snprintf bootstrap.conf: drop c-strcasestr gnulib module Peter Krempa (2): gnulib: remove 'areadlink' module gnulib: Remove use of 'strsep' module bootstrap.conf | 7 ------- build-aux/syntax-check.mk | 12 ++++++++++-- po/POTFILES.in | 1 - src/qemu/qemu_monitor_json.c | 1 - 4 files changed, 10 insertions(+), 11 deletions(-) -- 2.23.0

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- bootstrap.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/bootstrap.conf b/bootstrap.conf index 4c784487e2..6156fa8499 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -19,7 +19,6 @@ # gnulib modules used by this package. gnulib_modules=' accept -areadlink bind byteswap c-ctype -- 2.23.0

On Wed, Nov 20, 2019 at 12:42:01PM +0100, Peter Krempa wrote:
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- bootstrap.conf | 1 - 1 file changed, 1 deletion(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

From: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> --- bootstrap.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/bootstrap.conf b/bootstrap.conf index 6156fa8499..1d80640c0a 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -20,7 +20,6 @@ gnulib_modules=' accept bind -byteswap c-ctype c-strcase c-strcasestr -- 2.23.0

From: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> --- bootstrap.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/bootstrap.conf b/bootstrap.conf index 1d80640c0a..c93daf5a8d 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -88,7 +88,6 @@ ttyname_r uname unsetenv verify -vsnprintf waitpid warnings wcwidth -- 2.23.0

From: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> --- bootstrap.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/bootstrap.conf b/bootstrap.conf index c93daf5a8d..4ba3ebfdd5 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -72,7 +72,6 @@ setenv setsockopt sigaction sigpipe -snprintf socket stat-time strchrnul -- 2.23.0

On Wed, Nov 20, 2019 at 12:42:04PM +0100, Peter Krempa wrote:
From: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> --- bootstrap.conf | 1 - 1 file changed, 1 deletion(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

From: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> --- build-aux/syntax-check.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index ba941746a1..6b62e20ed4 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -475,11 +475,11 @@ sc_prohibit_risky_id_promotion: halt='cast -1 to ([ug]id_t) before comparing against id' \ $(_sc_search_regexp) -# Use snprintf rather than s'printf, even if buffer is provably large enough, +# Use g_snprintf rather than s'printf, even if buffer is provably large enough, # since gnulib has more guarantees for snprintf portability sc_prohibit_sprintf: @prohibit='\<[s]printf\>' \ - halt='use snprintf, not sprintf' \ + halt='use g_snprintf, not sprintf' \ $(_sc_search_regexp) sc_prohibit_readlink: -- 2.23.0

s/g_snpritnf/g_snprintf/ On Wed, Nov 20, 2019 at 12:42:05PM +0100, Peter Krempa wrote:
From: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> --- build-aux/syntax-check.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
with that fixed: Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

From: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> --- build-aux/syntax-check.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 6b62e20ed4..f1e976ec76 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -482,6 +482,11 @@ sc_prohibit_sprintf: halt='use g_snprintf, not sprintf' \ $(_sc_search_regexp) +sc_prohibit_snprintf: + @prohibit='\<snprintf\>' \ + halt='use g_snprintf, not snprintf' \ + $(_sc_search_regexp) + sc_prohibit_readlink: @prohibit='\<readlink *\(' \ halt='use virFileResolveLink, not readlink' \ @@ -2277,6 +2282,9 @@ exclude_file_name_regexp--sc_prohibit_setuid = ^src/util/virutil\.c|tools/virt-l exclude_file_name_regexp--sc_prohibit_sprintf = \ ^(build-aux/syntax-check\.mk|docs/hacking\.html\.in|.*\.stp|.*\.pl)$$ +exclude_file_name_regexp--sc_prohibit_snprintf = \ + ^(build-aux/syntax-check\.mk|docs/hacking\.html\.in|tools/virt-login-shell\.c)$$ + exclude_file_name_regexp--sc_prohibit_strncpy = ^src/util/virstring\.c$$ exclude_file_name_regexp--sc_prohibit_strtol = ^examples/.*$$ -- 2.23.0

On Wed, Nov 20, 2019 at 12:42:06PM +0100, Peter Krempa wrote:
From: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> --- build-aux/syntax-check.mk | 8 ++++++++ 1 file changed, 8 insertions(+)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

From: Ján Tomko <jtomko@redhat.com> Now that we use GRegex everywhere, there is no need for this module. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> --- bootstrap.conf | 1 - po/POTFILES.in | 1 - 2 files changed, 2 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index 4ba3ebfdd5..f13fcae11a 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -66,7 +66,6 @@ poll posix-shell pthread_sigmask recv -regex send setenv setsockopt diff --git a/po/POTFILES.in b/po/POTFILES.in index f93fb9694d..debb51cd70 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -6,7 +6,6 @@ @BUILDDIR@/src/remote/remote_client_bodies.h @BUILDDIR@/src/remote/remote_daemon_dispatch_stubs.h @SRCDIR@/gnulib/lib/gai_strerror.c -@SRCDIR@/gnulib/lib/regcomp.c @SRCDIR@/src/access/viraccessdriverpolkit.c @SRCDIR@/src/access/viraccessmanager.c @SRCDIR@/src/admin/admin_server.c -- 2.23.0

We don't use strsep any more. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com> --- bootstrap.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/bootstrap.conf b/bootstrap.conf index f13fcae11a..e519c69d30 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -75,7 +75,6 @@ socket stat-time strchrnul strptime -strsep strtok_r sys_stat sys_wait -- 2.23.0

From: Pavel Hrdina <phrdina@redhat.com> Last usage was removed by commit <41f88886198e231285cc813f8c0687c8ec5c9488> and commit <0f4d31720430b4e3735064cc0d8f88a1a438e154> forgot to drop include. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com> --- bootstrap.conf | 1 - src/qemu/qemu_monitor_json.c | 1 - 2 files changed, 2 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index e519c69d30..55b48da0e8 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -22,7 +22,6 @@ accept bind c-ctype c-strcase -c-strcasestr canonicalize-lgpl chown clock-time diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 10f6a4cadc..fb662cb18b 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -40,7 +40,6 @@ #include "virprobe.h" #include "virstring.h" #include "cpu/cpu_x86.h" -#include "c-strcasestr.h" #include "virenum.h" #ifdef WITH_DTRACE_PROBES -- 2.23.0

On Wed, Nov 20, 2019 at 12:42:09PM +0100, Peter Krempa wrote:
From: Pavel Hrdina <phrdina@redhat.com>
Last usage was removed by commit <41f88886198e231285cc813f8c0687c8ec5c9488> and commit <0f4d31720430b4e3735064cc0d8f88a1a438e154> forgot to drop include.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com> --- bootstrap.conf | 1 - src/qemu/qemu_monitor_json.c | 1 - 2 files changed, 2 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

After commits 4ac47730408eaf91683f6502ec10541f4f711a5c and ef88698668e4a87c794d70879eeffefb52aa0017, we use the GLib versions of these functions. Remove the corresponding gnulib modules. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> --- With respect to established traditions, I already included Peter's R-b: https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=9c68bb4a5c2c8c050e5315... bootstrap.conf | 3 --- 1 file changed, 3 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index 4c784487e2..a3320a28c9 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -53,9 +53,6 @@ listen localeconv manywarnings mgetgroups -mkdtemp -mkostemp -mkostemps net_if netdb nonblocking -- 2.21.0

On Wed, Nov 20, 2019 at 13:07:18 +0100, Ján Tomko wrote:
After commits 4ac47730408eaf91683f6502ec10541f4f711a5c and ef88698668e4a87c794d70879eeffefb52aa0017, we use the GLib versions of these functions.
Remove the corresponding gnulib modules.
Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> --- With respect to established traditions, I already included Peter's R-b: https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=9c68bb4a5c2c8c050e5315...
Thanks for saving me some work ;) ... I'll push this series shortly.
participants (2)
-
Ján Tomko
-
Peter Krempa