Skip to content

Commit a0be144

Browse files
committed
Split libguestfs analysis tools from libguestfs.
1 parent c26578c commit a0be144

25 files changed

+3364
-84
lines changed

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
*~
2+
*.1
3+
*.lo
4+
*.la
5+
*.o
6+
*.a
7+
8+
.deps
9+
.dirstamp
10+
.libs
11+
Makefile
12+
Makefile.in
13+
14+
/aclocal.m4
15+
/autom4te.cache/
16+
/boot-analysis/boot-analysis
17+
/boot-benchmark/boot-benchmark
18+
/build-aux/ar-lib
19+
/build-aux/compile
20+
/build-aux/config.guess
21+
/build-aux/config.sub
22+
/build-aux/depcomp
23+
/build-aux/install-sh
24+
/build-aux/ltmain.sh
25+
/build-aux/missing
26+
/build-aux/snippet/
27+
/build-aux/test-driver
28+
/build-aux/ylwrap
29+
/config.h
30+
/config.h.in
31+
/config.log
32+
/configure
33+
/config.status
34+
/libtool
35+
/m4/
36+
/podwrapper.pl
37+
/qemu-boot/qemu-boot
38+
/qemu-speed-test/qemu-speed-test
39+
/stamp-h1

COPYING

Lines changed: 339 additions & 0 deletions
Large diffs are not rendered by default.

Makefile.am

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# libguestfs
2+
# Copyright (C) 2009-2019 Red Hat Inc.
3+
#
4+
# This program is free software; you can redistribute it and/or modify
5+
# it under the terms of the GNU General Public License as published by
6+
# the Free Software Foundation; either version 2 of the License, or
7+
# (at your option) any later version.
8+
#
9+
# This program is distributed in the hope that it will be useful,
10+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
# GNU General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU General Public License
15+
# along with this program; if not, write to the Free Software
16+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17+
18+
ACLOCAL_AMFLAGS = -I m4
19+
20+
SUBDIRS = \
21+
utils \
22+
boot-analysis \
23+
boot-benchmark \
24+
max-disks \
25+
qemu-boot \
26+
qemu-speed-test

boot-analysis/Makefile.am

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,18 @@ boot_analysis_SOURCES = \
2828
boot-analysis-utils.c \
2929
boot-analysis-utils.h
3030
boot_analysis_CPPFLAGS = \
31-
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
32-
-I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
31+
-I$(top_srcdir)/utils -I$(top_builddir)/utils \
3332
-I$(top_srcdir)/lib -I$(top_builddir)/lib
3433
boot_analysis_CFLAGS = \
3534
-pthread \
3635
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
37-
$(PCRE_CFLAGS)
36+
$(PCRE_CFLAGS) \
37+
$(LIBGUESTFS_CFLAGS)
3838
boot_analysis_LDADD = \
39-
$(top_builddir)/common/utils/libutils.la \
40-
$(top_builddir)/lib/libguestfs.la \
39+
$(top_builddir)/utils/libutils.la \
40+
$(LIBGUESTFS_LIBS) \
4141
$(PCRE_LIBS) \
42-
$(LIBXML2_LIBS) \
43-
$(LIBVIRT_LIBS) \
4442
$(LTLIBINTL) \
45-
$(top_builddir)/gnulib/lib/libgnu.la \
4643
-lm
4744

4845
# Manual page.

boot-analysis/boot-analysis-timeline.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@
3030

3131
#include <pcre.h>
3232

33-
#include "ignore-value.h"
33+
#include <guestfs.h>
3434

35-
#include "guestfs.h"
36-
#include "guestfs-utils.h"
35+
#include "utils.h"
3736

3837
#include "boot-analysis.h"
3938

boot-analysis/boot-analysis-utils.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@
2424
#include <error.h>
2525
#include <errno.h>
2626

27-
#include "ignore-value.h"
27+
#include <guestfs.h>
2828

29-
#include "guestfs.h"
30-
#include "guestfs-utils.h"
29+
#include "utils.h"
3130

3231
#include "boot-analysis-utils.h"
3332

@@ -56,16 +55,16 @@ test_info (guestfs_h *g, int nr_test_passes)
5655
CLEANUP_FREE char *backend = NULL;
5756

5857
/* Related to the test program. */
59-
printf ("test version: %s %s\n", PACKAGE_NAME, PACKAGE_VERSION_FULL);
58+
printf ("test version: %s %s\n", PACKAGE_NAME, PACKAGE_VERSION);
6059
printf (" test passes: %d\n", nr_test_passes);
6160

6261
/* Related to the host. */
6362
printf ("host version: ");
6463
fflush (stdout);
65-
ignore_value (system ("uname -a"));
64+
system ("uname -a");
6665
printf (" host CPU: ");
6766
fflush (stdout);
68-
ignore_value (system ("perl -n -e 'if (/^model name.*: (.*)/) { print \"$1\\n\"; exit }' /proc/cpuinfo"));
67+
system ("perl -n -e 'if (/^model name.*: (.*)/) { print \"$1\\n\"; exit }' /proc/cpuinfo");
6968

