Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
1f9f1214
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,发现更多精彩内容 >>
提交
1f9f1214
编写于
4月 04, 2011
作者:
M
Michal Privoznik
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
screenshot: Implementing the public API
* src/libvirt.c: new function virDomainScreenshot
上级
3c386643
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
65 addition
and
0 deletion
+65
-0
src/libvirt.c
src/libvirt.c
+65
-0
未找到文件。
src/libvirt.c
浏览文件 @
1f9f1214
...
...
@@ -2443,6 +2443,71 @@ error:
return
-
1
;
}
/**
* virDomainScreenshot:
* @domain: a domain object
* @stream: stream to use as output
* @screen: monitor ID to take screenshot from
* @flags: extra flags, currently unused
*
* Take a screenshot of current domain console as a stream. The image format
* is hypervisor specific. Moreover, some hypervisors supports multiple
* displays per domain. These can be distinguished by @screen argument.
*
* This call sets up a stream; subsequent use of stream API is necessary
* to transfer actual data, determine how much data is successfully
* transfered, and detect any errors.
*
* The screen ID is the sequential number of screen. In case of multiple
* graphics cards, heads are enumerated before devices, e.g. having
* two graphics cards, both with four heads, screen ID 5 addresses
* the first head on the second card.
*
* Returns a string representing the mime-type of the image format, or
* NULL upon error. The caller must free() the returned value.
*/
char
*
virDomainScreenshot
(
virDomainPtr
domain
,
virStreamPtr
stream
,
unsigned
int
screen
,
unsigned
int
flags
)
{
VIR_DOMAIN_DEBUG
(
domain
,
"stream=%p flags=%u"
,
stream
,
flags
);
virResetLastError
();
if
(
!
VIR_IS_CONNECTED_DOMAIN
(
domain
))
{
virLibDomainError
(
VIR_ERR_INVALID_DOMAIN
,
__FUNCTION__
);
virDispatchError
(
NULL
);
return
NULL
;
}
if
(
!
VIR_IS_STREAM
(
stream
))
{
virLibConnError
(
VIR_ERR_INVALID_STREAM
,
__FUNCTION__
);
return
NULL
;
}
if
(
domain
->
conn
->
flags
&
VIR_CONNECT_RO
||
stream
->
conn
->
flags
&
VIR_CONNECT_RO
)
{
virLibConnError
(
VIR_ERR_OPERATION_DENIED
,
__FUNCTION__
);
goto
error
;
}
if
(
domain
->
conn
->
driver
->
domainScreenshot
)
{
char
*
ret
;
ret
=
domain
->
conn
->
driver
->
domainScreenshot
(
domain
,
stream
,
screen
,
flags
);
if
(
ret
==
NULL
)
goto
error
;
return
ret
;
}
virLibConnError
(
VIR_ERR_NO_SUPPORT
,
__FUNCTION__
);
error:
virDispatchError
(
domain
->
conn
);
return
NULL
;
}
/**
* virDomainShutdown:
* @domain: a domain object
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录