]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Move all shared utility files to src/util/
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 16 Sep 2009 15:28:46 +0000 (16:28 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 21 Sep 2009 13:41:47 +0000 (14:41 +0100)
* 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

49 files changed:
daemon/Makefile.am
docs/Makefile.am
docs/apibuild.py
proxy/Makefile.am
src/Makefile.am
src/libvirt_private.syms
src/util/bridge.c [moved from src/bridge.c with 100% similarity]
src/util/bridge.h [moved from src/bridge.h with 100% similarity]
src/util/buf.c [moved from src/buf.c with 100% similarity]
src/util/buf.h [moved from src/buf.h with 100% similarity]
src/util/cgroup.c [moved from src/cgroup.c with 100% similarity]
src/util/cgroup.h [moved from src/cgroup.h with 100% similarity]
src/util/conf.c [moved from src/conf.c with 100% similarity]
src/util/conf.h [moved from src/conf.h with 100% similarity]
src/util/event.c [moved from src/event.c with 100% similarity]
src/util/event.h [moved from src/event.h with 100% similarity]
src/util/hash.c [moved from src/hash.c with 100% similarity]
src/util/hash.h [moved from src/hash.h with 100% similarity]
src/util/hostusb.c [moved from src/hostusb.c with 100% similarity]
src/util/hostusb.h [moved from src/hostusb.h with 100% similarity]
src/util/iptables.c [moved from src/iptables.c with 100% similarity]
src/util/iptables.h [moved from src/iptables.h with 100% similarity]
src/util/logging.c [moved from src/logging.c with 100% similarity]
src/util/logging.h [moved from src/logging.h with 100% similarity]
src/util/memory.c [moved from src/memory.c with 100% similarity]
src/util/memory.h [moved from src/memory.h with 100% similarity]
src/util/pci.c [moved from src/pci.c with 100% similarity]
src/util/pci.h [moved from src/pci.h with 100% similarity]
src/util/qparams.c [moved from src/qparams.c with 100% similarity]
src/util/qparams.h [moved from src/qparams.h with 100% similarity]
src/util/stats_linux.c [moved from src/stats_linux.c with 100% similarity]
src/util/stats_linux.h [moved from src/stats_linux.h with 100% similarity]
src/util/threads-pthread.c [moved from src/threads-pthread.c with 100% similarity]
src/util/threads-pthread.h [moved from src/threads-pthread.h with 100% similarity]
src/util/threads-win32.c [moved from src/threads-win32.c with 100% similarity]
src/util/threads-win32.h [moved from src/threads-win32.h with 100% similarity]
src/util/threads.c [moved from src/threads.c with 100% similarity]
src/util/threads.h [moved from src/threads.h with 100% similarity]
src/util/util.c [moved from src/util.c with 100% similarity]
src/util/util.h [moved from src/util.h with 100% similarity]
src/util/uuid.c [moved from src/uuid.c with 100% similarity]
src/util/uuid.h [moved from src/uuid.h with 100% similarity]
src/util/virterror.c [moved from src/virterror.c with 100% similarity]
src/util/virterror_internal.h [moved from src/virterror_internal.h with 100% similarity]
src/util/xml.c [moved from src/xml.c with 100% similarity]
src/util/xml.h [moved from src/xml.h with 100% similarity]
src/xen/xs_internal.c
tests/Makefile.am
tools/Makefile.am

index 75f9c193a0e1974287aed17e75fe243b28819e26..2938e6c070b603c0ed6089d25e3f5c8c017ba01a 100644 (file)
@@ -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) \
index 4cd11b005d37a916bb5545432896986991576566..40778239232f2e4599cd40d4312bd98bafe75e4c 100644 (file)
@@ -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
index 84bc1ac3bfde3c4b13e5f7bfde88bfeca93d2e7c..855569b5b1beb55a5c13a0ce68d3f11f39a4e8ae 100755 (executable)
@@ -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"
index bd6a0c8b84bcfde030bc570cda4bb98eec5417f7..3e0050b7b077e1083f23efbe5561c40b74690697 100644 (file)
@@ -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
index 113ffe317434a9c574560d8c0d8790b7a81b6671..f5534d7a479c96e02c0b3a2c11ee5e9dee6b90fe 100644 (file)
@@ -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
index 867678fa34a2d38ce5cf20dd919d2a494839094f..a2646a33d75382902fa14204c75aa9ead0611283 100644 (file)
@@ -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;
similarity index 100%
rename from src/bridge.c
rename to src/util/bridge.c
similarity index 100%
rename from src/bridge.h
rename to src/util/bridge.h
similarity index 100%
rename from src/buf.c
rename to src/util/buf.c
similarity index 100%
rename from src/buf.h
rename to src/util/buf.h
similarity index 100%
rename from src/cgroup.c
rename to src/util/cgroup.c
similarity index 100%
rename from src/cgroup.h
rename to src/util/cgroup.h
similarity index 100%
rename from src/conf.c
rename to src/util/conf.c
similarity index 100%
rename from src/conf.h
rename to src/util/conf.h
similarity index 100%
rename from src/event.c
rename to src/util/event.c
similarity index 100%
rename from src/event.h
rename to src/util/event.h
similarity index 100%
rename from src/hash.c
rename to src/util/hash.c
similarity index 100%
rename from src/hash.h
rename to src/util/hash.h
similarity index 100%
rename from src/hostusb.c
rename to src/util/hostusb.c
similarity index 100%
rename from src/hostusb.h
rename to src/util/hostusb.h
similarity index 100%
rename from src/iptables.c
rename to src/util/iptables.c
similarity index 100%
rename from src/iptables.h
rename to src/util/iptables.h
similarity index 100%
rename from src/logging.c
rename to src/util/logging.c
similarity index 100%
rename from src/logging.h
rename to src/util/logging.h
similarity index 100%
rename from src/memory.c
rename to src/util/memory.c
similarity index 100%
rename from src/memory.h
rename to src/util/memory.h
similarity index 100%
rename from src/pci.c
rename to src/util/pci.c
similarity index 100%
rename from src/pci.h
rename to src/util/pci.h
similarity index 100%
rename from src/qparams.c
rename to src/util/qparams.c
similarity index 100%
rename from src/qparams.h
rename to src/util/qparams.h
similarity index 100%
rename from src/stats_linux.c
rename to src/util/stats_linux.c
similarity index 100%
rename from src/stats_linux.h
rename to src/util/stats_linux.h
similarity index 100%
rename from src/threads-win32.c
rename to src/util/threads-win32.c
similarity index 100%
rename from src/threads-win32.h
rename to src/util/threads-win32.h
similarity index 100%
rename from src/threads.c
rename to src/util/threads.c
similarity index 100%
rename from src/threads.h
rename to src/util/threads.h
similarity index 100%
rename from src/util.c
rename to src/util/util.c
similarity index 100%
rename from src/util.h
rename to src/util/util.h
similarity index 100%
rename from src/uuid.c
rename to src/util/uuid.c
similarity index 100%
rename from src/uuid.h
rename to src/util/uuid.h
similarity index 100%
rename from src/virterror.c
rename to src/util/virterror.c
similarity index 100%
rename from src/xml.c
rename to src/util/xml.c
similarity index 100%
rename from src/xml.h
rename to src/util/xml.h
index 494728d6390d0637bc4c345b17dce060d65ac673..54f410f29c2c626af457886f8d684074441ea7e0 100644 (file)
@@ -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;
 
index 26b8c1f92d53518317c6e4353d204ec4bc78aba6..cc166717250391d7438c681cdc6835bdce106465 100644 (file)
@@ -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) \
index 81698a4b30785a7a5887a4915f7cc953698f7ad6..c48b203e52c150b53c95c1a4f0ea70a6d8b27722 100644 (file)
@@ -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)                              \