7069
/* Related to qemu. */
7170
backend = guestfs_get_backend (g);
@@ -76,7 +75,7 @@ test_info (guestfs_h *g, int nr_test_passes)
7675
fflush (stdout);
7776
if (asprintf (&cmd, "%s -version", qemu) == -1)
7877
error (EXIT_FAILURE, errno, "asprintf");
79-
ignore_value (system (cmd));
78+
system (cmd);
8079
printf (" smp: %-20d [to change use --smp option]\n",
8180
guestfs_get_smp (g));
8281
printf (" memsize: %-20d [to change use --memsize option]\n",

boot-analysis/boot-analysis.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,13 @@
3939
#include <math.h>
4040
#include <pthread.h>
4141

42-
#include "guestfs.h"
43-
#include "guestfs-utils.h"
42+
#include <guestfs.h>
43+
44+
#include "utils.h"
4445

4546
#include "boot-analysis.h"
4647
#include "boot-analysis-utils.h"
4748

48-
#include "getprogname.h"
49-
5049
/* Activities taking longer than this % of the total time, except
5150
* those flagged as LONG_ACTIVITY, are highlighted in red.
5251
*/
@@ -169,13 +168,13 @@ main (int argc, char *argv[])
169168
break;
170169
}
171170
fprintf (stderr, "%s: unknown long option: %s (%d)\n",
172-
getprogname (), long_options[option_index].name, option_index);
171+
argv[0], long_options[option_index].name, option_index);
173172
exit (EXIT_FAILURE);
174173

175174
case 'm':
176175
if (sscanf (optarg, "%d", &memsize) != 1) {
177176
fprintf (stderr, "%s: could not parse memsize parameter: %s\n",
178-
getprogname (), optarg);
177+
argv[0], optarg);
179178
exit (EXIT_FAILURE);
180179
}
181180
break;

boot-benchmark/Makefile.am

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,15 @@ boot_benchmark_SOURCES = \
3030
../boot-analysis/boot-analysis-utils.c \
3131
../boot-analysis/boot-analysis-utils.h
3232
boot_benchmark_CPPFLAGS = \
33-
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
34-
-I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
35-
-I$(top_srcdir)/lib -I$(top_builddir)/lib \
36-
-I$(top_srcdir)/utils/boot-analysis
33+
-I$(top_srcdir)/utils -I$(top_builddir)/utils \
34+
-I$(top_srcdir)/boot-analysis
3735
boot_benchmark_CFLAGS = \
38-
$(WARN_CFLAGS) $(WERROR_CFLAGS)
36+
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
37+
$(LIBGUESTFS_CFLAGS)
3938
boot_benchmark_LDADD = \
40-
$(top_builddir)/common/utils/libutils.la \
41-
$(top_builddir)/lib/libguestfs.la \
42-
$(LIBXML2_LIBS) \
39+
$(top_builddir)/utils/libutils.la \
40+
$(LIBGUESTFS_LIBS) \
4341
$(LTLIBINTL) \
44-
$(top_builddir)/gnulib/lib/libgnu.la \
4542
-lm
4643

4744
# Manual page.

boot-benchmark/boot-benchmark.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@
3333
#include <assert.h>
3434
#include <math.h>
3535

36-
#include "guestfs.h"
37-
#include "guestfs-utils.h"
36+
#include <guestfs.h>
3837

39-
#include "boot-analysis-utils.h"
38+
#include "utils.h"
4039

41-
#include "getprogname.h"
40+
#include "boot-analysis-utils.h"
4241

4342
#define NR_WARMUP_PASSES 3
4443
#define NR_TEST_PASSES 10
@@ -104,19 +103,19 @@ main (int argc, char *argv[])
104103
else if (STREQ (long_options[option_index].name, "smp")) {
105104
if (sscanf (optarg, "%d", &smp) != 1) {
106105
fprintf (stderr, "%s: could not parse smp parameter: %s\n",
107-
getprogname (), optarg);
106+
argv[0], optarg);
108107
exit (EXIT_FAILURE);
109108
}
110109
break;
111110
}
112111
fprintf (stderr, "%s: unknown long option: %s (%d)\n",
113-
getprogname (), long_options[option_index].name, option_index);
112+
argv[0], long_options[option_index].name, option_index);
114113
exit (EXIT_FAILURE);
115114

116115
case 'm':
117116
if (sscanf (optarg, "%d", &memsize) != 1) {
118117
fprintf (stderr, "%s: could not parse memsize parameter: %s\n",
119-
getprogname (), optarg);
118+
argv[0], optarg);
120119
exit (EXIT_FAILURE);
121120
}
122121
break;

0 commit comments

Comments
 (0)