Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
e195b439
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看板
提交
e195b439
编写于
7月 29, 2009
作者:
R
Ron Yorston
提交者:
Daniel Veillard
7月 29, 2009
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Kernel command line support for UML
* src/uml_conf.c: add support for additional kernel command line arguments.
上级
664085ab
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
43 addition
and
0 deletion
+43
-0
src/uml_conf.c
src/uml_conf.c
+43
-0
未找到文件。
src/uml_conf.c
浏览文件 @
e195b439
...
...
@@ -325,6 +325,31 @@ umlBuildCommandLineChr(virConnectPtr conn,
return
ret
;
}
/*
* Null-terminate the current argument and return a pointer to the next.
* This should follow the same rules as the Linux kernel: arguments are
* separated by spaces; arguments can be quoted with double quotes; double
* quotes can't be escaped.
*/
static
char
*
umlNextArg
(
char
*
args
)
{
int
in_quote
=
0
;
for
(;
*
args
;
args
++
)
{
if
(
*
args
==
' '
&&
!
in_quote
)
{
*
args
++
=
'\0'
;
break
;
}
if
(
*
args
==
'"'
)
in_quote
=
!
in_quote
;
}
while
(
*
args
==
' '
)
args
++
;
return
args
;
}
/*
* Constructs a argv suitable for launching uml with config defined
* for a given virtual machine.
...
...
@@ -342,6 +367,7 @@ int umlBuildCommandLine(virConnectPtr conn,
const
char
**
qargv
=
NULL
;
int
qenvc
=
0
,
qenva
=
0
;
const
char
**
qenv
=
NULL
;
char
*
cmdline
=
NULL
;
uname
(
&
ut
);
...
...
@@ -474,6 +500,22 @@ int umlBuildCommandLine(virConnectPtr conn,
ADD_ARG
(
ret
);
}
if
(
vm
->
def
->
os
.
cmdline
)
{
char
*
args
,
*
next_arg
;
if
((
cmdline
=
strdup
(
vm
->
def
->
os
.
cmdline
))
==
NULL
)
goto
no_memory
;
args
=
cmdline
;
while
(
*
args
==
' '
)
args
++
;
while
(
*
args
)
{
next_arg
=
umlNextArg
(
args
);
ADD_ARG_LIT
(
args
);
args
=
next_arg
;
}
}
ADD_ARG
(
NULL
);
ADD_ENV
(
NULL
);
...
...
@@ -495,6 +537,7 @@ int umlBuildCommandLine(virConnectPtr conn,
VIR_FREE
((
qenv
)[
i
]);
VIR_FREE
(
qenv
);
}
VIR_FREE
(
cmdline
);
return
-
1
;
#undef ADD_ARG
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录