Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
5c4b6e8f
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看板
提交
5c4b6e8f
编写于
5月 20, 2016
作者:
J
Ján Tomko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu: assume QEMU_CAPS_DEVICE almost everywhere
Remove more checks that are no longer necessary.
上级
34ab070c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
9 addition
and
71 deletion
+9
-71
src/qemu/qemu_command.c
src/qemu/qemu_command.c
+1
-1
src/qemu/qemu_domain.c
src/qemu/qemu_domain.c
+1
-5
src/qemu/qemu_domain.h
src/qemu/qemu_domain.h
+0
-1
src/qemu/qemu_hostdev.c
src/qemu/qemu_hostdev.c
+1
-3
src/qemu/qemu_hotplug.c
src/qemu/qemu_hotplug.c
+3
-56
src/qemu/qemu_process.c
src/qemu/qemu_process.c
+3
-5
未找到文件。
src/qemu/qemu_command.c
浏览文件 @
5c4b6e8f
...
...
@@ -8007,7 +8007,7 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd,
goto
cleanup
;
virCommandAddArgList
(
cmd
,
"-netdev"
,
host
,
NULL
);
}
if
(
qemuDomainSupportsNicdev
(
def
,
qemuCaps
,
net
))
{
if
(
qemuDomainSupportsNicdev
(
def
,
net
))
{
if
(
!
(
nic
=
qemuBuildNicDevStr
(
def
,
net
,
vlan
,
bootindex
,
vhostfdSize
,
qemuCaps
)))
goto
cleanup
;
...
...
src/qemu/qemu_domain.c
浏览文件 @
5c4b6e8f
...
...
@@ -5396,12 +5396,8 @@ qemuDomainDetectVcpuPids(virQEMUDriverPtr driver,
bool
qemuDomainSupportsNicdev
(
virDomainDefPtr
def
,
virQEMUCapsPtr
qemuCaps
,
virDomainNetDefPtr
net
)
{
if
(
!
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_DEVICE
))
return
false
;
/* non-virtio ARM nics require legacy -net nic */
if
(((
def
->
os
.
arch
==
VIR_ARCH_ARMV7L
)
||
(
def
->
os
.
arch
==
VIR_ARCH_AARCH64
))
&&
...
...
@@ -5417,7 +5413,7 @@ qemuDomainSupportsNetdev(virDomainDefPtr def,
virQEMUCapsPtr
qemuCaps
,
virDomainNetDefPtr
net
)
{
if
(
!
qemuDomainSupportsNicdev
(
def
,
qemuCaps
,
net
))
if
(
!
qemuDomainSupportsNicdev
(
def
,
net
))
return
false
;
return
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_NETDEV
);
}
...
...
src/qemu/qemu_domain.h
浏览文件 @
5c4b6e8f
...
...
@@ -618,7 +618,6 @@ int qemuDomainDetectVcpuPids(virQEMUDriverPtr driver, virDomainObjPtr vm,
int
asyncJob
);
bool
qemuDomainSupportsNicdev
(
virDomainDefPtr
def
,
virQEMUCapsPtr
qemuCaps
,
virDomainNetDefPtr
net
);
bool
qemuDomainSupportsNetdev
(
virDomainDefPtr
def
,
...
...
src/qemu/qemu_hostdev.c
浏览文件 @
5c4b6e8f
...
...
@@ -197,9 +197,7 @@ qemuHostdevPreparePCIDevicesCheckSupport(virDomainHostdevDefPtr *hostdevs,
if
(
supportsPassthroughVFIO
&&
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_DEVICE_VFIO_PCI
))
{
*
backend
=
VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO
;
}
else
if
(
supportsPassthroughKVM
&&
(
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_PCIDEVICE
)
||
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_DEVICE
)))
{
}
else
if
(
supportsPassthroughKVM
)
{
*
backend
=
VIR_DOMAIN_HOSTDEV_PCI_BACKEND_KVM
;
}
else
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
...
...
src/qemu/qemu_hotplug.c
浏览文件 @
5c4b6e8f
...
...
@@ -1334,12 +1334,6 @@ int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver,
char
*
charAlias
=
NULL
;
char
*
devstr
=
NULL
;
if
(
!
virQEMUCapsGet
(
priv
->
qemuCaps
,
QEMU_CAPS_DEVICE
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"redirected devices are not supported by this QEMU"
));
return
ret
;
}
if
(
qemuAssignDeviceRedirdevAlias
(
vm
->
def
,
redirdev
,
-
1
)
<
0
)
goto
cleanup
;
...
...
@@ -1537,12 +1531,6 @@ int qemuDomainAttachChrDevice(virQEMUDriverPtr driver,
char
*
charAlias
=
NULL
;
bool
need_release
=
false
;
if
(
!
virQEMUCapsGet
(
priv
->
qemuCaps
,
QEMU_CAPS_DEVICE
))
{
virReportError
(
VIR_ERR_OPERATION_INVALID
,
"%s"
,
_
(
"qemu does not support -device"
));
goto
cleanup
;
}
if
(
qemuAssignDeviceChrAlias
(
vmdef
,
chr
,
-
1
)
<
0
)
goto
cleanup
;
...
...
@@ -1897,8 +1885,7 @@ qemuDomainAttachHostSCSIDevice(virConnectPtr conn,
bool
teardowncgroup
=
false
;
bool
teardownlabel
=
false
;
if
(
!
virQEMUCapsGet
(
priv
->
qemuCaps
,
QEMU_CAPS_DEVICE
)
||
!
virQEMUCapsGet
(
priv
->
qemuCaps
,
QEMU_CAPS_DEVICE_SCSI_GENERIC
))
{
if
(
!
virQEMUCapsGet
(
priv
->
qemuCaps
,
QEMU_CAPS_DEVICE_SCSI_GENERIC
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"SCSI passthrough is not supported by this version of qemu"
));
return
-
1
;
...
...
@@ -3092,8 +3079,7 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver,
goto
cleanup
;
qemuDomainObjEnterMonitor
(
driver
,
vm
);
if
(
virQEMUCapsGet
(
priv
->
qemuCaps
,
QEMU_CAPS_NETDEV
)
&&
virQEMUCapsGet
(
priv
->
qemuCaps
,
QEMU_CAPS_DEVICE
))
{
if
(
virQEMUCapsGet
(
priv
->
qemuCaps
,
QEMU_CAPS_NETDEV
))
{
if
(
qemuMonitorRemoveNetdev
(
priv
->
mon
,
hostnet_name
)
<
0
)
{
if
(
qemuDomainObjExitMonitor
(
driver
,
vm
)
<
0
)
goto
cleanup
;
...
...
@@ -3472,13 +3458,6 @@ qemuDomainDetachDiskDevice(virQEMUDriverPtr driver,
int
ret
=
-
1
;
qemuDomainObjPrivatePtr
priv
=
vm
->
privateData
;
if
(
!
virQEMUCapsGet
(
priv
->
qemuCaps
,
QEMU_CAPS_DEVICE
))
{
virReportError
(
VIR_ERR_OPERATION_FAILED
,
_
(
"Underlying qemu does not support %s disk removal"
),
virDomainDiskBusTypeToString
(
detach
->
bus
));
goto
cleanup
;
}
if
(
detach
->
mirror
)
{
virReportError
(
VIR_ERR_BLOCK_COPY_ACTIVE
,
_
(
"disk '%s' is in an active block job"
),
...
...
@@ -3729,12 +3708,6 @@ qemuDomainDetachHostUSBDevice(virQEMUDriverPtr driver,
return
-
1
;
}
if
(
!
virQEMUCapsGet
(
priv
->
qemuCaps
,
QEMU_CAPS_DEVICE
))
{
virReportError
(
VIR_ERR_OPERATION_FAILED
,
"%s"
,
_
(
"device cannot be detached with this QEMU version"
));
return
-
1
;
}
qemuDomainMarkDeviceForRemoval
(
vm
,
detach
->
info
);
qemuDomainObjEnterMonitor
(
driver
,
vm
);
...
...
@@ -3759,12 +3732,6 @@ qemuDomainDetachHostSCSIDevice(virQEMUDriverPtr driver,
return
-
1
;
}
if
(
!
virQEMUCapsGet
(
priv
->
qemuCaps
,
QEMU_CAPS_DEVICE
))
{
virReportError
(
VIR_ERR_OPERATION_FAILED
,
"%s"
,
_
(
"device cannot be detached with this QEMU version"
));
return
-
1
;
}
qemuDomainMarkDeviceForRemoval
(
vm
,
detach
->
info
);
qemuDomainObjEnterMonitor
(
driver
,
vm
);
...
...
@@ -3781,11 +3748,9 @@ qemuDomainDetachThisHostDevice(virQEMUDriverPtr driver,
virDomainObjPtr
vm
,
virDomainHostdevDefPtr
detach
)
{
qemuDomainObjPrivatePtr
priv
=
vm
->
privateData
;
int
ret
=
-
1
;
if
(
virQEMUCapsGet
(
priv
->
qemuCaps
,
QEMU_CAPS_DEVICE
)
&&
!
detach
->
info
->
alias
)
{
if
(
!
detach
->
info
->
alias
)
{
if
(
qemuAssignDeviceHostdevAlias
(
vm
->
def
,
&
detach
->
info
->
alias
,
-
1
)
<
0
)
return
-
1
;
}
...
...
@@ -4111,12 +4076,6 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
return
ret
;
}
if
(
!
virQEMUCapsGet
(
priv
->
qemuCaps
,
QEMU_CAPS_DEVICE
))
{
virReportError
(
VIR_ERR_OPERATION_INVALID
,
"%s"
,
_
(
"qemu does not support -device"
));
return
ret
;
}
if
(
!
tmpChr
->
info
.
alias
&&
qemuAssignDeviceChrAlias
(
vmdef
,
tmpChr
,
-
1
)
<
0
)
return
ret
;
...
...
@@ -4166,12 +4125,6 @@ qemuDomainDetachRNGDevice(virQEMUDriverPtr driver,
tmpRNG
=
vm
->
def
->
rngs
[
idx
];
if
(
!
virQEMUCapsGet
(
priv
->
qemuCaps
,
QEMU_CAPS_DEVICE
))
{
virReportError
(
VIR_ERR_OPERATION_INVALID
,
"%s"
,
_
(
"qemu does not support -device"
));
return
-
1
;
}
if
(
!
tmpRNG
->
info
.
alias
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"alias not set for RNG device"
));
...
...
@@ -4205,12 +4158,6 @@ qemuDomainDetachMemoryDevice(virQEMUDriverPtr driver,
int
rc
;
int
ret
=
-
1
;
if
(
!
virQEMUCapsGet
(
priv
->
qemuCaps
,
QEMU_CAPS_DEVICE
))
{
virReportError
(
VIR_ERR_OPERATION_INVALID
,
"%s"
,
_
(
"qemu does not support -device"
));
return
-
1
;
}
qemuDomainMemoryDeviceAlignSize
(
vm
->
def
,
memdef
);
if
((
idx
=
virDomainMemoryFindByDef
(
vm
->
def
,
memdef
))
<
0
)
{
...
...
src/qemu/qemu_process.c
浏览文件 @
5c4b6e8f
...
...
@@ -4857,11 +4857,9 @@ qemuProcessPrepareDomain(virConnectPtr conn,
* we also need to populate the PCI address set cache for later
* use in hotplug
*/
if
(
virQEMUCapsGet
(
priv
->
qemuCaps
,
QEMU_CAPS_DEVICE
))
{
VIR_DEBUG
(
"Assigning domain PCI addresses"
);
if
((
qemuDomainAssignAddresses
(
vm
->
def
,
priv
->
qemuCaps
,
vm
))
<
0
)
goto
cleanup
;
}
VIR_DEBUG
(
"Assigning domain PCI addresses"
);
if
((
qemuDomainAssignAddresses
(
vm
->
def
,
priv
->
qemuCaps
,
vm
))
<
0
)
goto
cleanup
;
if
(
qemuAssignDeviceAliases
(
vm
->
def
,
priv
->
qemuCaps
)
<
0
)
goto
cleanup
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录