Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
07129039
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看板
提交
07129039
编写于
2月 21, 2011
作者:
M
Markus Groß
提交者:
Eric Blake
2月 21, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Moved SEXPR parsing functions to xenxs
上级
c71328b9
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
1514 addition
and
1326 deletion
+1514
-1326
po/POTFILES.in
po/POTFILES.in
+1
-0
src/Makefile.am
src/Makefile.am
+15
-1
src/xen/xen_driver.c
src/xen/xen_driver.c
+11
-1
src/xen/xend_internal.c
src/xen/xend_internal.c
+24
-1305
src/xen/xend_internal.h
src/xen/xend_internal.h
+0
-18
src/xen/xm_internal.c
src/xen/xm_internal.c
+1
-0
src/xenxs/xen_sxpr.c
src/xenxs/xen_sxpr.c
+1351
-0
src/xenxs/xen_sxpr.h
src/xenxs/xen_sxpr.h
+62
-0
src/xenxs/xenxs_private.h
src/xenxs/xenxs_private.h
+37
-0
tests/sexpr2xmltest.c
tests/sexpr2xmltest.c
+12
-1
未找到文件。
po/POTFILES.in
浏览文件 @
07129039
...
...
@@ -119,6 +119,7 @@ src/xen/xm_internal.c
src/xen/xs_internal.c
src/xenapi/xenapi_driver.c
src/xenapi/xenapi_utils.c
src/xenxs/xen_sxpr.c
tools/console.c
tools/libvirt-guests.init.sh
tools/virsh.c
src/Makefile.am
浏览文件 @
07129039
...
...
@@ -423,6 +423,10 @@ CPU_SOURCES = \
VMX_SOURCES
=
\
vmx/vmx.c vmx/vmx.h
XENXS_SOURCES
=
\
xenxs/xenxs_private.h
\
xenxs/xen_sxpr.c xenxs/xen_sxpr.h
pkgdata_DATA
=
cpu/cpu_map.xml
EXTRA_DIST
+=
$(pkgdata_DATA)
...
...
@@ -464,6 +468,14 @@ libvirt_vmx_la_CFLAGS = \
libvirt_vmx_la_SOURCES
=
$(VMX_SOURCES)
endif
if
WITH_XEN
noinst_LTLIBRARIES
+=
libvirt_xenxs.la
libvirt_la_BUILT_LIBADD
+=
libvirt_xenxs.la
libvirt_xenxs_la_CFLAGS
=
\
-I
@top_srcdir@/src/conf
$(AM_CFLAGS)
libvirt_xenxs_la_SOURCES
=
$(XENXS_SOURCES)
endif
noinst_LTLIBRARIES
+=
libvirt_driver.la
libvirt_la_BUILT_LIBADD
+=
libvirt_driver.la
...
...
@@ -583,6 +595,7 @@ endif
libvirt_driver_xen_la_CFLAGS
=
\
$(XEN_CFLAGS)
\
-I
@top_srcdir@/src/conf
\
-I
@top_srcdir@/src/xenxs
\
$(AM_CFLAGS)
libvirt_driver_xen_la_LDFLAGS
=
$(AM_LDFLAGS)
libvirt_driver_xen_la_LIBADD
=
$(XEN_LIBS)
...
...
@@ -995,7 +1008,8 @@ EXTRA_DIST += \
$(SECURITY_DRIVER_APPARMOR_SOURCES)
\
$(SECRET_DRIVER_SOURCES)
\
$(VBOX_DRIVER_EXTRA_DIST)
\
$(VMWARE_DRIVER_SOURCES)
$(VMWARE_DRIVER_SOURCES)
\
$(XENXS_SOURCES)
check-local
:
augeas-check
...
...
src/xen/xen_driver.c
浏览文件 @
07129039
...
...
@@ -33,6 +33,7 @@
#include "datatypes.h"
#include "xen_driver.h"
#include "xen_sxpr.h"
#include "xen_hypervisor.h"
#include "xend_internal.h"
#include "xs_internal.h"
...
...
@@ -1198,6 +1199,9 @@ xenUnifiedDomainXMLFromNative(virConnectPtr conn,
virDomainDefPtr
def
=
NULL
;
char
*
ret
=
NULL
;
virConfPtr
conf
=
NULL
;
int
id
;
char
*
tty
;
int
vncport
;
GET_PRIVATE
(
conn
);
if
(
STRNEQ
(
format
,
XEN_CONFIG_FORMAT_XM
)
&&
...
...
@@ -1214,7 +1218,13 @@ xenUnifiedDomainXMLFromNative(virConnectPtr conn,
def
=
xenXMDomainConfigParse
(
conn
,
conf
);
}
else
if
(
STREQ
(
format
,
XEN_CONFIG_FORMAT_SEXPR
))
{
def
=
xenDaemonParseSxprString
(
conn
,
config
,
priv
->
xendConfigVersion
);
id
=
xenGetDomIdFromSxprString
(
config
,
priv
->
xendConfigVersion
);
xenUnifiedLock
(
priv
);
tty
=
xenStoreDomainGetConsolePath
(
conn
,
id
);
vncport
=
xenStoreDomainGetVNCPort
(
conn
,
id
);
xenUnifiedUnlock
(
priv
);
def
=
xenDaemonParseSxprString
(
config
,
priv
->
xendConfigVersion
,
tty
,
vncport
);
}
if
(
!
def
)
goto
cleanup
;
...
...
src/xen/xend_internal.c
浏览文件 @
07129039
此差异已折叠。
点击以展开。
src/xen/xend_internal.h
浏览文件 @
07129039
...
...
@@ -27,12 +27,6 @@
# include "driver.h"
# include "buf.h"
# ifdef __sun
# define DEFAULT_VIF_SCRIPT "vif-vnic"
# else
# define DEFAULT_VIF_SCRIPT "vif-bridge"
# endif
int
xenDaemonOpen_unix
(
virConnectPtr
conn
,
const
char
*
path
);
...
...
@@ -96,18 +90,6 @@ xenDaemonDomainFetch(virConnectPtr xend,
const
char
*
name
,
const
char
*
cpus
);
virDomainDefPtr
xenDaemonParseSxprString
(
virConnectPtr
conn
,
const
char
*
sexpr
,
int
xendConfigVersion
);
int
xenDaemonParseSxprSound
(
virDomainDefPtr
def
,
const
char
*
str
);
virDomainChrDefPtr
xenDaemonParseSxprChar
(
const
char
*
value
,
const
char
*
tty
);
int
xenDaemonFormatSxprChr
(
virDomainChrDefPtr
def
,
...
...
src/xen/xm_internal.c
浏览文件 @
07129039
...
...
@@ -40,6 +40,7 @@
#include "xm_internal.h"
#include "xen_driver.h"
#include "xend_internal.h"
#include "xen_sxpr.h"
#include "hash.h"
#include "buf.h"
#include "uuid.h"
...
...
src/xenxs/xen_sxpr.c
0 → 100644
浏览文件 @
07129039
此差异已折叠。
点击以展开。
src/xenxs/xen_sxpr.h
0 → 100644
浏览文件 @
07129039
/*
* xen_sxpr.h: Xen SEXPR parsing functions
*
* Copyright (C) 2011 Univention GmbH
* Copyright (C) 2006-2008, 2010 Red Hat, Inc.
* Copyright (C) 2005,2006
*
* 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
*
* Author: Anthony Liguori <aliguori@us.ibm.com>
* Author: Daniel Veillard <veillard@redhat.com>
* Author: Markus Groß <gross@univention.de>
*/
#ifndef __VIR_XEN_SXPR_H__
# define __VIR_XEN_SXPR_H__
# include "internal.h"
# include "conf.h"
# include "domain_conf.h"
# include "sexpr.h"
# ifdef __sun
# define DEFAULT_VIF_SCRIPT "vif-vnic"
# else
# define DEFAULT_VIF_SCRIPT "vif-bridge"
# endif
/* helper functions to get the dom id from a sexpr */
int
xenGetDomIdFromSxprString
(
const
char
*
sexpr
,
int
xendConfigVersion
);
int
xenGetDomIdFromSxpr
(
const
struct
sexpr
*
root
,
int
xendConfigVersion
);
virDomainDefPtr
xenDaemonParseSxprString
(
const
char
*
sexpr
,
int
xendConfigVersion
,
char
*
tty
,
int
vncport
);
virDomainDefPtr
xenDaemonParseSxpr
(
const
struct
sexpr
*
root
,
int
xendConfigVersion
,
const
char
*
cpus
,
char
*
tty
,
int
vncport
);
int
xenDaemonParseSxprSound
(
virDomainDefPtr
def
,
const
char
*
str
);
virDomainChrDefPtr
xenDaemonParseSxprChar
(
const
char
*
value
,
const
char
*
tty
);
#endif
/* __VIR_XEN_SXPR_H__ */
src/xenxs/xenxs_private.h
0 → 100644
浏览文件 @
07129039
/*
* xenxs_private.h: Private definitions for Xen parsing
*
* Copyright (C) 2011 Univention GmbH
* Copyright (C) 2007, 2010 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
*
* Author: Richard W.M. Jones <rjones@redhat.com>
* Author: Markus Groß <gross@univention.de>
*/
#ifndef __VIR_XENXS_PRIVATE_H__
# define __VIR_XENXS_PRIVATE_H__
# include "internal.h"
# define VIR_FROM_THIS VIR_FROM_NONE
# define XENXS_ERROR(code, ...) \
virReportErrorHelper(NULL, VIR_FROM_NONE, code, __FILE__, __FUNCTION__, \
__LINE__, __VA_ARGS__)
#endif
/* __VIR_XENXS_PRIVATE_H__ */
tests/sexpr2xmltest.c
浏览文件 @
07129039
...
...
@@ -9,6 +9,7 @@
#include "datatypes.h"
#include "xen/xen_driver.h"
#include "xen/xend_internal.h"
#include "xenxs/xen_sxpr.h"
#include "testutils.h"
#include "testutilsxen.h"
...
...
@@ -25,6 +26,9 @@ static int testCompareFiles(const char *xml, const char *sexpr,
char
*
gotxml
=
NULL
;
char
*
xmlPtr
=
&
(
xmlData
[
0
]);
char
*
sexprPtr
=
&
(
sexprData
[
0
]);
int
id
;
char
*
tty
;
int
vncport
;
int
ret
=
-
1
;
virDomainDefPtr
def
=
NULL
;
virConnectPtr
conn
;
...
...
@@ -48,7 +52,14 @@ static int testCompareFiles(const char *xml, const char *sexpr,
if
(
virMutexInit
(
&
priv
.
lock
)
<
0
)
goto
fail
;
if
(
!
(
def
=
xenDaemonParseSxprString
(
conn
,
sexprData
,
xendConfigVersion
)))
id
=
xenGetDomIdFromSxprString
(
sexprData
,
xendConfigVersion
);
xenUnifiedLock
(
&
priv
);
tty
=
xenStoreDomainGetConsolePath
(
conn
,
id
);
vncport
=
xenStoreDomainGetVNCPort
(
conn
,
id
);
xenUnifiedUnlock
(
&
priv
);
if
(
!
(
def
=
xenDaemonParseSxprString
(
sexprData
,
xendConfigVersion
,
tty
,
vncport
)))
goto
fail
;
if
(
!
(
gotxml
=
virDomainDefFormat
(
def
,
0
)))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录