提交 1355e055 编写于 作者: D Daniel P. Berrange

Move all shared utility files to src/util/

* src/bridge.c, src/bridge.h, src/buf.c, src/buf.h, src/cgroup.c,
  src/cgroup.h, src/conf.c, src/conf.h, src/event.c, src/event.h,
  src/hash.c, src/hash.h, src/hostusb.c, src/hostusb.h,
  src/iptables.c, src/iptables.h, src/logging.c, src/logging.h,
  src/memory.c, src/memory.h, src/pci.c, src/pci.h, src/qparams.c,
  src/qparams.h, src/stats_linux.c, src/stats_linux.h,
  src/threads-pthread.c, src/threads-pthread.h, src/threads-win32.c,
  src/threads-win32.h, src/threads.c, src/threads.h, src/util.c,
  src/util.h, src/uuid.c, src/uuid.h, src/virterror.c,
  src/virterror_internal.h, src/xml.c, src/xml.h: Move all files
  into src/util/
* daemon/Makefile.am: Add -Isrc/util/ to build flags
* src/Makefile.am: Add -Isrc/util/ to build flags and update for
  moved files
* src/libvirt_private.syms: Export cgroup APIs since they're now
  in util rather than linking directly to drivers
* src/xen/xs_internal.c: Disable bogus virEventRemoveHandle call
  when built under PROXY
* proxy/Makefile.am: Update for changed file locations. Remove
  bogus build of event.c
