Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
77b93dbc
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看板
提交
77b93dbc
编写于
11月 05, 2012
作者:
M
Michal Privoznik
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu: Wrap controllers code into dummy loop
which just re-indent code and prepare it for next patch.
上级
ec02d49d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
49 addition
and
48 deletion
+49
-48
src/qemu/qemu_command.c
src/qemu/qemu_command.c
+49
-48
未找到文件。
src/qemu/qemu_command.c
浏览文件 @
77b93dbc
...
@@ -4429,7 +4429,7 @@ qemuBuildCommandLine(virConnectPtr conn,
...
@@ -4429,7 +4429,7 @@ qemuBuildCommandLine(virConnectPtr conn,
virDomainSnapshotObjPtr
snapshot
,
virDomainSnapshotObjPtr
snapshot
,
enum
virNetDevVPortProfileOp
vmop
)
enum
virNetDevVPortProfileOp
vmop
)
{
{
int
i
;
int
i
,
j
;
struct
utsname
ut
;
struct
utsname
ut
;
int
disableKQEMU
=
0
;
int
disableKQEMU
=
0
;
int
enableKQEMU
=
0
;
int
enableKQEMU
=
0
;
...
@@ -5024,61 +5024,63 @@ qemuBuildCommandLine(virConnectPtr conn,
...
@@ -5024,61 +5024,63 @@ qemuBuildCommandLine(virConnectPtr conn,
}
}
if
(
qemuCapsGet
(
caps
,
QEMU_CAPS_DEVICE
))
{
if
(
qemuCapsGet
(
caps
,
QEMU_CAPS_DEVICE
))
{
for
(
i
=
0
;
i
<
def
->
ncontrollers
;
i
++
)
{
for
(
j
=
0
;
j
<
1
;
j
++
)
{
virDomainControllerDefPtr
cont
=
def
->
controllers
[
i
];
for
(
i
=
0
;
i
<
def
->
ncontrollers
;
i
++
)
{
virDomainControllerDefPtr
cont
=
def
->
controllers
[
i
];
/* We don't add an explicit IDE or FD controller because the
* provided PIIX4 device already includes one. It isn't possible to
/* We don't add an explicit IDE or FD controller because the
* remove the PIIX4. */
* provided PIIX4 device already includes one. It isn't possible to
if
(
cont
->
type
==
VIR_DOMAIN_CONTROLLER_TYPE_IDE
||
* remove the PIIX4. */
cont
->
type
==
VIR_DOMAIN_CONTROLLER_TYPE_FDC
)
if
(
cont
->
type
==
VIR_DOMAIN_CONTROLLER_TYPE_IDE
||
continue
;
cont
->
type
==
VIR_DOMAIN_CONTROLLER_TYPE_FDC
)
continue
;
/* Also, skip USB controllers with type none.*/
/* Also, skip USB controllers with type none.*/
if
(
cont
->
type
==
VIR_DOMAIN_CONTROLLER_TYPE_USB
&&
if
(
cont
->
type
==
VIR_DOMAIN_CONTROLLER_TYPE_USB
&&
cont
->
model
==
VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE
)
{
cont
->
model
==
VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE
)
{
usbcontroller
=
-
1
;
/* mark we don't want a controller */
usbcontroller
=
-
1
;
/* mark we don't want a controller */
continue
;
continue
;
}
}
/* Only recent QEMU implements a SATA (AHCI) controller */
/* Only recent QEMU implements a SATA (AHCI) controller */
if
(
cont
->
type
==
VIR_DOMAIN_CONTROLLER_TYPE_SATA
)
{
if
(
cont
->
type
==
VIR_DOMAIN_CONTROLLER_TYPE_SATA
)
{
if
(
!
qemuCapsGet
(
caps
,
QEMU_CAPS_ICH9_AHCI
))
{
if
(
!
qemuCapsGet
(
caps
,
QEMU_CAPS_ICH9_AHCI
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"SATA is not supported with this "
_
(
"SATA is not supported with this "
"QEMU binary"
));
"QEMU binary"
));
goto
error
;
goto
error
;
}
else
{
}
else
{
char
*
devstr
;
char
*
devstr
;
virCommandAddArg
(
cmd
,
"-device"
);
if
(
!
(
devstr
=
qemuBuildControllerDevStr
(
def
,
cont
,
caps
,
NULL
)))
goto
error
;
virCommandAddArg
(
cmd
,
devstr
);
VIR_FREE
(
devstr
);
}
}
else
if
(
cont
->
type
==
VIR_DOMAIN_CONTROLLER_TYPE_USB
&&
cont
->
model
==
-
1
&&
!
qemuCapsGet
(
caps
,
QEMU_CAPS_PIIX3_USB_UHCI
))
{
if
(
usblegacy
)
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"Multiple legacy USB controllers are "
"not supported"
));
goto
error
;
}
usblegacy
=
true
;
}
else
{
virCommandAddArg
(
cmd
,
"-device"
);
virCommandAddArg
(
cmd
,
"-device"
);
if
(
!
(
devstr
=
qemuBuildControllerDevStr
(
def
,
cont
,
caps
,
NULL
)))
char
*
devstr
;
if
(
!
(
devstr
=
qemuBuildControllerDevStr
(
def
,
cont
,
caps
,
&
usbcontroller
)))
goto
error
;
goto
error
;
virCommandAddArg
(
cmd
,
devstr
);
virCommandAddArg
(
cmd
,
devstr
);
VIR_FREE
(
devstr
);
VIR_FREE
(
devstr
);
}
}
}
else
if
(
cont
->
type
==
VIR_DOMAIN_CONTROLLER_TYPE_USB
&&
cont
->
model
==
-
1
&&
!
qemuCapsGet
(
caps
,
QEMU_CAPS_PIIX3_USB_UHCI
))
{
if
(
usblegacy
)
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"Multiple legacy USB controllers are "
"not supported"
));
goto
error
;
}
usblegacy
=
true
;
}
else
{
virCommandAddArg
(
cmd
,
"-device"
);
char
*
devstr
;
if
(
!
(
devstr
=
qemuBuildControllerDevStr
(
def
,
cont
,
caps
,
&
usbcontroller
)))
goto
error
;
virCommandAddArg
(
cmd
,
devstr
);
VIR_FREE
(
devstr
);
}
}
}
}
}
}
...
@@ -5553,7 +5555,6 @@ qemuBuildCommandLine(virConnectPtr conn,
...
@@ -5553,7 +5555,6 @@ qemuBuildCommandLine(virConnectPtr conn,
virDomainSmartcardDefPtr
smartcard
=
def
->
smartcards
[
0
];
virDomainSmartcardDefPtr
smartcard
=
def
->
smartcards
[
0
];
char
*
devstr
;
char
*
devstr
;
virBuffer
opt
=
VIR_BUFFER_INITIALIZER
;
virBuffer
opt
=
VIR_BUFFER_INITIALIZER
;
int
j
;
const
char
*
database
;
const
char
*
database
;
if
(
def
->
nsmartcards
>
1
||
if
(
def
->
nsmartcards
>
1
||
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录