df: Move framework for processing domains in parallel to common/parallel.

Just code motion.
This commit is contained in:
Richard W.M. Jones
2017-01-25 13:21:03 +00:00
parent a8c5739fd2
commit db48870cf3
16 changed files with 76 additions and 33 deletions

View File

@@ -91,6 +91,7 @@ endif
# Common code used by the tools.
SUBDIRS += common/edit
SUBDIRS += common/options
SUBDIRS += common/parallel
SUBDIRS += common/progress
SUBDIRS += common/visit
SUBDIRS += common/windows

View File

@@ -25,16 +25,7 @@ EXTRA_DIST = \
bin_PROGRAMS = virt-alignment-scan
SHARED_SOURCE_FILES = \
../df/domains.c \
../df/domains.h \
../df/estimate-max-threads.c \
../df/estimate-max-threads.h \
../df/parallel.c \
../df/parallel.h
virt_alignment_scan_SOURCES = \
$(SHARED_SOURCE_FILES) \
scan.c
virt_alignment_scan_CPPFLAGS = \
@@ -42,8 +33,7 @@ virt_alignment_scan_CPPFLAGS = \
-I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/lib -I$(top_builddir)/lib \
-I$(top_srcdir)/common/options -I$(top_builddir)/common/options \
-I$(top_srcdir)/df \
-I$(top_srcdir)/fish \
-I$(top_srcdir)/common/parallel -I$(top_builddir)/common/parallel \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
-DLOCALEBASEDIR=\""$(datadir)/locale"\"
@@ -55,6 +45,7 @@ virt_alignment_scan_CFLAGS = \
virt_alignment_scan_LDADD = \
$(top_builddir)/common/options/liboptions.la \
$(top_builddir)/common/parallel/libparallel.la \
$(top_builddir)/common/utils/libutils.la \
$(top_builddir)/lib/libguestfs.la \
$(LIBXML2_LIBS) \

View File

@@ -0,0 +1,51 @@
# libguestfs virt-df
# Copyright (C) 2010-2017 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
include $(top_srcdir)/subdir-rules.mk
# libparallel.la contains a framework used for processing multiple
# libvirt domains in parallel. It is used by virt-df and
# virt-alignment-scan.
noinst_LTLIBRARIES = libparallel.la
libparallel_la_SOURCES = \
domains.c \
domains.h \
estimate-max-threads.c \
estimate-max-threads.h \
parallel.c \
parallel.h
libparallel_la_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/lib -I$(top_builddir)/lib \
-I$(top_srcdir)/common/options -I$(top_builddir)/common/options \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib
libparallel_la_CFLAGS = \
-pthread \
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
$(LIBXML2_CFLAGS) \
$(LIBVIRT_CFLAGS)
libparallel_la_LIBADD = \
$(top_builddir)/common/options/liboptions.la \
$(top_builddir)/common/utils/libutils.la \
$(top_builddir)/lib/libguestfs.la \
$(LIBXML2_LIBS) \
$(LIBVIRT_LIBS) \
$(LTLIBINTL) \
$(top_builddir)/gnulib/lib/libgnu.la \
-lm

View File