* tools/Makefile.am, tests/Makefile.am: Add -Isrc/util/ to build flags
上级 e0a48c99
......@@ -84,6 +84,7 @@ libvirtd_CFLAGS = \
-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
-I$(top_srcdir)/include -I$(top_builddir)/include \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/util \
-I$(top_srcdir)/src/conf \
$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
$(POLKIT_CFLAGS) \
......
......@@ -109,7 +109,7 @@ $(srcdir)/html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
libvirt-api.xml libvirt-refs.xml: apibuild.py \
$(srcdir)/../include/libvirt/*.h \
$(srcdir)/../src/*.h $(srcdir)/../src/*.c
$(srcdir)/../src/libvirt.c $(srcdir)/../src/util/virterror.c
-(./apibuild.py)
$(top_builddir)/NEWS: $(top_srcdir)/docs/news.xsl $(top_srcdir)/docs/news.html.in
......
......@@ -2089,11 +2089,11 @@ def rebuild():
builder = None
if glob.glob("../src/libvirt.c") != [] :
print "Rebuilding API description for libvirt"
builder = docBuilder("libvirt", ["../src", "../include/libvirt"],
builder = docBuilder("libvirt", ["../src", "../src/util", "../include/libvirt"],
[])
elif glob.glob("src/libvirt.c") != [] :
print "Rebuilding API description for libvir"
builder = docBuilder("libvirt", ["src", "include/libvirt"],
builder = docBuilder("libvirt", ["src", "src/util", "include/libvirt"],
[])
else:
print "rebuild() failed, unable to guess the module"
......
......@@ -4,6 +4,7 @@ if WITH_PROXY
INCLUDES = -I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
-I$(top_builddir)/include -I@top_srcdir@/include \
-I@top_srcdir@/proxy -I@top_srcdir@/src \
-I@top_srcdir@/src/util \
-I@top_srcdir@/src/conf \
-I@top_srcdir@/src/xen \
@LIBXML_CFLAGS@ \
......@@ -12,19 +13,21 @@ INCLUDES = -I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
libexec_PROGRAMS = libvirt_proxy
libvirt_proxy_SOURCES = libvirt_proxy.c @top_srcdir@/src/xen/xend_internal.c \
@top_srcdir@/src/xen/xen_hypervisor.c @top_srcdir@/src/virterror.c \
@top_srcdir@/src/xen/sexpr.c \
@top_srcdir@/src/threads.c \
@top_srcdir@/src/xen/xs_internal.c @top_srcdir@/src/buf.c \
libvirt_proxy_SOURCES = libvirt_proxy.c \
@top_srcdir@/src/util/buf.c \
@top_srcdir@/src/util/logging.c \
@top_srcdir@/src/util/memory.c \
@top_srcdir@/src/util/threads.c \
@top_srcdir@/src/util/util.c \
@top_srcdir@/src/util/uuid.c \
@top_srcdir@/src/util/virterror.c \
@top_srcdir@/src/conf/capabilities.c \
@top_srcdir@/src/memory.c \
@top_srcdir@/src/conf/storage_encryption_conf.c \
@top_srcdir@/src/conf/domain_conf.c \
@top_srcdir@/src/util.c \
@top_srcdir@/src/event.c \
@top_srcdir@/src/uuid.c \
@top_srcdir@/src/logging.c
@top_srcdir@/src/xen/xend_internal.c \
@top_srcdir@/src/xen/xen_hypervisor.c \
@top_srcdir@/src/xen/sexpr.c \
@top_srcdir@/src/xen/xs_internal.c
libvirt_proxy_LDFLAGS = $(WARN_CFLAGS) $(XEN_LIBS)
libvirt_proxy_DEPENDENCIES =
libvirt_proxy_LDADD = ../gnulib/lib/libgnu.la
......
......@@ -7,6 +7,7 @@ INCLUDES = \
-I$(top_srcdir)/gnulib/lib \
-I../gnulib/lib \
-I../include \
-I@top_srcdir@/src/util \
-I@top_srcdir@/include \
$(DRIVER_MODULE_CFLAGS) \
$(LIBXML_CFLAGS) \
......@@ -35,26 +36,28 @@ mod_LTLIBRARIES =
# These files are not related to driver APIs. Simply generic
# helper APIs for various purposes
UTIL_SOURCES = \
bridge.c bridge.h \
buf.c buf.h \
conf.c conf.h \
event.c event.h \
hash.c hash.h \
iptables.c iptables.h \
logging.c logging.h \
memory.c memory.h \
pci.c pci.h \
hostusb.c hostusb.h \
qparams.c qparams.h \
threads.c threads.h \
threads-pthread.h \
threads-win32.h \
uuid.c uuid.h \
util.c util.h \
virterror.c virterror_internal.h \
xml.c xml.h
EXTRA_DIST += threads-pthread.c threads-win32.c
util/bridge.c util/bridge.h \
util/buf.c util/buf.h \
util/conf.c util/conf.h \
util/cgroup.c util/cgroup.h \
util/event.c util/event.h \
util/hash.c util/hash.h \
util/iptables.c util/iptables.h \
util/logging.c util/logging.h \
util/memory.c util/memory.h \
util/pci.c util/pci.h \
util/hostusb.c util/hostusb.h \
util/qparams.c util/qparams.h \
util/stats_linux.c util/stats_linux.h \
util/threads.c util/threads.h \
util/threads-pthread.h \
util/threads-win32.h \
util/uuid.c util/uuid.h \
util/util.c util/util.h \
util/xml.c util/xml.h \
util/virterror.c util/virterror_internal.h
EXTRA_DIST += util/threads-pthread.c util/threads-win32.c
# Internal generic driver infrastructure
NODE_INFO_SOURCES = nodeinfo.h nodeinfo.c
......@@ -62,7 +65,6 @@ DRIVER_SOURCES = \
driver.c driver.h \
internal.h \
datatypes.c datatypes.h \
stats_linux.c stats_linux.h \
$(NODE_INFO_SOURCES) \
libvirt.c libvirt_internal.h
......@@ -140,15 +142,13 @@ LXC_DRIVER_SOURCES = \
lxc/lxc_conf.c lxc/lxc_conf.h \
lxc/lxc_container.c lxc/lxc_container.h \
lxc/lxc_driver.c lxc/lxc_driver.h \
lxc/veth.c lxc/veth.h \
cgroup.c cgroup.h
lxc/veth.c lxc/veth.h
LXC_CONTROLLER_SOURCES = \
lxc/lxc_conf.c lxc/lxc_conf.h \
lxc/lxc_container.c lxc/lxc_container.h \
lxc/lxc_controller.c \
lxc/veth.c lxc/veth.h \
cgroup.c cgroup.h
lxc/veth.c lxc/veth.h
PHYP_DRIVER_SOURCES = \
phyp/phyp_driver.c phyp/phyp_driver.h
......@@ -166,9 +166,8 @@ VBOX_DRIVER_SOURCES = \
VBOX_DRIVER_EXTRA_DIST = vbox/vbox_tmpl.c vbox/README
QEMU_DRIVER_SOURCES = \
qemu/qemu_conf.c qemu/qemu_conf.h \
qemu/qemu_driver.c qemu/qemu_driver.h \
cgroup.c cgroup.h
qemu/qemu_conf.c qemu/qemu_conf.h \
qemu/qemu_driver.c qemu/qemu_driver.h
UML_DRIVER_SOURCES = \
uml/uml_conf.c uml/uml_conf.h \
......@@ -533,6 +532,7 @@ endif
libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_CFLAGS = \
-I@top_srcdir@/src/conf
libvirt_driver_storage_la_LDFLAGS =
if WITH_STORAGE_DIR
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_storage.la
......@@ -542,7 +542,7 @@ noinst_LTLIBRARIES += libvirt_driver_storage.la
#libvirt_la_LIBADD += libvirt_driver_storage.la
endif
if WITH_DRIVER_MODULES
libvirt_driver_storage_la_LDFLAGS = -module -avoid-version
libvirt_driver_storage_la_LDFLAGS += -module -avoid-version
endif
libvirt_driver_storage_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
libvirt_driver_storage_la_SOURCES += $(STORAGE_DRIVER_FS_SOURCES)
......@@ -563,6 +563,7 @@ endif
if WITH_STORAGE_MPATH
libvirt_driver_storage_la_SOURCES += $(STORAGE_DRIVER_MPATH_SOURCES)
libvirt_driver_storage_la_CFLAGS += $(DEVMAPPER_CFLAGS)
libvirt_driver_storage_la_LDFLAGS += $(DEVMAPPER_LIBS)
endif
if WITH_STORAGE_DISK
......
......@@ -47,6 +47,23 @@ virConfWriteFile;
virConfWriteMem;
# cgroup.h
virCgroupForDomain;
virCgroupForDriver;
virCgroupRemove;
virCgroupFree;
virCgroupAddTask;
virCgroupSetCpuShares;
virCgroupGetCpuShares;
virCgroupDenyDevicePath;
virCgroupAllowDevicePath;
virCgroupDenyAllDevices;
virCgroupAllowDeviceMajor;
virCgroupControllerTypeToString;
virCgroupControllerTypeFromString;
virCgroupGetCpuacctUsage;
# datatypes.h
virGetDomain;
virGetInterface;
......
......@@ -388,8 +388,10 @@ xenStoreClose(virConnectPtr conn)
if (priv->xshandle == NULL)
return(-1);
#ifndef PROXY
if (priv->xsWatch != -1)
virEventRemoveHandle(priv->xsWatch);
#endif
xs_daemon_close(priv->xshandle);
priv->xshandle = NULL;
......
......@@ -10,6 +10,7 @@ INCLUDES = \
-I$(top_builddir)/include \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/util \
-I$(top_srcdir)/src/conf \
$(LIBXML_CFLAGS) \
$(GNUTLS_CFLAGS) \
......
......@@ -44,7 +44,8 @@ virsh_LDADD = \
virsh_CFLAGS = \
-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
-I../include \
-I../src \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/util \
-DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
$(COVERAGE_CFLAGS) \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册