Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
2c855c1c
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2c855c1c
编写于
11月 21, 2008
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Optional dlopen support for drivers
上级
410fb96c
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
372 addition
and
26 deletion
+372
-26
ChangeLog
ChangeLog
+22
-0
configure.in
configure.in
+40
-0
qemud/Makefile.am
qemud/Makefile.am
+2
-0
qemud/qemud.c
qemud/qemud.c
+18
-1
src/Makefile.am
src/Makefile.am
+74
-1
src/driver.c
src/driver.c
+97
-0
src/driver.h
src/driver.h
+2
-0
src/libvirt.c
src/libvirt.c
+21
-1
src/libvirt_sym.version.in
src/libvirt_sym.version.in
+74
-0
src/qemu_driver.c
src/qemu_driver.c
+1
-1
src/qemu_driver.h
src/qemu_driver.h
+1
-1
src/xen_unified.c
src/xen_unified.c
+2
-2
src/xen_unified.h
src/xen_unified.h
+1
-1
tests/Makefile.am
tests/Makefile.am
+10
-4
tests/testutils.c
tests/testutils.c
+3
-0
tests/xmconfigtest.c
tests/xmconfigtest.c
+4
-14
未找到文件。
ChangeLog
浏览文件 @
2c855c1c
Fri Nov 21 12:03:14 BST 2008 Daniel P. Berrange <berrange@redhat.com>
Optional (disabled by default) dlopen support
* configure.in: Probe for dlopen
* qemud/Makefile.am: Don't link to drivers when dlopen is used
* qemud/qemud.c: Load external driver modules at startup
* src/Makefile.am: Don't link to drivers when dlopen is used
* src/driver.c, src/driver.h: Add API for dlopen'ing modules
* src/libvirt.c: Load external driver modules at startup
* src/libvirt_sym.version.in: Export more internal symbols
needed for external driver modules
* src/qemud_driver.c, src/qemu_driver.h, src/xen_unified.c,
src/xen_unified.h: Sanitize driver registration methodname
to match module name
* tests/Makefile.am: Set LIBVIRT_DRIVER_DIR when running
tests with dlopen enabled. Link to driver modules in Xen
test cases
* tests/testutils.c: Set LIBVIRT_DRIVER_DIR when running
external programs
* tests/xmconfigtest.c: Don't open test driver during xen
tests.
Fri Nov 21 11:43:14 BST 2008 Daniel P. Berrange <berrange@redhat.com>
* src/libvirt_sym.version.in: Add export of domain event
...
...
configure.in
浏览文件 @
2c855c1c
...
...
@@ -1066,6 +1066,38 @@ dnl Look for windres to build a Windows icon resource.
AC_CHECK_TOOL([WINDRES], [windres], [no])
AM_CONDITIONAL([WITH_WIN_ICON], [test "$WINDRES" != "no"])
dnl Driver-Modules library
AC_ARG_WITH([driver-modules],
[ --with-driver-modules build drivers as loadable modules],
[],
[with_driver_modules=no])
DRIVER_MODULES_CFLAGS=
DRIVER_MODULES_LIBS=
if test "x$with_driver_modules" = "xyes" ; then
old_cflags="$CFLAGS"
old_libs="$LIBS"
fail=0
AC_CHECK_HEADER([dlfcn.h],[],[fail=1])
AC_CHECK_LIB([dl], [dlopen],[],[fail=1])
test $fail = 1 &&
AC_MSG_ERROR([You must have dlfcn.h / dlopen() support to build driver modules])
CFLAGS="$old_cflags"
LIBS="$old_libs"
fi
if test "$with_driver_modules" = "yes"; then
DRIVER_MODULES_CFLAGS="-export-dynamic"
DRIVER_MODULES_LIBS="-ldl"
AC_DEFINE_UNQUOTED([WITH_DRIVER_MODULES], 1, [whether to build drivers as modules])
fi
AM_CONDITIONAL([WITH_DRIVER_MODULES], [test "$with_driver_modules" != "no"])
AC_SUBST([DRIVER_MODULES_CFLAGS])
AC_SUBST([DRIVER_MODULES_LIBS])
# Set LV_LIBTOOL_OBJDIR to "." or $lt_cv_objdir, depending on whether
# we're building shared libraries. This is the name of the directory
# in which .o files will be created.
...
...
@@ -1122,6 +1154,14 @@ AC_MSG_NOTICE([ LVM: $with_storage_lvm])
AC_MSG_NOTICE([ iSCSI: $with_storage_iscsi])
AC_MSG_NOTICE([ Disk: $with_storage_disk])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([Driver Loadable Modules])
AC_MSG_NOTICE([])
if test "$with_driver_modules" != "no" ; then
AC_MSG_NOTICE([ dlopen: $DRIVER_MODULES_CFLAGS $DRIVER_MODULES_LIBS])
else
AC_MSG_NOTICE([ dlopen: no])
fi
AC_MSG_NOTICE([])
AC_MSG_NOTICE([Libraries])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([ libxml: $LIBXML_CFLAGS $LIBXML_LIBS])
...
...
qemud/Makefile.am
浏览文件 @
2c855c1c
...
...
@@ -91,6 +91,7 @@ libvirtd_DEPENDENCIES = ../src/libvirt.la
libvirtd_LDADD
=
\
../gnulib/lib/libgnu.la
if
!
WITH_DRIVER_MODULES
if
WITH_QEMU
libvirtd_LDADD
+=
../src/libvirt_driver_qemu.la
endif
...
...
@@ -110,6 +111,7 @@ endif
if
WITH_NETWORK
libvirtd_LDADD
+=
../src/libvirt_driver_network.la
endif
endif
libvirtd_LDADD
+=
../src/libvirt.la
...
...
qemud/qemud.c
浏览文件 @
2c855c1c
...
...
@@ -61,6 +61,9 @@
#include "mdns.h"
#endif
#ifdef WITH_DRIVER_MODULES
#include "driver.h"
#else
#ifdef WITH_QEMU
#include "qemu_driver.h"
#endif
...
...
@@ -76,6 +79,7 @@
#ifdef WITH_STORAGE_DIR
#include "storage_driver.h"
#endif
#endif
static
int
godaemon
=
0
;
/* -d: Be a daemon */
...
...
@@ -748,8 +752,20 @@ static struct qemud_server *qemudInitialize(int sigread) {
virInitialize
();
#ifdef WITH_DRIVER_MODULES
/* We don't care if any of these fail, because the whole point
* is to allow users to only install modules they want to use.
* If they try to use a open a connection for a module that
* is not loaded they'll get a suitable error at that point
*/
virDriverLoadModule
(
"qemu"
);
virDriverLoadModule
(
"lxc"
);
virDriverLoadModule
(
"uml"
);
virDriverLoadModule
(
"network"
);
virDriverLoadModule
(
"storage"
);
#else
#ifdef WITH_QEMU
qemu
d
Register
();
qemuRegister
();
#endif
#ifdef WITH_LXC
lxcRegister
();
...
...
@@ -762,6 +778,7 @@ static struct qemud_server *qemudInitialize(int sigread) {
#endif
#ifdef WITH_STORAGE_DIR
storageRegister
();
#endif
#endif
virEventRegisterImpl
(
virEventAddHandleImpl
,
...
...
src/Makefile.am
浏览文件 @
2c855c1c
...
...
@@ -6,7 +6,10 @@ INCLUDES = \
-I
@top_srcdir@/include
\
-I
@top_srcdir@/qemud
\
$(LIBXML_CFLAGS)
\
$(XEN_CFLAGS)
\
$(SELINUX_CFLAGS)
\
$(DRIVER_MODULE_CFLAGS)
\
-DLIBDIR
=
\"
"
$(libdir)
"
\"
\
-DBINDIR
=
\"
"
$(libexecdir)
"
\"
\
-DSBINDIR
=
\"
"
$(sbindir)
"
\"
\
-DSYSCONF_DIR
=
"
\"
$(sysconfdir)
\"
"
\
...
...
@@ -30,6 +33,10 @@ EXTRA_DIST = libvirt_sym.version $(conf_DATA) $(ICON_FILES)
lib_LTLIBRARIES
=
libvirt.la
moddir
=
$(libdir)
/libvirt/drivers
mod_LTLIBRARIES
=
# These files are not related to driver APIs. Simply generic
# helper APIs for various purposes
UTIL_SOURCES
=
\
...
...
@@ -49,7 +56,7 @@ UTIL_SOURCES = \
# Internal generic driver infrastructure
DRIVER_SOURCES
=
\
driver.
h
\
driver.
c driver.h
\
internal.h
\
datatypes.c datatypes.h
\
domain_event.c domain_event.h
\
...
...
@@ -169,73 +176,138 @@ libvirt_driver_la_CFLAGS = $(XEN_CFLAGS)
libvirt_driver_la_LDFLAGS
=
$(XEN_LIBS)
if
WITH_TEST
if
WITH_DRIVER_MODULES
mod_LTLIBRARIES
+=
libvirt_driver_test.la
else
noinst_LTLIBRARIES
+=
libvirt_driver_test.la
libvirt_la_LIBADD
+=
libvirt_driver_test.la
endif
if
WITH_DRIVER_MODULES
libvirt_driver_test_la_LDFLAGS
=
-module
-avoid-version
endif
libvirt_driver_test_la_SOURCES
=
$(TEST_DRIVER_SOURCES)
endif
if
WITH_REMOTE
if
WITH_DRIVER_MODULES
mod_LTLIBRARIES
+=
libvirt_driver_remote.la
else
noinst_LTLIBRARIES
+=
libvirt_driver_remote.la
libvirt_la_LIBADD
+=
libvirt_driver_remote.la
endif
libvirt_driver_remote_la_CFLAGS
=
\
$(GNUTLS_CFLAGS)
\
$(SASL_CFLAGS)
libvirt_driver_remote_la_LDFLAGS
=
\
$(GNUTLS_LIBS)
\
$(SASL_LIBS)
if
WITH_DRIVER_MODULES
libvirt_driver_remote_la_LDFLAGS
+=
-module
-avoid-version
endif
libvirt_driver_remote_la_SOURCES
=
$(REMOTE_DRIVER_SOURCES)
endif
if
WITH_XEN
if
WITH_DRIVER_MODULES
mod_LTLIBRARIES
+=
libvirt_driver_xen.la
else
noinst_LTLIBRARIES
+=
libvirt_driver_xen.la
libvirt_la_LIBADD
+=
libvirt_driver_xen.la
endif
libvirt_driver_xen_la_CFLAGS
=
$(XEN_CFLAGS)
libvirt_driver_xen_la_LDFLAGS
=
$(XEN_LIBS)
if
WITH_DRIVER_MODULES
libvirt_driver_xen_la_LDFLAGS
+=
-module
-avoid-version
endif
libvirt_driver_xen_la_SOURCES
=
$(XEN_DRIVER_SOURCES)
endif
if
WITH_OPENVZ
if
WITH_DRIVER_MODULES
mod_LTLIBRARIES
+=
libvirt_driver_openvz.la
else
noinst_LTLIBRARIES
+=
libvirt_driver_openvz.la
libvirt_la_LIBADD
+=
libvirt_driver_openvz.la
endif
if
WITH_DRIVER_MODULES
libvirt_driver_openvz_la_LDFLAGS
=
-module
-avoid-version
endif
libvirt_driver_openvz_la_SOURCES
=
$(OPENVZ_DRIVER_SOURCES)
endif
if
WITH_QEMU
if
WITH_DRIVER_MODULES
mod_LTLIBRARIES
+=
libvirt_driver_qemu.la
else
noinst_LTLIBRARIES
+=
libvirt_driver_qemu.la
# Stateful, so linked to daemon instead
#libvirt_la_LIBADD += libvirt_driver_qemu.la
endif
libvirt_driver_qemu_la_CFLAGS
=
$(NUMACTL_CFLAGS)
libvirt_driver_qemu_la_LDFLAGS
=
$(NUMACTL_LIBS)
if
WITH_DRIVER_MODULES
libvirt_driver_qemu_la_LDFLAGS
+=
-module
-avoid-version
endif
libvirt_driver_qemu_la_SOURCES
=
$(QEMU_DRIVER_SOURCES)
endif
if
WITH_LXC
if
WITH_DRIVER_MODULES
mod_LTLIBRARIES
+=
libvirt_driver_lxc.la
else
noinst_LTLIBRARIES
+=
libvirt_driver_lxc.la
# Stateful, so linked to daemon instead
#libvirt_la_LIBADD += libvirt_driver_lxc.la
endif
if
WITH_DRIVER_MODULES
libvirt_driver_lxc_la_LDFLAGS
=
-module
-avoid-version
endif
libvirt_driver_lxc_la_SOURCES
=
$(LXC_DRIVER_SOURCES)
endif
if
WITH_UML
if
WITH_DRIVER_MODULES
mod_LTLIBRARIES
+=
libvirt_driver_uml.la
else
noinst_LTLIBRARIES
+=
libvirt_driver_uml.la
# Stateful, so linked to daemon instead
#libvirt_la_LIBADD += libvirt_driver_uml.la
endif
libvirt_driver_uml_la_CFLAGS
=
$(NUMACTL_CFLAGS)
libvirt_driver_uml_la_LDFLAGS
=
$(NUMACTL_LIBS)
if
WITH_DRIVER_MODULES
libvirt_driver_uml_la_LDFLAGS
+=
-module
-avoid-version
endif
libvirt_driver_uml_la_SOURCES
=
$(UML_DRIVER_SOURCES)
endif
if
WITH_NETWORK
if
WITH_DRIVER_MODULES
mod_LTLIBRARIES
+=
libvirt_driver_network.la
else
noinst_LTLIBRARIES
+=
libvirt_driver_network.la
# Stateful, so linked to daemon instead
#libvirt_la_LIBADD += libvirt_driver_network.la
endif
if
WITH_DRIVER_MODULES
libvirt_driver_network_la_LDFLAGS
=
-module
-avoid-version
endif
libvirt_driver_network_la_SOURCES
=
$(NETWORK_DRIVER_SOURCES)
endif
# Needed to keep automake quiet about conditionals
libvirt_driver_storage_la_SOURCES
=
if
WITH_STORAGE_DIR
if
WITH_DRIVER_MODULES
mod_LTLIBRARIES
+=
libvirt_driver_storage.la
else
noinst_LTLIBRARIES
+=
libvirt_driver_storage.la
# Stateful, so linked to daemon instead
#libvirt_la_LIBADD += libvirt_driver_storage.la
endif
if
WITH_DRIVER_MODULES
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)
endif
...
...
@@ -277,6 +349,7 @@ libvirt_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libvirt_sym.version \
-version-info
@LIBVIRT_VERSION_INFO@
\
$
(
COVERAGE_CFLAGS:-f%
=
-Wc
,-f%
)
\
$(LIBXML_LIBS)
$(SELINUX_LIBS)
\
$(XEN_LIBS)
$(DRIVER_MODULE_LIBS)
\
@CYGWIN_EXTRA_LDFLAGS@ @MINGW_EXTRA_LDFLAGS@
libvirt_la_CFLAGS
=
$(COVERAGE_CFLAGS)
-DIN_LIBVIRT
libvirt_la_DEPENDENCIES
=
$(libvirt_la_LIBADD)
$(srcdir)
/libvirt_sym.version
...
...
src/driver.c
0 → 100644
浏览文件 @
2c855c1c
/*
* driver.c: Helpers for loading drivers
*
* Copyright (C) 2006-2008 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <config.h>
#include <unistd.h>
#include "driver.h"
#include "memory.h"
#include "logging.h"
#define DEFAULT_DRIVER_DIR LIBDIR "/libvirt/drivers"
#ifdef WITH_DRIVER_MODULES
/* XXX re-implment this for other OS, or use libtools helper lib ? */
#include <dlfcn.h>
void
*
virDriverLoadModule
(
const
char
*
name
)
{
const
char
*
moddir
=
getenv
(
"LIBVIRT_DRIVER_DIR"
);
char
*
modfile
=
NULL
,
*
regfunc
=
NULL
;
void
*
handle
=
NULL
;
int
(
*
regsym
)(
void
);
if
(
moddir
==
NULL
)
moddir
=
DEFAULT_DRIVER_DIR
;
DEBUG
(
"Module load %s"
,
name
);
if
(
asprintf
(
&
modfile
,
"%s/libvirt_driver_%s.so"
,
moddir
,
name
)
<
0
)
return
NULL
;
if
(
access
(
modfile
,
R_OK
)
<
0
)
{
DEBUG
(
"Moodule %s not accessible"
,
modfile
);
goto
cleanup
;
}
handle
=
dlopen
(
modfile
,
RTLD_NOW
|
RTLD_LOCAL
);
if
(
!
handle
)
{
DEBUG
(
"failed to load module %s %s"
,
modfile
,
dlerror
());
goto
cleanup
;
}
if
(
asprintf
(
&
regfunc
,
"%sRegister"
,
name
)
<
0
)
{
regfunc
=
NULL
;
goto
cleanup
;
}
regsym
=
dlsym
(
handle
,
regfunc
);
if
(
!
regsym
)
{
DEBUG
(
"Missing module registration symbol %s"
,
regfunc
);
goto
cleanup
;
}
if
((
*
regsym
)()
<
0
)
{
DEBUG
(
"Failed module registration %s"
,
regfunc
);
goto
cleanup
;
}
VIR_FREE
(
modfile
);
VIR_FREE
(
regfunc
);
return
handle
;
cleanup:
VIR_FREE
(
modfile
);
VIR_FREE
(
regfunc
);
if
(
handle
)
dlclose
(
handle
);
return
NULL
;
}
/* XXX unload modules, but we can't until we can unregister libvirt drivers */
#endif
src/driver.h
浏览文件 @
2c855c1c
...
...
@@ -8,6 +8,7 @@
#include <libxml/uri.h>
#include "internal.h"
/*
* List of registered drivers numbers
*/
...
...
@@ -645,5 +646,6 @@ int virRegisterStorageDriver(virStorageDriverPtr);
#ifdef WITH_LIBVIRTD
int
virRegisterStateDriver
(
virStateDriverPtr
);
#endif
void
*
virDriverLoadModule
(
const
char
*
name
);
#endif
/* __VIR_DRIVER_H__ */
src/libvirt.c
浏览文件 @
2c855c1c
...
...
@@ -41,6 +41,7 @@
#include "util.h"
#include "memory.h"
#ifndef WITH_DRIVER_MODULES
#ifdef WITH_TEST
#include "test.h"
#endif
...
...
@@ -53,6 +54,7 @@
#ifdef WITH_OPENVZ
#include "openvz_driver.h"
#endif
#endif
/*
* TODO:
...
...
@@ -270,17 +272,29 @@ virInitialize(void)
* Note that the order is important: the first ones have a higher
* priority when calling virConnectOpen.
*/
#ifdef WITH_DRIVER_MODULES
/* We don't care if any of these fail, because the whole point
* is to allow users to only install modules they want to use.
* If they try to use a open a connection for a module that
* is not loaded they'll get a suitable error at that point
*/
virDriverLoadModule
(
"test"
);
virDriverLoadModule
(
"xen"
);
virDriverLoadModule
(
"openvz"
);
virDriverLoadModule
(
"remote"
);
#else
#ifdef WITH_TEST
if
(
testRegister
()
==
-
1
)
return
-
1
;
#endif
#ifdef WITH_XEN
if
(
xen
Unified
Register
()
==
-
1
)
return
-
1
;
if
(
xenRegister
()
==
-
1
)
return
-
1
;
#endif
#ifdef WITH_OPENVZ
if
(
openvzRegister
()
==
-
1
)
return
-
1
;
#endif
#ifdef WITH_REMOTE
if
(
remoteRegister
()
==
-
1
)
return
-
1
;
#endif
#endif
return
(
0
);
...
...
@@ -458,6 +472,9 @@ virRegisterNetworkDriver(virNetworkDriverPtr driver)
return
(
-
1
);
}
DEBUG
(
"registering %s as network driver %d"
,
driver
->
name
,
virNetworkDriverTabCount
);
virNetworkDriverTab
[
virNetworkDriverTabCount
]
=
driver
;
return
virNetworkDriverTabCount
++
;
}
...
...
@@ -486,6 +503,9 @@ virRegisterStorageDriver(virStorageDriverPtr driver)
return
(
-
1
);
}
DEBUG
(
"registering %s as storage driver %d"
,
driver
->
name
,
virStorageDriverTabCount
);
virStorageDriverTab
[
virStorageDriverTabCount
]
=
driver
;
return
virStorageDriverTabCount
++
;
}
...
...
src/libvirt_sym.version.in
浏览文件 @
2c855c1c
...
...
@@ -283,8 +283,12 @@ LIBVIRT_PRIVATE_@VERSION@ {
virCapabilitiesAddGuest;
virCapabilitiesAddGuestDomain;
virCapabilitiesAddGuestFeature;
virCapabilitiesAddHostMigrateTransport;
virCapabilitiesAddHostNUMACell;
virCapabilitiesAddHostFeature;
virCapabilitiesDefaultGuestArch;
virCapabilitiesDefaultGuestEmulator;
virCapabilitiesDefaultGuestMachine;
virCapabilitiesFormatXML;
virCapabilitiesFree;
virCapabilitiesNew;
...
...
@@ -296,6 +300,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virConfReadFile;
virConfReadMem;
virConfFree;
virConfFreeValue;
virConfGetValue;
virConfSetValue;
virConfWriteFile;
...
...
@@ -307,6 +312,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virGetNetwork;
virGetStoragePool;
virGetStorageVol;
virUnrefDomain;
/* domain_conf.h */
...
...
@@ -314,25 +320,43 @@ LIBVIRT_PRIVATE_@VERSION@ {
virDiskNameToIndex;
virDomainAssignDef;
virDomainConfigFile;
virDomainCpuSetFormat;
virDomainCpuSetParse;
virDomainChrDefFree;
virDomainChrTypeFromString;
virDomainChrTypeToString;
virDomainDefDefaultEmulator;
virDomainDefFormat;
virDomainDefFree;
virDomainDefParseFile;
virDomainDefParseNode;
virDomainDefParseString;
virDomainDeleteConfig;
virDomainDeviceDefFree;
virDomainDeviceDefParse;
virDomainDiskBusTypeToString;
virDomainDiskDefFree;
virDomainDiskDeviceTypeToString;
virDomainDiskQSort;
virDomainFindByID;
virDomainFindByName;
virDomainFindByUUID;
virDomainGraphicsTypeFromString;
virDomainGraphicsDefFree;
virDomainInputDefFree;
virDomainLifecycleTypeFromString;
virDomainLifecycleTypeToString;
virDomainLoadAllConfigs;
virDomainNetDefFree;
virDomainObjFree;
virDomainObjListFree;
virDomainRemoveInactive;
virDomainSaveConfig;
virDomainSoundDefFree;
virDomainSoundModelTypeFromString;
virDomainSoundModelTypeToString;
virDomainVirtTypeToString;
virDomainFSDefFree;
/* domain_event.h */
...
...
@@ -340,6 +364,34 @@ LIBVIRT_PRIVATE_@VERSION@ {
virDomainEventCallbackListFree;
virDomainEventCallbackListRemove;
virDomainEventCallbackListRemoveConn;
virDomainEventQueueFree;
virDomainEventCallbackQueuePop;
virDomainEventCallbackQueuePush;
/* driver.h */
virDriverLoadModule;
/* event.h */
virEventAddHandle;
virEventAddTimeout;
virEventRemoveHandle;
virEventRemoveTimeout;
virEventUpdateHandle;
virEventUpdateTimeout;
/* hash.h */
virHashAddEntry;
virHashCreate;
virHashForEach;
virHashFree;
virHashLookup;
virHashRemoveEntry;
virHashRemoveSet;
virHashSearch;
virHashSize;
/* iptables.h */
...
...
@@ -397,12 +449,15 @@ LIBVIRT_PRIVATE_@VERSION@ {
virNetworkAssignDef;
virNetworkDefFormat;
virNetworkDefFree;
virNetworkDefParseFile;
virNetworkDefParseNode;
virNetworkDefParseString;
virNetworkDeleteConfig;
virNetworkFindByName;
virNetworkFindByUUID;
virNetworkLoadAllConfigs;
virNetworkObjListFree;
virNetworkDefParseNode;
virNetworkRemoveInactive;
virNetworkSaveConfig;
...
...
@@ -411,8 +466,15 @@ LIBVIRT_PRIVATE_@VERSION@ {
virNodeInfoPopulate;
/* qparams.h */
qparam_get_query;
qparam_query_parse;
free_qparam_set;
/* stats_linux.h */
linuxDomainInterfaceStats;
xenLinuxDomainBlockStats;
/* storage_backend.h */
...
...
@@ -429,6 +491,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
/* storage_conf.h */
virStorageBackendPoolOptionsForType;
virStoragePoolDefFormat;
virStoragePoolDefFree;
virStoragePoolDefParse;
...
...
@@ -461,6 +524,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virStrToLong_i;
virStrToLong_ll;
virStrToLong_ull;
virFileLinkPointsTo;
saferead;
safewrite;
virMacAddrCompare;
...
...
@@ -469,6 +533,8 @@ LIBVIRT_PRIVATE_@VERSION@ {
virEventAddHandle;
virEventRemoveHandle;
virExec;
virFormatMacAddr;
virParseMacAddr;
virFileDeletePid;
virFileExists;
virFileHasSuffix;
...
...
@@ -479,18 +545,26 @@ LIBVIRT_PRIVATE_@VERSION@ {
virFileReadPid;
virParseNumber;
virRun;
virSkipSpaces;
/* uuid.h */
virUUIDFormat;
virUUIDGenerate;
virUUIDParse;
/* virterror_internal.h */
virReportErrorHelper;
virErrorMsg;
virRaiseError;
/* xml.h */
virXPathLong;
virXPathNodeSet;
virXPathString;
virXMLPropString;
/* Finally everything else is totally private */
...
...
src/qemu_driver.c
浏览文件 @
2c855c1c
...
...
@@ -3804,7 +3804,7 @@ static virStateDriver qemuStateDriver = {
.
active
=
qemudActive
,
};
int
qemu
d
Register
(
void
)
{
int
qemuRegister
(
void
)
{
virRegisterDriver
(
&
qemuDriver
);
virRegisterStateDriver
(
&
qemuStateDriver
);
return
0
;
...
...
src/qemu_driver.h
浏览文件 @
2c855c1c
...
...
@@ -47,6 +47,6 @@
# define KVM_CAP_NR_VCPUS 9
/* returns max vcpus per vm */
#endif
int
qemu
d
Register
(
void
);
int
qemuRegister
(
void
);
#endif
/* QEMUD_DRIVER_H */
src/xen_unified.c
浏览文件 @
2c855c1c
...
...
@@ -1359,14 +1359,14 @@ static virDriver xenUnifiedDriver = {
};
/**
* xen
Unified
Register:
* xenRegister:
*
* Register xen related drivers
*
* Returns the driver priority or -1 in case of error.
*/
int
xen
Unified
Register
(
void
)
xenRegister
(
void
)
{
/* Ignore failures here. */
(
void
)
xenHypervisorInit
();
...
...
src/xen_unified.h
浏览文件 @
2c855c1c
...
...
@@ -22,7 +22,7 @@
#include <winsock2.h>
#endif
extern
int
xen
Unified
Register
(
void
);
extern
int
xenRegister
(
void
);
#define XEN_UNIFIED_HYPERVISOR_OFFSET 0
#define XEN_UNIFIED_PROXY_OFFSET 1
...
...
tests/Makefile.am
浏览文件 @
2c855c1c
...
...
@@ -19,6 +19,11 @@ INCLUDES = \
$(COVERAGE_CFLAGS)
\
$(WARN_CFLAGS)
if
WITH_DRIVER_MODULES
INCLUDES
+=
\
-DTEST_DRIVER_DIR
=
\"
$(top_builddir)
/src/.libs
\"
endif
LDADDS
=
\
@STATIC_BINARIES@
\
$(LIBXML_LIBS)
\
...
...
@@ -83,6 +88,7 @@ TESTS_ENVIRONMENT = \
abs_srcdir
=
`
cd
'
$(srcdir)
'
;
pwd
`
\
PATH
=
"
$(path_add)$(PATH_SEPARATOR)$$
PATH"
\
SHELL
=
"
$(SHELL)
"
\
LIBVIRT_DRIVER_DIR
=
"
$(abs_top_builddir)
/src/.libs"
\
$(VG)
valgrind
:
...
...
@@ -100,17 +106,17 @@ xmlrpctest_LDADD = $(LDADDS)
xml2sexprtest_SOURCES
=
\
xml2sexprtest.c testutilsxen.c testutilsxen.h
\
testutils.c testutils.h
xml2sexprtest_LDADD
=
$(LDADDS)
xml2sexprtest_LDADD
=
../src/libvirt_driver_xen.la
$(LDADDS)
sexpr2xmltest_SOURCES
=
\
sexpr2xmltest.c
\
testutils.c testutils.h
sexpr2xmltest_LDADD
=
$(LDADDS)
sexpr2xmltest_LDADD
=
../src/libvirt_driver_xen.la
$(LDADDS)
xmconfigtest_SOURCES
=
\
xmconfigtest.c testutilsxen.c testutilsxen.h
\
testutils.c testutils.h
xmconfigtest_LDADD
=
$(LDADDS)
xmconfigtest_LDADD
=
../src/libvirt_driver_xen.la
$(LDADDS)
if
WITH_QEMU
qemuxml2argvtest_SOURCES
=
\
...
...
@@ -137,7 +143,7 @@ conftest_LDADD = $(LDADDS)
xencapstest_SOURCES
=
\
xencapstest.c testutils.h testutils.c
xencapstest_LDADD
=
$(LDADDS)
xencapstest_LDADD
=
../src/libvirt_driver_xen.la
$(LDADDS)
nodeinfotest_SOURCES
=
\
nodeinfotest.c testutils.h testutils.c
...
...
tests/testutils.c
浏览文件 @
2c855c1c
...
...
@@ -151,6 +151,9 @@ void virtTestCaptureProgramExecChild(const char *const argv[],
int
stderrfd
=
-
1
;
const
char
*
const
env
[]
=
{
"LANG=C"
,
#if WITH_DRIVER_MODULES
"LIBVIRT_DRIVER_DIR="
TEST_DRIVER_DIR
,
#endif
NULL
};
...
...
tests/xmconfigtest.c
浏览文件 @
2c855c1c
...
...
@@ -55,13 +55,11 @@ static int testCompareParseXML(const char *xmcfg, const char *xml,
int
ret
=
-
1
;
virConnectPtr
conn
;
int
wrote
=
MAX_FILE
;
void
*
old_priv
=
NULL
;
struct
_xenUnifiedPrivate
priv
;
virDomainDefPtr
def
=
NULL
;
conn
=
vir
ConnectOpenReadOnly
(
"test:///default"
);
conn
=
vir
GetConnect
(
);
if
(
!
conn
)
goto
fail
;
old_priv
=
conn
->
privateData
;
if
(
virtTestLoadFile
(
xml
,
&
xmlPtr
,
MAX_FILE
)
<
0
)
goto
fail
;
...
...
@@ -95,10 +93,7 @@ static int testCompareParseXML(const char *xmcfg, const char *xml,
if
(
conf
)
virConfFree
(
conf
);
virDomainDefFree
(
def
);
if
(
conn
)
{
conn
->
privateData
=
old_priv
;
virConnectClose
(
conn
);
}
virUnrefConnect
(
conn
);
return
ret
;
}
...
...
@@ -113,13 +108,11 @@ static int testCompareFormatXML(const char *xmcfg, const char *xml,
virConfPtr
conf
=
NULL
;
int
ret
=
-
1
;
virConnectPtr
conn
;
void
*
old_priv
;
struct
_xenUnifiedPrivate
priv
;
virDomainDefPtr
def
=
NULL
;
conn
=
vir
ConnectOpenReadOnly
(
"test:///default"
);
conn
=
vir
GetConnect
(
);
if
(
!
conn
)
goto
fail
;
old_priv
=
conn
->
privateData
;
if
(
virtTestLoadFile
(
xml
,
&
xmlPtr
,
MAX_FILE
)
<
0
)
goto
fail
;
...
...
@@ -153,10 +146,7 @@ static int testCompareFormatXML(const char *xmcfg, const char *xml,
virConfFree
(
conf
);
VIR_FREE
(
gotxml
);
virDomainDefFree
(
def
);
if
(
conn
)
{
conn
->
privateData
=
old_priv
;
virConnectClose
(
conn
);
}
virUnrefConnect
(
conn
);
return
ret
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录