@@ -183,6 +183,7 @@ AC_CONFIG_FILES([Makefile
common/errnostring/Makefile
common/edit/Makefile
common/options/Makefile
common/parallel/Makefile
common/progress/Makefile
common/protocol/Makefile
common/utils/Makefile

View File

@@ -28,15 +28,9 @@ bin_PROGRAMS = virt-df
virt_df_SOURCES = \
virt-df.h \
domains.c \
domains.h \
df.c \
estimate-max-threads.c \
estimate-max-threads.h \
main.c \
output.c \
parallel.c \
parallel.h
output.c
virt_df_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
@@ -44,7 +38,7 @@ virt_df_CPPFLAGS = \
-I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/lib -I$(top_builddir)/lib \
-I$(top_srcdir)/common/options -I$(top_builddir)/common/options \
-I$(top_srcdir)/fish \
-I$(top_srcdir)/common/parallel -I$(top_builddir)/common/parallel \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib
virt_df_CFLAGS = \
@@ -55,6 +49,7 @@ virt_df_CFLAGS = \
virt_df_LDADD = \
$(top_builddir)/common/options/liboptions.la \
$(top_builddir)/common/parallel/libparallel.la \
$(top_builddir)/common/utils/libutils.la \
$(top_builddir)/lib/libguestfs.la \
$(LIBXML2_LIBS) \

View File

@@ -24,6 +24,12 @@ common/options/options.c
common/options/options.h
common/options/uri.c
common/options/uri.h
common/parallel/domains.c
common/parallel/domains.h
common/parallel/estimate-max-threads.c
common/parallel/estimate-max-threads.h
common/parallel/parallel.c
common/parallel/parallel.h
common/progress/progress.c
common/progress/progress.h
common/utils/cleanup.c
@@ -161,14 +167,8 @@ daemon/xfs.c
daemon/zero.c
daemon/zerofree.c
df/df.c
df/domains.c
df/domains.h
df/estimate-max-threads.c
df/estimate-max-threads.h
df/main.c
df/output.c
df/parallel.c
df/parallel.h
df/virt-df.h
dib/dummy.c
diff/diff.c

View File

@@ -98,6 +98,10 @@ handled by this library.
Common options parsing for guestfish, guestmount and some virt tools.
=item F<common/parallel>
A framework used for processing multiple libvirt domains in parallel.
=item F<common/progress>
Common code for printing progress bars.

View File

@@ -21,6 +21,9 @@ common/options/inspect.c
common/options/keys.c
common/options/options.c
common/options/uri.c
common/parallel/domains.c
common/parallel/estimate-max-threads.c
common/parallel/parallel.c
common/progress/progress.c
common/utils/cleanup.c
common/utils/structs-cleanup.c
@@ -147,11 +150,8 @@ daemon/xfs.c
daemon/zero.c
daemon/zerofree.c
df/df.c
df/domains.c
df/estimate-max-threads.c
df/main.c
df/output.c
df/parallel.c
dib/dummy.c
diff/diff.c
docs/make-internal-documentation.pl

View File

@@ -27,14 +27,13 @@ LOG_COMPILER = $(VG)
check_PROGRAMS = $(TESTS)
test_parallel_mount_local_SOURCES = \
test-parallel-mount-local.c \
../../df/estimate-max-threads.c \
../../df/estimate-max-threads.h
test-parallel-mount-local.c
test_parallel_mount_local_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
-I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/lib -I$(top_builddir)/lib \
-I$(top_srcdir)/common/parallel -I$(top_builddir)/common/parallel \
-I$(top_srcdir)/df
test_parallel_mount_local_CFLAGS = \
-pthread \
@@ -42,6 +41,7 @@ test_parallel_mount_local_CFLAGS = \
$(FUSE_CFLAGS)
test_parallel_mount_local_LDADD = \
$(FUSE_LIBS) \
$(top_builddir)/common/parallel/libparallel.la \
$(top_builddir)/common/utils/libutils.la \
$(top_builddir)/lib/libguestfs.la \
$(LIBXML2_LIBS) \

View File

@@ -20,18 +20,18 @@ include $(top_srcdir)/subdir-rules.mk
noinst_PROGRAMS = qemu-boot
qemu_boot_SOURCES = \
../../df/estimate-max-threads.c \
../../df/estimate-max-threads.h \
qemu-boot.c
qemu_boot_CPPFLAGS = \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
-I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/lib -I$(top_builddir)/lib \
-I$(top_srcdir)/common/parallel -I$(top_builddir)/common/parallel \
-I$(top_srcdir)/df
qemu_boot_CFLAGS = \
-pthread \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
qemu_boot_LDADD = \
$(top_builddir)/common/parallel/libparallel.la \
$(top_builddir)/common/utils/libutils.la \
$(top_builddir)/lib/libguestfs.la \
$(LIBXML2_LIBS) \