Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
4fab1209
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看板
提交
4fab1209
编写于
11月 13, 2014
作者:
M
Martin Kletzander
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unnecessary curly brackets in rest of src/
Signed-off-by:
N
Martin Kletzander
<
mkletzan@redhat.com
>
上级
8c38594b
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
27 addition
and
54 deletion
+27
-54
src/vmware/vmware_conf.c
src/vmware/vmware_conf.c
+1
-2
src/vmware/vmware_driver.c
src/vmware/vmware_driver.c
+2
-4
src/xen/block_stats.c
src/xen/block_stats.c
+1
-2
src/xen/xen_driver.c
src/xen/xen_driver.c
+2
-4
src/xen/xen_hypervisor.c
src/xen/xen_hypervisor.c
+2
-4
src/xen/xend_internal.c
src/xen/xend_internal.c
+6
-12
src/xen/xm_internal.c
src/xen/xm_internal.c
+2
-4
src/xenapi/xenapi_driver.c
src/xenapi/xenapi_driver.c
+4
-8
src/xenapi/xenapi_utils.c
src/xenapi/xenapi_utils.c
+3
-6
src/xenconfig/xen_common.c
src/xenconfig/xen_common.c
+2
-4
src/xenconfig/xen_sxpr.c
src/xenconfig/xen_sxpr.c
+2
-4
未找到文件。
src/vmware/vmware_conf.c
浏览文件 @
4fab1209
...
...
@@ -432,9 +432,8 @@ vmwareVmxPath(virDomainDefPtr vmdef, char **vmxPath)
goto
cleanup
;
}
if
(
vmwareParsePath
(
src
,
&
directoryName
,
&
fileName
)
<
0
)
{
if
(
vmwareParsePath
(
src
,
&
directoryName
,
&
fileName
)
<
0
)
goto
cleanup
;
}
if
(
!
virFileHasSuffix
(
fileName
,
".vmdk"
))
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
...
...
src/vmware/vmware_driver.c
浏览文件 @
4fab1209
...
...
@@ -313,9 +313,8 @@ vmwareStopVM(struct vmware_driver *driver,
vmwareSetSentinal
(
cmd
,
vmwareDriverTypeToString
(
driver
->
type
));
vmwareSetSentinal
(
cmd
,
((
vmwareDomainPtr
)
vm
->
privateData
)
->
vmxPath
);
if
(
virRun
(
cmd
,
NULL
)
<
0
)
{
if
(
virRun
(
cmd
,
NULL
)
<
0
)
return
-
1
;
}
vm
->
def
->
id
=
-
1
;
virDomainObjSetState
(
vm
,
VIR_DOMAIN_SHUTOFF
,
reason
);
...
...
@@ -345,9 +344,8 @@ vmwareStartVM(struct vmware_driver *driver, virDomainObjPtr vm)
else
vmwareSetSentinal
(
cmd
,
NULL
);
if
(
virRun
(
cmd
,
NULL
)
<
0
)
{
if
(
virRun
(
cmd
,
NULL
)
<
0
)
return
-
1
;
}
if
((
vm
->
def
->
id
=
vmwareExtractPid
(
vmxPath
))
<
0
)
{
vmwareStopVM
(
driver
,
vm
,
VIR_DOMAIN_SHUTOFF_FAILED
);
...
...
src/xen/block_stats.c
浏览文件 @
4fab1209
...
...
@@ -107,9 +107,8 @@ read_bd_stat(int device, int domid, const char *str)
VIR_FREE
(
path
);
if
(
r
>=
0
)
{
if
(
r
>=
0
)
return
r
;
}
}
return
-
1
;
...
...
src/xen/xen_driver.c
浏览文件 @
4fab1209
...
...
@@ -2550,15 +2550,13 @@ xenUnifiedNodeDeviceAssignedDomainId(virNodeDevicePtr dev)
/* Get active domains */
numdomains
=
xenUnifiedConnectNumOfDomains
(
conn
);
if
(
numdomains
<
0
)
{
if
(
numdomains
<
0
)
return
ret
;
}
if
(
numdomains
>
0
)
{
if
(
VIR_ALLOC_N
(
ids
,
numdomains
)
<
0
)
goto
out
;
if
((
numdomains
=
xenUnifiedConnectListDomains
(
conn
,
&
ids
[
0
],
numdomains
))
<
0
)
{
if
((
numdomains
=
xenUnifiedConnectListDomains
(
conn
,
&
ids
[
0
],
numdomains
))
<
0
)
goto
out
;
}
}
/* Get pci bdf */
...
...
src/xen/xen_hypervisor.c
浏览文件 @
4fab1209
...
...
@@ -2258,9 +2258,8 @@ get_cpu_flags(virConnectPtr conn, const char **hvm, int *pae, int *longmode)
if
(
STREQLEN
((
const
char
*
)
&
regs
.
r_ebx
,
"AuthcAMDenti"
,
12
))
{
if
(
pread
(
fd
,
&
regs
,
sizeof
(
regs
),
0x80000001
)
==
sizeof
(
regs
))
{
/* Read secure virtual machine bit (bit 2 of ECX feature ID) */
if
((
regs
.
r_ecx
>>
2
)
&
1
)
{
if
((
regs
.
r_ecx
>>
2
)
&
1
)
*
hvm
=
"svm"
;
}
if
((
regs
.
r_edx
>>
6
)
&
1
)
*
pae
=
1
;
}
...
...
@@ -2935,9 +2934,8 @@ xenHypervisorNodeGetCellsFreeMemory(virConnectPtr conn,
else
op_sys
.
u
.
availheap
.
node
=
cell
;
ret
=
xenHypervisorDoV2Sys
(
priv
->
handle
,
&
op_sys
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
return
-
1
;
}
if
(
hv_versions
.
sys_interface
>=
5
)
freeMems
[
i
]
=
op_sys
.
u
.
availheap5
.
avail_bytes
;
else
...
...
src/xen/xend_internal.c
浏览文件 @
4fab1209
...
...
@@ -147,14 +147,12 @@ wr_sync(int fd, void *buffer, size_t size, int do_read)
}
/* recoverable error, retry */
if
((
len
==
-
1
)
&&
((
errno
==
EAGAIN
)
||
(
errno
==
EINTR
)))
{
if
((
len
==
-
1
)
&&
((
errno
==
EAGAIN
)
||
(
errno
==
EINTR
)))
continue
;
}
/* eof */
if
(
len
==
0
)
{
if
(
len
==
0
)
break
;
}
/* unrecoverable error */
if
(
len
==
-
1
)
{
...
...
@@ -1759,9 +1757,8 @@ xenDaemonNodeGetTopology(virConnectPtr conn, virCapsPtr caps)
struct
sexpr
*
root
;
root
=
sexpr_get
(
conn
,
"/xend/node/"
);
if
(
root
==
NULL
)
{
if
(
root
==
NULL
)
return
-
1
;
}
ret
=
sexpr_to_xend_topology
(
root
,
caps
);
sexpr_free
(
root
);
...
...
@@ -2078,9 +2075,8 @@ xenDaemonLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
names
=
xenDaemonListDomainsOld
(
conn
);
tmp
=
names
;
if
(
names
==
NULL
)
{
if
(
names
==
NULL
)
return
NULL
;
}
while
(
*
tmp
!=
NULL
)
{
id
=
xenDaemonDomainLookupByName_ids
(
conn
,
*
tmp
,
&
ident
[
0
]);
if
(
id
>=
0
)
{
...
...
@@ -2160,9 +2156,8 @@ xenDaemonCreateXML(virConnectPtr conn, virDomainDefPtr def)
ret
=
xenDaemonDomainCreateXML
(
conn
,
sexpr
);
VIR_FREE
(
sexpr
);
if
(
ret
!=
0
)
{
if
(
ret
!=
0
)
goto
error
;
}
/* This comes before wait_for_devices, to ensure that latter
cleanup will destroy the domain upon failure */
...
...
@@ -2562,9 +2557,8 @@ xenDaemonDomainGetAutostart(virConnectPtr conn,
*
autostart
=
0
;
tmp
=
sexpr_node
(
root
,
"domain/on_xend_start"
);
if
(
tmp
&&
STREQ
(
tmp
,
"start"
))
{
if
(
tmp
&&
STREQ
(
tmp
,
"start"
))
*
autostart
=
1
;
}
sexpr_free
(
root
);
return
0
;
...
...
src/xen/xm_internal.c
浏览文件 @
4fab1209
...
...
@@ -121,9 +121,8 @@ xenXMConfigReaper(const void *payload,
if
(
entry
->
refreshedAt
!=
args
->
now
)
{
const
char
*
olddomname
=
entry
->
def
->
name
;
char
*
nameowner
=
(
char
*
)
virHashLookup
(
args
->
priv
->
nameConfigMap
,
olddomname
);
if
(
nameowner
&&
STREQ
(
nameowner
,
key
))
{
if
(
nameowner
&&
STREQ
(
nameowner
,
key
))
virHashRemoveEntry
(
args
->
priv
->
nameConfigMap
,
olddomname
);
}
return
1
;
}
return
0
;
...
...
@@ -231,9 +230,8 @@ xenXMConfigCacheAddFile(virConnectPtr conn, const char *filename)
/* If we currently own the name, then release it and
re-acquire it later - just in case it was renamed */
nameowner
=
(
char
*
)
virHashLookup
(
priv
->
nameConfigMap
,
entry
->
def
->
name
);
if
(
nameowner
&&
STREQ
(
nameowner
,
filename
))
{
if
(
nameowner
&&
STREQ
(
nameowner
,
filename
))
virHashRemoveEntry
(
priv
->
nameConfigMap
,
entry
->
def
->
name
);
}
/* Clear existing config entry which needs refresh */
virDomainDefFree
(
entry
->
def
);
...
...
src/xenapi/xenapi_driver.c
浏览文件 @
4fab1209
...
...
@@ -1493,16 +1493,13 @@ xenapiDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
}
defPtr
->
maxvcpus
=
defPtr
->
vcpus
=
xenapiDomainGetMaxVcpus
(
dom
);
enum
xen_on_normal_exit
action
;
if
(
xen_vm_get_actions_after_shutdown
(
session
,
&
action
,
vm
))
{
if
(
xen_vm_get_actions_after_shutdown
(
session
,
&
action
,
vm
))
defPtr
->
onPoweroff
=
xenapiNormalExitEnum2virDomainLifecycle
(
action
);
}
if
(
xen_vm_get_actions_after_reboot
(
session
,
&
action
,
vm
))
{
if
(
xen_vm_get_actions_after_reboot
(
session
,
&
action
,
vm
))
defPtr
->
onReboot
=
xenapiNormalExitEnum2virDomainLifecycle
(
action
);
}
enum
xen_on_crash_behaviour
crash
;
if
(
xen_vm_get_actions_after_crash
(
session
,
&
crash
,
vm
))
{
if
(
xen_vm_get_actions_after_crash
(
session
,
&
crash
,
vm
))
defPtr
->
onCrash
=
xenapiCrashExitEnum2virDomainLifecycle
(
action
);
}
xen_vm_get_platform
(
session
,
&
result
,
vm
);
if
(
result
!=
NULL
)
{
size_t
i
;
...
...
@@ -2060,9 +2057,8 @@ call_func(const void *data, size_t len, void *user_handle,
fflush
(
stdout
);
#endif
CURL
*
curl
=
curl_easy_init
();
if
(
!
curl
)
{
if
(
!
curl
)
return
-
1
;
}
xen_comms
comms
=
{
.
func
=
result_func
,
.
handle
=
result_handle
...
...
src/xenapi/xenapi_utils.c
浏览文件 @
4fab1209
...
...
@@ -84,9 +84,8 @@ xenapiUtil_RequestPassword(virConnectAuthPtr auth, const char *username,
cred
.
result
=
NULL
;
cred
.
resultlen
=
0
;
if
((
*
(
auth
->
cb
))(
&
cred
,
1
,
auth
->
cbdata
)
<
0
)
{
if
((
*
(
auth
->
cb
))(
&
cred
,
1
,
auth
->
cbdata
)
<
0
)
VIR_FREE
(
cred
.
result
);
}
break
;
}
...
...
@@ -105,9 +104,8 @@ xenapiUtil_ParseQuery(virConnectPtr conn, virURIPtr uri, int *noVerify)
for
(
i
=
0
;
i
<
uri
->
paramsCount
;
i
++
)
{
virURIParamPtr
queryParam
=
&
uri
->
params
[
i
];
if
(
STRCASEEQ
(
queryParam
->
name
,
"no_verify"
))
{
if
(
noVerify
==
NULL
)
{
if
(
noVerify
==
NULL
)
continue
;
}
if
(
virStrToLong_i
(
queryParam
->
value
,
NULL
,
10
,
noVerify
)
<
0
||
(
*
noVerify
!=
0
&&
*
noVerify
!=
1
))
{
xenapiSessionErrorHandler
(
conn
,
VIR_ERR_INVALID_ARG
,
...
...
@@ -282,9 +280,8 @@ mapDomainPinVcpu(unsigned char *cpumap, int maplen)
size_t
i
,
j
;
for
(
i
=
0
;
i
<
maplen
;
i
++
)
{
for
(
j
=
0
;
j
<
8
;
j
++
)
{
if
(
cpumap
[
i
]
&
(
1
<<
j
))
{
if
(
cpumap
[
i
]
&
(
1
<<
j
))
virBufferAsprintf
(
&
buf
,
"%zu,"
,
(
8
*
i
)
+
j
);
}
}
}
if
(
virBufferCheckError
(
&
buf
)
<
0
)
...
...
src/xenconfig/xen_common.c
浏览文件 @
4fab1209
...
...
@@ -729,9 +729,8 @@ xenParseCharDev(virConfPtr conf, virDomainDefPtr def)
!
(
chr
=
xenParseSxprChar
(
str
,
NULL
)))
goto
cleanup
;
if
(
chr
)
{
if
(
VIR_ALLOC_N
(
def
->
parallels
,
1
)
<
0
)
{
if
(
VIR_ALLOC_N
(
def
->
parallels
,
1
)
<
0
)
goto
cleanup
;
}
chr
->
deviceType
=
VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL
;
chr
->
target
.
port
=
0
;
...
...
@@ -762,9 +761,8 @@ xenParseCharDev(virConfPtr conf, virDomainDefPtr def)
goto
cleanup
;
chr
->
deviceType
=
VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL
;
chr
->
target
.
port
=
portnum
;
if
(
VIR_APPEND_ELEMENT
(
def
->
serials
,
def
->
nserials
,
chr
)
<
0
)
{
if
(
VIR_APPEND_ELEMENT
(
def
->
serials
,
def
->
nserials
,
chr
)
<
0
)
goto
cleanup
;
}
value
=
value
->
next
;
}
...
...
src/xenconfig/xen_sxpr.c
浏览文件 @
4fab1209
...
...
@@ -1959,16 +1959,14 @@ xenFormatSxprNet(virConnectPtr conn,
if
(
def
->
model
!=
NULL
&&
STREQ
(
def
->
model
,
"netfront"
))
{
virBufferAddLit
(
buf
,
"(type netfront)"
);
}
else
{
if
(
def
->
model
!=
NULL
)
{
if
(
def
->
model
!=
NULL
)
virBufferEscapeSexpr
(
buf
,
"(model '%s')"
,
def
->
model
);
}
/*
* apparently (type ioemu) breaks paravirt drivers on HVM so skip
* this from XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU
*/
if
(
xendConfigVersion
<=
XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU
)
{
if
(
xendConfigVersion
<=
XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU
)
virBufferAddLit
(
buf
,
"(type ioemu)"
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录