Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
4d2a1896
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,发现更多精彩内容 >>
提交
4d2a1896
编写于
5月 18, 2011
作者:
M
Matthias Bolte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve invalid argument checks for the public API
上级
191e1ec6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
76 addition
and
6 deletion
+76
-6
src/libvirt.c
src/libvirt.c
+76
-6
未找到文件。
src/libvirt.c
浏览文件 @
4d2a1896
...
...
@@ -1390,7 +1390,7 @@ int
virConnectRef
(
virConnectPtr
conn
)
{
if
((
!
VIR_IS_CONNECT
(
conn
)))
{
virLibConnError
(
VIR_ERR_INVALID_
ARG
,
__FUNCTION__
);
virLibConnError
(
VIR_ERR_INVALID_
CONN
,
__FUNCTION__
);
virDispatchError
(
NULL
);
return
-
1
;
}
...
...
@@ -4490,7 +4490,6 @@ virDomainMigratePrepareTunnel(virConnectPtr conn,
const
char
*
dname
,
unsigned
long
bandwidth
,
const
char
*
dom_xml
)
{
VIR_DEBUG
(
"conn=%p, stream=%p, flags=%lu, dname=%s, "
"bandwidth=%lu, dom_xml=%s"
,
conn
,
st
,
flags
,
...
...
@@ -5621,7 +5620,7 @@ virDomainGetBlockInfo(virDomainPtr domain, const char *path, virDomainBlockInfoP
virDispatchError
(
NULL
);
return
-
1
;
}
if
(
info
==
NULL
)
{
if
(
path
==
NULL
||
info
==
NULL
)
{
virLibDomainError
(
VIR_ERR_INVALID_ARG
,
__FUNCTION__
);
goto
error
;
}
...
...
@@ -6527,6 +6526,12 @@ virDomainAttachDevice(virDomainPtr domain, const char *xml)
virDispatchError
(
NULL
);
return
-
1
;
}
if
(
xml
==
NULL
)
{
virLibDomainError
(
VIR_ERR_INVALID_ARG
,
__FUNCTION__
);
goto
error
;
}
if
(
domain
->
conn
->
flags
&
VIR_CONNECT_RO
)
{
virLibDomainError
(
VIR_ERR_OPERATION_DENIED
,
__FUNCTION__
);
goto
error
;
...
...
@@ -6587,6 +6592,12 @@ virDomainAttachDeviceFlags(virDomainPtr domain,
virDispatchError
(
NULL
);
return
-
1
;
}
if
(
xml
==
NULL
)
{
virLibDomainError
(
VIR_ERR_INVALID_ARG
,
__FUNCTION__
);
goto
error
;
}
if
(
domain
->
conn
->
flags
&
VIR_CONNECT_RO
)
{
virLibDomainError
(
VIR_ERR_OPERATION_DENIED
,
__FUNCTION__
);
goto
error
;
...
...
@@ -6632,6 +6643,12 @@ virDomainDetachDevice(virDomainPtr domain, const char *xml)
virDispatchError
(
NULL
);
return
-
1
;
}
if
(
xml
==
NULL
)
{
virLibDomainError
(
VIR_ERR_INVALID_ARG
,
__FUNCTION__
);
goto
error
;
}
if
(
domain
->
conn
->
flags
&
VIR_CONNECT_RO
)
{
virLibDomainError
(
VIR_ERR_OPERATION_DENIED
,
__FUNCTION__
);
goto
error
;
...
...
@@ -6688,6 +6705,12 @@ virDomainDetachDeviceFlags(virDomainPtr domain,
virDispatchError
(
NULL
);
return
-
1
;
}
if
(
xml
==
NULL
)
{
virLibDomainError
(
VIR_ERR_INVALID_ARG
,
__FUNCTION__
);
goto
error
;
}
if
(
domain
->
conn
->
flags
&
VIR_CONNECT_RO
)
{
virLibDomainError
(
VIR_ERR_OPERATION_DENIED
,
__FUNCTION__
);
goto
error
;
...
...
@@ -6748,6 +6771,12 @@ virDomainUpdateDeviceFlags(virDomainPtr domain,
virDispatchError
(
NULL
);
return
-
1
;
}
if
(
xml
==
NULL
)
{
virLibDomainError
(
VIR_ERR_INVALID_ARG
,
__FUNCTION__
);
goto
error
;
}
if
(
domain
->
conn
->
flags
&
VIR_CONNECT_RO
)
{
virLibDomainError
(
VIR_ERR_OPERATION_DENIED
,
__FUNCTION__
);
goto
error
;
...
...
@@ -7408,7 +7437,7 @@ int
virNetworkRef
(
virNetworkPtr
network
)
{
if
((
!
VIR_IS_CONNECTED_NETWORK
(
network
)))
{
virLibConnError
(
VIR_ERR_INVALID_
ARG
,
__FUNCTION__
);
virLibConnError
(
VIR_ERR_INVALID_
NETWORK
,
__FUNCTION__
);
virDispatchError
(
NULL
);
return
-
1
;
}
...
...
@@ -8274,7 +8303,7 @@ int
virInterfaceRef
(
virInterfacePtr
iface
)
{
if
((
!
VIR_IS_CONNECTED_INTERFACE
(
iface
)))
{
virLibConnError
(
VIR_ERR_INVALID_
ARG
,
__FUNCTION__
);
virLibConnError
(
VIR_ERR_INVALID_
INTERFACE
,
__FUNCTION__
);
virDispatchError
(
NULL
);
return
-
1
;
}
...
...
@@ -8717,7 +8746,7 @@ virStoragePoolLookupByVolume(virStorageVolPtr vol)
virResetLastError
();
if
(
!
VIR_IS_CONNECTED_STORAGE_VOL
(
vol
))
{
virLibConnError
(
VIR_ERR_INVALID_
CONN
,
__FUNCTION__
);
virLibConnError
(
VIR_ERR_INVALID_
STORAGE_VOL
,
__FUNCTION__
);
virDispatchError
(
NULL
);
return
NULL
;
}
...
...
@@ -9789,6 +9818,11 @@ virStorageVolCreateXML(virStoragePoolPtr pool,
return
NULL
;
}
if
(
xmldesc
==
NULL
)
{
virLibConnError
(
VIR_ERR_INVALID_ARG
,
__FUNCTION__
);
goto
error
;
}
if
(
pool
->
conn
->
flags
&
VIR_CONNECT_RO
)
{
virLibConnError
(
VIR_ERR_OPERATION_DENIED
,
__FUNCTION__
);
goto
error
;
...
...
@@ -9845,6 +9879,11 @@ virStorageVolCreateXMLFrom(virStoragePoolPtr pool,
goto
error
;
}
if
(
xmldesc
==
NULL
)
{
virLibConnError
(
VIR_ERR_INVALID_ARG
,
__FUNCTION__
);
goto
error
;
}
if
(
pool
->
conn
->
flags
&
VIR_CONNECT_RO
||
clonevol
->
conn
->
flags
&
VIR_CONNECT_RO
)
{
virLibConnError
(
VIR_ERR_OPERATION_DENIED
,
__FUNCTION__
);
...
...
@@ -10595,6 +10634,11 @@ int virNodeDeviceListCaps(virNodeDevicePtr dev,
return
-
1
;
}
if
(
names
==
NULL
||
maxnames
<
0
)
{
virLibNodeDeviceError
(
VIR_ERR_INVALID_ARG
,
__FUNCTION__
);
goto
error
;
}
if
(
dev
->
conn
->
deviceMonitor
&&
dev
->
conn
->
deviceMonitor
->
deviceListCaps
)
{
int
ret
;
ret
=
dev
->
conn
->
deviceMonitor
->
deviceListCaps
(
dev
,
names
,
maxnames
);
...
...
@@ -11853,6 +11897,11 @@ int virStreamSend(virStreamPtr stream,
return
-
1
;
}
if
(
data
==
NULL
)
{
virLibConnError
(
VIR_ERR_INVALID_ARG
,
__FUNCTION__
);
goto
error
;
}
if
(
stream
->
driver
&&
stream
->
driver
->
streamSend
)
{
int
ret
;
...
...
@@ -11948,6 +11997,11 @@ int virStreamRecv(virStreamPtr stream,
return
-
1
;
}
if
(
data
==
NULL
)
{
virLibConnError
(
VIR_ERR_INVALID_ARG
,
__FUNCTION__
);
goto
error
;
}
if
(
stream
->
driver
&&
stream
->
driver
->
streamRecv
)
{
int
ret
;
...
...
@@ -12024,6 +12078,11 @@ int virStreamSendAll(virStreamPtr stream,
return
-
1
;
}
if
(
handler
==
NULL
)
{
virLibConnError
(
VIR_ERR_INVALID_ARG
,
__FUNCTION__
);
goto
cleanup
;
}
if
(
stream
->
flags
&
VIR_STREAM_NONBLOCK
)
{
virLibConnError
(
VIR_ERR_OPERATION_INVALID
,
_
(
"data sources cannot be used for non-blocking streams"
));
...
...
@@ -12121,6 +12180,11 @@ int virStreamRecvAll(virStreamPtr stream,
return
-
1
;
}
if
(
handler
==
NULL
)
{
virLibConnError
(
VIR_ERR_INVALID_ARG
,
__FUNCTION__
);
goto
cleanup
;
}
if
(
stream
->
flags
&
VIR_STREAM_NONBLOCK
)
{
virLibConnError
(
VIR_ERR_OPERATION_INVALID
,
_
(
"data sinks cannot be used for non-blocking streams"
));
...
...
@@ -13835,6 +13899,12 @@ virDomainSnapshotCreateXML(virDomainPtr domain,
}
conn
=
domain
->
conn
;
if
(
xmlDesc
==
NULL
)
{
virLibDomainError
(
VIR_ERR_INVALID_ARG
,
__FUNCTION__
);
goto
error
;
}
if
(
conn
->
flags
&
VIR_CONNECT_RO
)
{
virLibConnError
(
VIR_ERR_OPERATION_DENIED
,
__FUNCTION__
);
goto
error
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录