Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
e866e302
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,发现更多精彩内容 >>
提交
e866e302
编写于
5月 21, 2008
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed couple of memory leaks wrt to virXXXDestroy APIs, and clarify docs to match reality
上级
922fbeb8
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
32 addition
and
13 deletion
+32
-13
ChangeLog
ChangeLog
+12
-0
qemud/remote.c
qemud/remote.c
+4
-2
src/hash.c
src/hash.c
+3
-0
src/libvirt.c
src/libvirt.c
+6
-8
src/remote_internal.c
src/remote_internal.c
+4
-0
src/virsh.c
src/virsh.c
+3
-3
未找到文件。
ChangeLog
浏览文件 @
e866e302
Wed May 21 16:24:29 EST 2008 Daniel P. Berrange <berrange@redhat.com>
Fix up misc memory leaks / incorrect docs (Cole Robinson)
* qemud/remote.c: Free the virDomainPtr object in the
virDomainDestroy handler to avoid leak
* src/hash.c: Added more ref count debug
* src/libvirt.c: Clarified docs on virXXXDestroy to
match reality
* src/remote_internal.c: Free virDomain/Network objects
after dispatching RPC error
* src/virsh.c: Added some more virDomainFree calls
Wed May 21 15:42:29 EST 2008 Daniel P. Berrange <berrange@redhat.com>
Wed May 21 15:42:29 EST 2008 Daniel P. Berrange <berrange@redhat.com>
* python/generator.py: Don't free the underlying virDomainPtr
* python/generator.py: Don't free the underlying virDomainPtr
...
...
qemud/remote.c
浏览文件 @
e866e302
...
@@ -940,9 +940,11 @@ remoteDispatchDomainDestroy (struct qemud_server *server ATTRIBUTE_UNUSED,
...
@@ -940,9 +940,11 @@ remoteDispatchDomainDestroy (struct qemud_server *server ATTRIBUTE_UNUSED,
return
-
2
;
return
-
2
;
}
}
if
(
virDomainDestroy
(
dom
)
==
-
1
)
if
(
virDomainDestroy
(
dom
)
==
-
1
)
{
virDomainFree
(
dom
);
return
-
1
;
return
-
1
;
/* No need to free dom - destroy does it for us */
}
virDomainFree
(
dom
);
return
0
;
return
0
;
}
}
...
...
src/hash.c
浏览文件 @
e866e302
...
@@ -842,6 +842,9 @@ __virGetDomain(virConnectPtr conn, const char *name, const unsigned char *uuid)
...
@@ -842,6 +842,9 @@ __virGetDomain(virConnectPtr conn, const char *name, const unsigned char *uuid)
goto
error
;
goto
error
;
}
}
conn
->
refs
++
;
conn
->
refs
++
;
DEBUG
(
"New hash entry %p"
,
ret
);
}
else
{
DEBUG
(
"Existing hash entry %p: refs now %d"
,
ret
,
ret
->
refs
+
1
);
}
}
ret
->
refs
++
;
ret
->
refs
++
;
pthread_mutex_unlock
(
&
conn
->
lock
);
pthread_mutex_unlock
(
&
conn
->
lock
);
...
...
src/libvirt.c
浏览文件 @
e866e302
...
@@ -1390,10 +1390,9 @@ virDomainLookupByName(virConnectPtr conn, const char *name)
...
@@ -1390,10 +1390,9 @@ virDomainLookupByName(virConnectPtr conn, const char *name)
* @domain: a domain object
* @domain: a domain object
*
*
* Destroy the domain object. The running instance is shutdown if not down
* Destroy the domain object. The running instance is shutdown if not down
* already and all resources used by it are given back to the hypervisor.
* already and all resources used by it are given back to the hypervisor. This
* The data structure is freed and should not be used thereafter if the
* does not free the associated virDomainPtr object.
* call does not return an error.
* This function may require privileged access
* This function may requires privileged access
*
*
* Returns 0 in case of success and -1 in case of failure.
* Returns 0 in case of success and -1 in case of failure.
*/
*/
...
@@ -3502,10 +3501,9 @@ virNetworkCreate(virNetworkPtr network)
...
@@ -3502,10 +3501,9 @@ virNetworkCreate(virNetworkPtr network)
* @network: a network object
* @network: a network object
*
*
* Destroy the network object. The running instance is shutdown if not down
* Destroy the network object. The running instance is shutdown if not down
* already and all resources used by it are given back to the hypervisor.
* already and all resources used by it are given back to the hypervisor. This
* The data structure is freed and should not be used thereafter if the
* does not free the associated virNetworkPtr object.
* call does not return an error.
* This function may require privileged access
* This function may requires privileged access
*
*
* Returns 0 in case of success and -1 in case of failure.
* Returns 0 in case of success and -1 in case of failure.
*/
*/
...
...
src/remote_internal.c
浏览文件 @
e866e302
...
@@ -4606,6 +4606,10 @@ server_error (virConnectPtr conn, remote_error *err)
...
@@ -4606,6 +4606,10 @@ server_error (virConnectPtr conn, remote_error *err)
err
->
str3
?
*
err
->
str3
:
NULL
,
err
->
str3
?
*
err
->
str3
:
NULL
,
err
->
int1
,
err
->
int2
,
err
->
int1
,
err
->
int2
,
"%s"
,
err
->
message
?
*
err
->
message
:
NULL
);
"%s"
,
err
->
message
?
*
err
->
message
:
NULL
);
if
(
dom
)
virDomainFree
(
dom
);
if
(
net
)
virNetworkFree
(
net
);
}
}
/* get_nonnull_domain and get_nonnull_network turn an on-wire
/* get_nonnull_domain and get_nonnull_network turn an on-wire
...
...
src/virsh.c
浏览文件 @
e866e302
...
@@ -1468,9 +1468,9 @@ cmdDestroy(vshControl * ctl, vshCmd * cmd)
...
@@ -1468,9 +1468,9 @@ cmdDestroy(vshControl * ctl, vshCmd * cmd)
}
else
{
}
else
{
vshError
(
ctl
,
FALSE
,
_
(
"Failed to destroy domain %s"
),
name
);
vshError
(
ctl
,
FALSE
,
_
(
"Failed to destroy domain %s"
),
name
);
ret
=
FALSE
;
ret
=
FALSE
;
virDomainFree
(
dom
);
}
}
virDomainFree
(
dom
);
return
ret
;
return
ret
;
}
}
...
@@ -2433,9 +2433,9 @@ cmdNetworkDestroy(vshControl * ctl, vshCmd * cmd)
...
@@ -2433,9 +2433,9 @@ cmdNetworkDestroy(vshControl * ctl, vshCmd * cmd)
}
else
{
}
else
{
vshError
(
ctl
,
FALSE
,
_
(
"Failed to destroy network %s"
),
name
);
vshError
(
ctl
,
FALSE
,
_
(
"Failed to destroy network %s"
),
name
);
ret
=
FALSE
;
ret
=
FALSE
;
virNetworkFree
(
network
);
}
}
virNetworkFree
(
network
);
return
ret
;
return
ret
;
}
}
...
@@ -3161,9 +3161,9 @@ cmdPoolDestroy(vshControl * ctl, vshCmd * cmd)
...
@@ -3161,9 +3161,9 @@ cmdPoolDestroy(vshControl * ctl, vshCmd * cmd)
}
else
{
}
else
{
vshError
(
ctl
,
FALSE
,
_
(
"Failed to destroy pool %s"
),
name
);
vshError
(
ctl
,
FALSE
,
_
(
"Failed to destroy pool %s"
),
name
);
ret
=
FALSE
;
ret
=
FALSE
;
virStoragePoolFree
(
pool
);
}
}
virStoragePoolFree
(
pool
);
return
ret
;
return
ret
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录