Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
9c487f65
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看板
提交
9c487f65
编写于
3月 18, 2014
作者:
M
Martin Kletzander
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use K&R style for curly braces in src/conf/
Signed-off-by:
N
Martin Kletzander
<
mkletzan@redhat.com
>
上级
7fa91525
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
73 addition
and
36 deletion
+73
-36
src/conf/domain_conf.c
src/conf/domain_conf.c
+6
-3
src/conf/domain_nwfilter.c
src/conf/domain_nwfilter.c
+9
-4
src/conf/interface_conf.c
src/conf/interface_conf.c
+36
-18
src/conf/nwfilter_conf.c
src/conf/nwfilter_conf.c
+20
-10
src/conf/nwfilter_params.c
src/conf/nwfilter_params.c
+2
-1
未找到文件。
src/conf/domain_conf.c
浏览文件 @
9c487f65
...
...
@@ -6193,7 +6193,8 @@ virDomainNetGenerateMAC(virDomainXMLOptionPtr xmlopt,
static virDomainFSDefPtr
virDomainFSDefParseXML(xmlNodePtr node,
xmlXPathContextPtr ctxt,
unsigned int flags) {
unsigned int flags)
{
virDomainFSDefPtr def;
xmlNodePtr cur, save_node = ctxt->node;
char *type = NULL;
...
...
@@ -7013,7 +7014,8 @@ error:
}
static int
virDomainChrDefaultTargetType(int devtype) {
virDomainChrDefaultTargetType(int devtype)
{
switch ((enum virDomainChrDeviceType) devtype) {
case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL:
virReportError(VIR_ERR_XML_ERROR,
...
...
@@ -7419,7 +7421,8 @@ error:
* default port.
*/
virDomainChrDefPtr
virDomainChrDefNew(void) {
virDomainChrDefNew(void)
{
virDomainChrDefPtr def = NULL;
if (VIR_ALLOC(def) < 0)
...
...
src/conf/domain_nwfilter.c
浏览文件 @
9c487f65
/*
* domain_nwfilter.c:
*
* Copyright (C) 2014 Red Hat, Inc.
* Copyright (C) 2010 IBM Corporation
*
* This library is free software; you can redistribute it and/or
...
...
@@ -31,14 +32,16 @@
static
virDomainConfNWFilterDriverPtr
nwfilterDriver
;
void
virDomainConfNWFilterRegister
(
virDomainConfNWFilterDriverPtr
driver
)
{
virDomainConfNWFilterRegister
(
virDomainConfNWFilterDriverPtr
driver
)
{
nwfilterDriver
=
driver
;
}
int
virDomainConfNWFilterInstantiate
(
virConnectPtr
conn
,
const
unsigned
char
*
vmuuid
,
virDomainNetDefPtr
net
)
{
virDomainNetDefPtr
net
)
{
if
(
nwfilterDriver
!=
NULL
)
return
nwfilterDriver
->
instantiateFilter
(
conn
,
vmuuid
,
net
);
/* driver module not available -- don't indicate failure */
...
...
@@ -46,13 +49,15 @@ virDomainConfNWFilterInstantiate(virConnectPtr conn,
}
void
virDomainConfNWFilterTeardown
(
virDomainNetDefPtr
net
)
{
virDomainConfNWFilterTeardown
(
virDomainNetDefPtr
net
)
{
if
(
nwfilterDriver
!=
NULL
)
nwfilterDriver
->
teardownFilter
(
net
);
}
void
virDomainConfVMNWFilterTeardown
(
virDomainObjPtr
vm
)
{
virDomainConfVMNWFilterTeardown
(
virDomainObjPtr
vm
)
{
size_t
i
;
if
(
nwfilterDriver
!=
NULL
)
{
...
...
src/conf/interface_conf.c
浏览文件 @
9c487f65
...
...
@@ -44,7 +44,8 @@ static int
virInterfaceDefDevFormat
(
virBufferPtr
buf
,
const
virInterfaceDef
*
def
);
static
void
virInterfaceIpDefFree
(
virInterfaceIpDefPtr
def
)
{
void
virInterfaceIpDefFree
(
virInterfaceIpDefPtr
def
)
{
if
(
def
==
NULL
)
return
;
VIR_FREE
(
def
->
address
);
...
...
@@ -52,7 +53,8 @@ void virInterfaceIpDefFree(virInterfaceIpDefPtr def) {
}
static
void
virInterfaceProtocolDefFree
(
virInterfaceProtocolDefPtr
def
)
{
void
virInterfaceProtocolDefFree
(
virInterfaceProtocolDefPtr
def
)
{
size_t
i
;
if
(
def
==
NULL
)
...
...
@@ -112,7 +114,8 @@ void virInterfaceDefFree(virInterfaceDefPtr def)
static
int
virInterfaceDefParseName
(
virInterfaceDefPtr
def
,
xmlXPathContextPtr
ctxt
)
{
xmlXPathContextPtr
ctxt
)
{
char
*
tmp
;
tmp
=
virXPathString
(
"string(./@name)"
,
ctxt
);
...
...
@@ -127,7 +130,8 @@ virInterfaceDefParseName(virInterfaceDefPtr def,
static
int
virInterfaceDefParseMtu
(
virInterfaceDefPtr
def
,
xmlXPathContextPtr
ctxt
)
{
xmlXPathContextPtr
ctxt
)
{
unsigned
long
mtu
;
int
ret
;
...
...
@@ -144,7 +148,8 @@ virInterfaceDefParseMtu(virInterfaceDefPtr def,
static
int
virInterfaceDefParseStartMode
(
virInterfaceDefPtr
def
,
xmlXPathContextPtr
ctxt
)
{
xmlXPathContextPtr
ctxt
)
{
char
*
tmp
;
tmp
=
virXPathString
(
"string(./start/@mode)"
,
ctxt
);
...
...
@@ -167,7 +172,8 @@ virInterfaceDefParseStartMode(virInterfaceDefPtr def,
}
static
int
virInterfaceDefParseBondMode
(
xmlXPathContextPtr
ctxt
)
{
virInterfaceDefParseBondMode
(
xmlXPathContextPtr
ctxt
)
{
char
*
tmp
;
int
ret
=
0
;
...
...
@@ -198,7 +204,8 @@ virInterfaceDefParseBondMode(xmlXPathContextPtr ctxt) {
}
static
int
virInterfaceDefParseBondMiiCarrier
(
xmlXPathContextPtr
ctxt
)
{
virInterfaceDefParseBondMiiCarrier
(
xmlXPathContextPtr
ctxt
)
{
char
*
tmp
;
int
ret
=
0
;
...
...
@@ -219,7 +226,8 @@ virInterfaceDefParseBondMiiCarrier(xmlXPathContextPtr ctxt) {
}
static
int
virInterfaceDefParseBondArpValid
(
xmlXPathContextPtr
ctxt
)
{
virInterfaceDefParseBondArpValid
(
xmlXPathContextPtr
ctxt
)
{
char
*
tmp
;
int
ret
=
0
;
...
...
@@ -243,7 +251,8 @@ virInterfaceDefParseBondArpValid(xmlXPathContextPtr ctxt) {
static
int
virInterfaceDefParseDhcp
(
virInterfaceProtocolDefPtr
def
,
xmlNodePtr
dhcp
,
xmlXPathContextPtr
ctxt
)
{
xmlNodePtr
dhcp
,
xmlXPathContextPtr
ctxt
)
{
xmlNodePtr
save
;
char
*
tmp
;
int
ret
=
0
;
...
...
@@ -273,7 +282,8 @@ virInterfaceDefParseDhcp(virInterfaceProtocolDefPtr def,
static
int
virInterfaceDefParseIp
(
virInterfaceIpDefPtr
def
,
xmlXPathContextPtr
ctxt
)
{
xmlXPathContextPtr
ctxt
)
{
int
ret
=
0
;
char
*
tmp
;
long
l
;
...
...
@@ -296,7 +306,8 @@ virInterfaceDefParseIp(virInterfaceIpDefPtr def,
static
int
virInterfaceDefParseProtoIPv4
(
virInterfaceProtocolDefPtr
def
,
xmlXPathContextPtr
ctxt
)
{
xmlXPathContextPtr
ctxt
)
{
xmlNodePtr
dhcp
;
xmlNodePtr
*
ipNodes
=
NULL
;
int
nIpNodes
,
ret
=
-
1
;
...
...
@@ -346,7 +357,8 @@ error:
static
int
virInterfaceDefParseProtoIPv6
(
virInterfaceProtocolDefPtr
def
,
xmlXPathContextPtr
ctxt
)
{
xmlXPathContextPtr
ctxt
)
{
xmlNodePtr
dhcp
,
autoconf
;
xmlNodePtr
*
ipNodes
=
NULL
;
int
nIpNodes
,
ret
=
-
1
;
...
...
@@ -400,7 +412,8 @@ error:
static
int
virInterfaceDefParseIfAdressing
(
virInterfaceDefPtr
def
,
xmlXPathContextPtr
ctxt
)
{
xmlXPathContextPtr
ctxt
)
{
xmlNodePtr
save
;
xmlNodePtr
*
protoNodes
=
NULL
;
int
nProtoNodes
,
pp
,
ret
=
-
1
;
...
...
@@ -469,7 +482,8 @@ error:
static
int
virInterfaceDefParseBridge
(
virInterfaceDefPtr
def
,
xmlXPathContextPtr
ctxt
)
{
xmlXPathContextPtr
ctxt
)
{
xmlNodePtr
*
interfaces
=
NULL
;
xmlNodePtr
bridge
;
virInterfaceDefPtr
itf
;
...
...
@@ -510,7 +524,8 @@ error:
static
int
virInterfaceDefParseBondItfs
(
virInterfaceDefPtr
def
,
xmlXPathContextPtr
ctxt
)
{
xmlXPathContextPtr
ctxt
)
{
xmlNodePtr
*
interfaces
=
NULL
;
xmlNodePtr
bond
=
ctxt
->
node
;
virInterfaceDefPtr
itf
;
...
...
@@ -556,7 +571,8 @@ error:
static
int
virInterfaceDefParseBond
(
virInterfaceDefPtr
def
,
xmlXPathContextPtr
ctxt
)
{
xmlXPathContextPtr
ctxt
)
{
int
res
;
def
->
data
.
bond
.
mode
=
virInterfaceDefParseBondMode
(
ctxt
);
...
...
@@ -627,7 +643,8 @@ virInterfaceDefParseBond(virInterfaceDefPtr def,
static
int
virInterfaceDefParseVlan
(
virInterfaceDefPtr
def
,
xmlXPathContextPtr
ctxt
)
{
xmlXPathContextPtr
ctxt
)
{
def
->
data
.
vlan
.
tag
=
virXPathString
(
"string(./@tag)"
,
ctxt
);
if
(
def
->
data
.
vlan
.
tag
==
NULL
)
{
virReportError
(
VIR_ERR_XML_ERROR
,
...
...
@@ -646,7 +663,8 @@ virInterfaceDefParseVlan(virInterfaceDefPtr def,
}
static
virInterfaceDefPtr
virInterfaceDefParseXML
(
xmlXPathContextPtr
ctxt
,
int
parentIfType
)
{
virInterfaceDefParseXML
(
xmlXPathContextPtr
ctxt
,
int
parentIfType
)
{
virInterfaceDefPtr
def
;
int
type
;
char
*
tmp
;
...
...
src/conf/nwfilter_conf.c
浏览文件 @
9c487f65
...
...
@@ -147,17 +147,20 @@ static virRWLock updateLock;
static
bool
initialized
=
false
;
void
virNWFilterReadLockFilterUpdates
(
void
)
{
virNWFilterReadLockFilterUpdates
(
void
)
{
virRWLockRead
(
&
updateLock
);
}
void
virNWFilterWriteLockFilterUpdates
(
void
)
{
virNWFilterWriteLockFilterUpdates
(
void
)
{
virRWLockWrite
(
&
updateLock
);
}
void
virNWFilterUnlockFilterUpdates
(
void
)
{
virNWFilterUnlockFilterUpdates
(
void
)
{
virRWLockUnlock
(
&
updateLock
);
}
...
...
@@ -280,7 +283,8 @@ intMapGetByString(const struct int_map *intmap, const char *str, int casecmp,
void
virNWFilterRuleDefFree
(
virNWFilterRuleDefPtr
def
)
{
virNWFilterRuleDefFree
(
virNWFilterRuleDefPtr
def
)
{
size_t
i
;
if
(
!
def
)
return
;
...
...
@@ -299,7 +303,8 @@ virNWFilterRuleDefFree(virNWFilterRuleDefPtr def) {
static
void
virNWFilterIncludeDefFree
(
virNWFilterIncludeDefPtr
inc
)
{
virNWFilterIncludeDefFree
(
virNWFilterIncludeDefPtr
inc
)
{
if
(
!
inc
)
return
;
virNWFilterHashTableFree
(
inc
->
params
);
...
...
@@ -309,7 +314,8 @@ virNWFilterIncludeDefFree(virNWFilterIncludeDefPtr inc) {
static
void
virNWFilterEntryFree
(
virNWFilterEntryPtr
entry
)
{
virNWFilterEntryFree
(
virNWFilterEntryPtr
entry
)
{
if
(
!
entry
)
return
;
...
...
@@ -320,7 +326,8 @@ virNWFilterEntryFree(virNWFilterEntryPtr entry) {
void
virNWFilterDefFree
(
virNWFilterDefPtr
def
)
{
virNWFilterDefFree
(
virNWFilterDefPtr
def
)
{
size_t
i
;
if
(
!
def
)
return
;
...
...
@@ -2493,7 +2500,8 @@ err_exit:
}
static
virNWFilterDefPtr
virNWFilterDefParseXML
(
xmlXPathContextPtr
ctxt
)
{
virNWFilterDefParseXML
(
xmlXPathContextPtr
ctxt
)
{
virNWFilterDefPtr
ret
;
xmlNodePtr
curr
=
ctxt
->
node
;
char
*
uuid
=
NULL
;
...
...
@@ -2622,7 +2630,8 @@ virNWFilterDefParseXML(xmlXPathContextPtr ctxt) {
virNWFilterDefPtr
virNWFilterDefParseNode
(
xmlDocPtr
xml
,
xmlNodePtr
root
)
{
xmlNodePtr
root
)
{
xmlXPathContextPtr
ctxt
=
NULL
;
virNWFilterDefPtr
def
=
NULL
;
...
...
@@ -2650,7 +2659,8 @@ cleanup:
static
virNWFilterDefPtr
virNWFilterDefParse
(
const
char
*
xmlStr
,
const
char
*
filename
)
{
const
char
*
filename
)
{
virNWFilterDefPtr
def
=
NULL
;
xmlDocPtr
xml
;
...
...
src/conf/nwfilter_params.c
浏览文件 @
9c487f65
...
...
@@ -684,7 +684,8 @@ virNWFilterHashTableFree(virNWFilterHashTablePtr table)
virNWFilterHashTablePtr
virNWFilterHashTableCreate
(
int
n
)
{
virNWFilterHashTableCreate
(
int
n
)
{
virNWFilterHashTablePtr
ret
;
if
(
VIR_ALLOC
(
ret
)
<
0
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录