Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
6530a97b
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6530a97b
编写于
15年前
作者:
A
Anthony Liguori
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move out option lookup into a separate function
Signed-off-by:
N
Anthony Liguori
<
aliguori@us.ibm.com
>
上级
07381cc1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
43 addition
and
29 deletion
+43
-29
vl.c
vl.c
+43
-29
未找到文件。
vl.c
浏览文件 @
6530a97b
...
...
@@ -4658,6 +4658,46 @@ static int debugcon_parse(const char *devname)
return
0
;
}
static
const
QEMUOption
*
lookup_opt
(
int
argc
,
char
**
argv
,
const
char
**
poptarg
,
int
*
poptind
)
{
const
QEMUOption
*
popt
;
int
optind
=
*
poptind
;
char
*
r
=
argv
[
optind
];
const
char
*
optarg
;
optind
++
;
/* Treat --foo the same as -foo. */
if
(
r
[
1
]
==
'-'
)
r
++
;
popt
=
qemu_options
;
for
(;;)
{
if
(
!
popt
->
name
)
{
fprintf
(
stderr
,
"%s: invalid option -- '%s'
\n
"
,
argv
[
0
],
r
);
exit
(
1
);
}
if
(
!
strcmp
(
popt
->
name
,
r
+
1
))
break
;
popt
++
;
}
if
(
popt
->
flags
&
HAS_ARG
)
{
if
(
optind
>=
argc
)
{
fprintf
(
stderr
,
"%s: option '%s' requires an argument
\n
"
,
argv
[
0
],
r
);
exit
(
1
);
}
optarg
=
argv
[
optind
++
];
}
else
{
optarg
=
NULL
;
}
*
poptarg
=
optarg
;
*
poptind
=
optind
;
return
popt
;
}
int
main
(
int
argc
,
char
**
argv
,
char
**
envp
)
{
const
char
*
gdbstub_dev
=
NULL
;
...
...
@@ -4672,7 +4712,7 @@ int main(int argc, char **argv, char **envp)
int
cyls
,
heads
,
secs
,
translation
;
QemuOpts
*
hda_opts
=
NULL
,
*
opts
;
int
optind
;
const
char
*
r
,
*
optarg
;
const
char
*
optarg
;
const
char
*
loadvm
=
NULL
;
QEMUMachine
*
machine
;
const
char
*
cpu_model
;
...
...
@@ -4753,38 +4793,12 @@ int main(int argc, char **argv, char **envp)
for
(;;)
{
if
(
optind
>=
argc
)
break
;
r
=
argv
[
optind
];
if
(
r
[
0
]
!=
'-'
)
{
if
(
argv
[
optind
][
0
]
!=
'-'
)
{
hda_opts
=
drive_add
(
argv
[
optind
++
],
HD_ALIAS
,
0
);
}
else
{
const
QEMUOption
*
popt
;
optind
++
;
/* Treat --foo the same as -foo. */
if
(
r
[
1
]
==
'-'
)
r
++
;
popt
=
qemu_options
;
for
(;;)
{
if
(
!
popt
->
name
)
{
fprintf
(
stderr
,
"%s: invalid option -- '%s'
\n
"
,
argv
[
0
],
r
);
exit
(
1
);
}
if
(
!
strcmp
(
popt
->
name
,
r
+
1
))
break
;
popt
++
;
}
if
(
popt
->
flags
&
HAS_ARG
)
{
if
(
optind
>=
argc
)
{
fprintf
(
stderr
,
"%s: option '%s' requires an argument
\n
"
,
argv
[
0
],
r
);
exit
(
1
);
}
optarg
=
argv
[
optind
++
];
}
else
{
optarg
=
NULL
;
}
popt
=
lookup_opt
(
argc
,
argv
,
&
optarg
,
&
optind
);
switch
(
popt
->
index
)
{
case
QEMU_OPTION_M
:
machine
=
find_machine
(
optarg
);
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
新手
引导
客服
返回
顶部