Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
94827a78
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看板
提交
94827a78
编写于
9月 18, 2012
作者:
M
Martin Kletzander
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu: Add support for reboot-timeout
This patch adds support for "-boot reboot-timeout=rb_time" that is added in QEMU.
上级
c33a922f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
36 addition
and
0 deletion
+36
-0
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.c
+4
-0
src/qemu/qemu_capabilities.h
src/qemu/qemu_capabilities.h
+1
-0
src/qemu/qemu_command.c
src/qemu/qemu_command.c
+31
-0
未找到文件。
src/qemu/qemu_capabilities.c
浏览文件 @
94827a78
...
...
@@ -180,6 +180,8 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
"ide-drive.wwn"
,
"scsi-disk.wwn"
,
"seccomp-sandbox"
,
"reboot-timeout"
,
/* 110 */
);
struct
_qemuCaps
{
...
...
@@ -1191,6 +1193,8 @@ qemuCapsComputeCmdFlags(const char *help,
qemuCapsSet
(
caps
,
QEMU_CAPS_NESTING
);
if
(
strstr
(
help
,
",menu=on"
))
qemuCapsSet
(
caps
,
QEMU_CAPS_BOOT_MENU
);
if
(
strstr
(
help
,
",reboot-timeout=rb_time"
))
qemuCapsSet
(
caps
,
QEMU_CAPS_REBOOT_TIMEOUT
);
if
((
fsdev
=
strstr
(
help
,
"-fsdev"
)))
{
qemuCapsSet
(
caps
,
QEMU_CAPS_FSDEV
);
if
(
strstr
(
fsdev
,
"readonly"
))
...
...
src/qemu/qemu_capabilities.h
浏览文件 @
94827a78
...
...
@@ -145,6 +145,7 @@ enum qemuCapsFlags {
QEMU_CAPS_IDE_DRIVE_WWN
=
107
,
/* Is ide-drive.wwn available? */
QEMU_CAPS_SCSI_DISK_WWN
=
108
,
/* Is scsi-disk.wwn available? */
QEMU_CAPS_SECCOMP_SANDBOX
=
109
,
/* -sandbox */
QEMU_CAPS_REBOOT_TIMEOUT
=
110
,
/* -boot reboot-timeout */
QEMU_CAPS_LAST
,
/* this must always be the last item */
};
...
...
src/qemu/qemu_command.c
浏览文件 @
94827a78
...
...
@@ -4945,7 +4945,22 @@ qemuBuildCommandLine(virConnectPtr conn,
VIR_WARN
(
"bootmenu is enabled but not "
"supported by this QEMU binary"
);
}
}
if
(
def
->
os
.
bios
.
rt_set
)
{
if
(
!
qemuCapsGet
(
caps
,
QEMU_CAPS_REBOOT_TIMEOUT
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"reboot timeout is not supported "
"by this QEMU binary"
));
goto
error
;
}
if
(
boot_nparams
++
)
virBufferAddChar
(
&
boot_buf
,
','
);
virBufferAsprintf
(
&
boot_buf
,
"reboot-timeout=%d"
,
def
->
os
.
bios
.
rt_delay
);
}
if
(
boot_nparams
>
0
)
{
...
...
@@ -8271,6 +8286,22 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps,
qemuParseCommandLineBootDevs
(
def
,
token
);
}
else
if
(
STRPREFIX
(
token
,
"menu=on"
))
{
def
->
os
.
bootmenu
=
1
;
}
else
if
(
STRPREFIX
(
token
,
"reboot-timeout="
))
{
int
num
;
char
*
endptr
;
if
(
virStrToLong_i
(
token
+
strlen
(
"reboot-timeout="
),
&
endptr
,
10
,
&
num
)
<
0
||
(
*
endptr
!=
'\0'
&&
endptr
!=
strchr
(
token
,
','
)))
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"cannot parse reboot-timeout value"
));
goto
error
;
}
if
(
num
>
65535
)
num
=
65535
;
else
if
(
num
<
-
1
)
num
=
-
1
;
def
->
os
.
bios
.
rt_delay
=
num
;
def
->
os
.
bios
.
rt_set
=
true
;
}
token
=
strchr
(
token
,
','
);
/* This incrementation has to be done here in order to make it
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录