Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
b4259bbc
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,发现更多精彩内容 >>
提交
b4259bbc
编写于
4月 16, 2007
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed exception reporting for domain/network operations
上级
cc05eaf8
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
46 addition
and
17 deletion
+46
-17
ChangeLog
ChangeLog
+6
-0
python/generator.py
python/generator.py
+34
-16
python/libvir.py
python/libvir.py
+6
-1
未找到文件。
ChangeLog
浏览文件 @
b4259bbc
Mon Apr 16 08:30:04 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* python/generator.py, python/libvir.py: Ensure that connection
info is passed into virError object when a virNetwork or virDomain
operation fails
Sun Apr 15 15:57:04 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* qemud/driver.c: Fixed integer overflow in calculating CPU time
...
...
python/generator.py
浏览文件 @
b4259bbc
...
...
@@ -535,10 +535,10 @@ def buildStubs():
# The type automatically remapped to generated classes
#
classes_type
=
{
"virDomainPtr"
:
(
"._o"
,
"virDomain(_obj=%s)"
,
"virDomain"
),
"virDomain *"
:
(
"._o"
,
"virDomain(_obj=%s)"
,
"virDomain"
),
"virNetworkPtr"
:
(
"._o"
,
"virNetwork(_obj=%s)"
,
"virNetwork"
),
"virNetwork *"
:
(
"._o"
,
"virNetwork(_obj=%s)"
,
"virNetwork"
),
"virDomainPtr"
:
(
"._o"
,
"virDomain(
self,
_obj=%s)"
,
"virDomain"
),
"virDomain *"
:
(
"._o"
,
"virDomain(
self,
_obj=%s)"
,
"virDomain"
),
"virNetworkPtr"
:
(
"._o"
,
"virNetwork(
self,
_obj=%s)"
,
"virNetwork"
),
"virNetwork *"
:
(
"._o"
,
"virNetwork(
self,
_obj=%s)"
,
"virNetwork"
),
"virConnectPtr"
:
(
"._o"
,
"virConnect(_obj=%s)"
,
"virConnect"
),
"virConnect *"
:
(
"._o"
,
"virConnect(_obj=%s)"
,
"virConnect"
),
}
...
...
@@ -556,11 +556,6 @@ classes_destructors = {
"virConnect"
:
"virConnectClose"
,
}
classes_references
=
{
"virDomain"
:
"virConnect"
,
"virNetwork"
:
"virConnect"
,
}
functions_noexcept
=
{
'virDomainGetID'
:
True
,
'virDomainGetName'
:
True
,
...
...
@@ -872,11 +867,16 @@ def buildWrappers():
else
:
txt
.
write
(
"Class %s()
\n
"
%
(
classname
))
classes
.
write
(
"class %s:
\n
"
%
(
classname
))
if
classname
==
"virDomain"
or
classname
==
"virNetwork"
:
classes
.
write
(
" def __init__(self, conn, _obj=None):
\n
"
)
else
:
classes
.
write
(
" def __init__(self, _obj=None):
\n
"
)
if
reference_keepers
.
has_key
(
classname
):
list
=
reference_keepers
[
classname
]
for
ref
in
list
:
classes
.
write
(
" self.%s = None
\n
"
%
ref
[
1
])
if
classname
==
"virDomain"
or
classname
==
"virNetwork"
:
classes
.
write
(
" self._conn = conn
\n
"
)
classes
.
write
(
" if _obj != None:self._o = _obj;return
\n
"
)
classes
.
write
(
" self._o = None
\n\n
"
);
destruct
=
None
...
...
@@ -961,6 +961,14 @@ def buildWrappers():
classes
.
write
(
" if ret is None:raise libvirtError('%s() failed', conn=self)
\n
"
%
(
name
))
elif
classname
==
"virDomain"
:
classes
.
write
(
" if ret is None:raise libvirtError('%s() failed', dom=self)
\n
"
%
(
name
))
elif
classname
==
"virNetwork"
:
classes
.
write
(
" if ret is None:raise libvirtError('%s() failed', net=self)
\n
"
%
(
name
))
else
:
classes
.
write
(
" if ret is None:raise libvirtError('%s() failed')
\n
"
%
...
...
@@ -973,12 +981,6 @@ def buildWrappers():
classes
.
write
(
classes_type
[
ret
[
0
]][
1
]
%
(
"ret"
));
classes
.
write
(
"
\n
"
);
#
# hook up a reference if needed
#
if
classes_references
.
has_key
(
classes_type
[
ret
[
0
]][
2
]):
classes
.
write
(
" __tmp.ref = self
\n
"
);
#
# Sometime one need to keep references of the source
# class in the returned class object.
...
...
@@ -1031,6 +1033,14 @@ def buildWrappers():
classes
.
write
((
" if "
+
test
+
": raise libvirtError ('%s() failed', conn=self)
\n
"
)
%
(
"ret"
,
name
))
elif
classname
==
"virDomain"
:
classes
.
write
((
" if "
+
test
+
": raise libvirtError ('%s() failed', dom=self)
\n
"
)
%
(
"ret"
,
name
))
elif
classname
==
"virNetwork"
:
classes
.
write
((
" if "
+
test
+
": raise libvirtError ('%s() failed', net=self)
\n
"
)
%
(
"ret"
,
name
))
else
:
classes
.
write
((
" if "
+
test
+
": raise libvirtError ('%s() failed')
\n
"
)
%
...
...
@@ -1053,6 +1063,14 @@ def buildWrappers():
classes
.
write
((
" if "
+
test
+
": raise libvirtError ('%s() failed', conn=self)
\n
"
)
%
(
"ret"
,
name
))
elif
classname
==
"virDomain"
:
classes
.
write
((
" if "
+
test
+
": raise libvirtError ('%s() failed', dom=self)
\n
"
)
%
(
"ret"
,
name
))
elif
classname
==
"virNetwork"
:
classes
.
write
((
" if "
+
test
+
": raise libvirtError ('%s() failed', net=self)
\n
"
)
%
(
"ret"
,
name
))
else
:
classes
.
write
((
" if "
+
test
+
": raise libvirtError ('%s() failed')
\n
"
)
%
...
...
python/libvir.py
浏览文件 @
b4259bbc
...
...
@@ -9,9 +9,14 @@ import types
# The root of all libvirt errors.
class
libvirtError
(
Exception
):
def
__init__
(
self
,
msg
,
conn
=
None
):
def
__init__
(
self
,
msg
,
conn
=
None
,
dom
=
None
,
net
=
None
):
Exception
.
__init__
(
self
,
msg
)
if
dom
is
not
None
:
conn
=
dom
.
_conn
elif
net
is
not
None
:
conn
=
net
.
_conn
if
conn
is
None
:
self
.
err
=
virGetLastError
()
else
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录