In preparation for splitting up the CPU map data file, move it into a
dedicated directory of its own.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
libvirt.spec.in | 2 +-
mingw-libvirt.spec.in | 4 ++--
src/Makefile.am | 7 +------
src/cpu/cpu_map.c | 10 +++++-----
src/cpu_map/Makefile.inc.am | 7 +++++++
src/{cpu/cpu_map.xml => cpu_map/index.xml} | 0
6 files changed, 16 insertions(+), 14 deletions(-)
create mode 100644 src/cpu_map/Makefile.inc.am
rename src/{cpu/cpu_map.xml => cpu_map/index.xml} (100%)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 883c8a49e7..09f654b2ec 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1854,7 +1854,7 @@ exit 0
%{_datadir}/libvirt/schemas/storagepool.rng
%{_datadir}/libvirt/schemas/storagevol.rng
-%{_datadir}/libvirt/cpu_map.xml
+%{_datadir}/libvirt/cpu_map/*.xml
%{_datadir}/libvirt/test-screenshot.png
diff --git a/mingw-libvirt.spec.in b/mingw-libvirt.spec.in
index cc1e619927..b28e40f7f7 100644
--- a/mingw-libvirt.spec.in
+++ b/mingw-libvirt.spec.in
@@ -260,7 +260,7 @@ rm -rf $RPM_BUILD_ROOT%{mingw64_libexecdir}/libvirt-guests.sh
%{mingw32_datadir}/libvirt/api/libvirt-qemu-api.xml
%{mingw32_datadir}/libvirt/api/libvirt-admin-api.xml
-%{mingw32_datadir}/libvirt/cpu_map.xml
+%{mingw32_datadir}/libvirt/cpu_map/*.xml
%{mingw32_datadir}/libvirt/test-screenshot.png
@@ -347,7 +347,7 @@ rm -rf $RPM_BUILD_ROOT%{mingw64_libexecdir}/libvirt-guests.sh
%{mingw64_datadir}/libvirt/api/libvirt-qemu-api.xml
%{mingw64_datadir}/libvirt/api/libvirt-admin-api.xml
-%{mingw64_datadir}/libvirt/cpu_map.xml
+%{mingw64_datadir}/libvirt/cpu_map/*.xml
%{mingw64_datadir}/libvirt/test-screenshot.png
diff --git a/src/Makefile.am b/src/Makefile.am
index db8c8ebd1a..2a3ed0d42d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -100,6 +100,7 @@ man7_MANS =
include util/Makefile.inc.am
include conf/Makefile.inc.am
include cpu/Makefile.inc.am
+include cpu_map/Makefile.inc.am
include security/Makefile.inc.am
include access/Makefile.inc.am
include logging/Makefile.inc.am
@@ -364,12 +365,6 @@ check-local: check-protocol check-symfile check-symsorting \
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
-
-
-pkgdata_DATA = cpu/cpu_map.xml
-
-EXTRA_DIST += $(pkgdata_DATA)
-
#########################
#
# Build up list of libvirt.la source files based on configure conditions
diff --git a/src/cpu/cpu_map.c b/src/cpu/cpu_map.c
index 400e6f1427..2079767df8 100644
--- a/src/cpu/cpu_map.c
+++ b/src/cpu/cpu_map.c
@@ -99,8 +99,8 @@ cpuMapLoadInclude(const char *filename,
char *mapfile;
if (!(mapfile = virFileFindResource(filename,
- abs_topsrcdir "/src/cpu",
- PKGDATADIR)))
+ abs_topsrcdir "/src/cpu_map",
+ PKGDATADIR "/cpu_map")))
return -1;
VIR_DEBUG("Loading CPU map include from %s", mapfile);
@@ -182,9 +182,9 @@ int cpuMapLoad(const char *arch,
int ret = -1;
char *mapfile;
- if (!(mapfile = virFileFindResource("cpu_map.xml",
- abs_topsrcdir "/src/cpu",
- PKGDATADIR)))
+ if (!(mapfile = virFileFindResource("index.xml",
+ abs_topsrcdir "/src/cpu_map",
+ PKGDATADIR "/cpu_map")))
return -1;
VIR_DEBUG("Loading '%s' CPU map from %s", NULLSTR(arch), mapfile);
diff --git a/src/cpu_map/Makefile.inc.am b/src/cpu_map/Makefile.inc.am
new file mode 100644
index 0000000000..91728b9200
--- /dev/null
+++ b/src/cpu_map/Makefile.inc.am
@@ -0,0 +1,7 @@
+
+cpumapdir = $(pkgdatadir)/cpu_map
+cpumap_DATA = \
+ cpu_map/index.xml \
+ $(NULL)
+
+EXTRA_DIST += $(cpumap_DATA)
diff --git a/src/cpu/cpu_map.xml b/src/cpu_map/index.xml
similarity index 100%
rename from src/cpu/cpu_map.xml
rename to src/cpu_map/index.xml
--
2.17.1