Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
5a4f7836
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5a4f7836
编写于
3月 05, 2014
作者:
C
Chunyan Liu
提交者:
Daniel P. Berrange
3月 12, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename qemu*NetConfigRestore/Replace to virHostdevNetConfigRestore/Replace
上级
996af573
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
32 addition
and
32 deletion
+32
-32
src/qemu/qemu_hostdev.c
src/qemu/qemu_hostdev.c
+32
-32
未找到文件。
src/qemu/qemu_hostdev.c
浏览文件 @
5a4f7836
...
@@ -299,8 +299,8 @@ cleanup:
...
@@ -299,8 +299,8 @@ cleanup:
static
int
static
int
qemuDomain
HostdevPciSysfsPath
(
virDomainHostdevDefPtr
hostdev
,
vir
HostdevPciSysfsPath
(
virDomainHostdevDefPtr
hostdev
,
char
**
sysfs_path
)
char
**
sysfs_path
)
{
{
virPCIDeviceAddress
config_address
;
virPCIDeviceAddress
config_address
;
...
@@ -314,12 +314,12 @@ qemuDomainHostdevPciSysfsPath(virDomainHostdevDefPtr hostdev,
...
@@ -314,12 +314,12 @@ qemuDomainHostdevPciSysfsPath(virDomainHostdevDefPtr hostdev,
static
int
static
int
qemuDomain
HostdevIsVirtualFunction
(
virDomainHostdevDefPtr
hostdev
)
vir
HostdevIsVirtualFunction
(
virDomainHostdevDefPtr
hostdev
)
{
{
char
*
sysfs_path
=
NULL
;
char
*
sysfs_path
=
NULL
;
int
ret
=
-
1
;
int
ret
=
-
1
;
if
(
qemuDomain
HostdevPciSysfsPath
(
hostdev
,
&
sysfs_path
)
<
0
)
if
(
vir
HostdevPciSysfsPath
(
hostdev
,
&
sysfs_path
)
<
0
)
return
ret
;
return
ret
;
ret
=
virPCIIsVirtualFunction
(
sysfs_path
);
ret
=
virPCIIsVirtualFunction
(
sysfs_path
);
...
@@ -331,13 +331,13 @@ qemuDomainHostdevIsVirtualFunction(virDomainHostdevDefPtr hostdev)
...
@@ -331,13 +331,13 @@ qemuDomainHostdevIsVirtualFunction(virDomainHostdevDefPtr hostdev)
static
int
static
int
qemuDomain
HostdevNetDevice
(
virDomainHostdevDefPtr
hostdev
,
char
**
linkdev
,
vir
HostdevNetDevice
(
virDomainHostdevDefPtr
hostdev
,
char
**
linkdev
,
int
*
vf
)
int
*
vf
)
{
{
int
ret
=
-
1
;
int
ret
=
-
1
;
char
*
sysfs_path
=
NULL
;
char
*
sysfs_path
=
NULL
;
if
(
qemuDomain
HostdevPciSysfsPath
(
hostdev
,
&
sysfs_path
)
<
0
)
if
(
vir
HostdevPciSysfsPath
(
hostdev
,
&
sysfs_path
)
<
0
)
return
ret
;
return
ret
;
if
(
virPCIIsVirtualFunction
(
sysfs_path
)
==
1
)
{
if
(
virPCIIsVirtualFunction
(
sysfs_path
)
==
1
)
{
...
@@ -360,11 +360,11 @@ cleanup:
...
@@ -360,11 +360,11 @@ cleanup:
static
int
static
int
qemuDomain
HostdevNetConfigVirtPortProfile
(
const
char
*
linkdev
,
int
vf
,
vir
HostdevNetConfigVirtPortProfile
(
const
char
*
linkdev
,
int
vf
,
virNetDevVPortProfilePtr
virtPort
,
virNetDevVPortProfilePtr
virtPort
,
const
virMacAddr
*
macaddr
,
const
virMacAddr
*
macaddr
,
const
unsigned
char
*
uuid
,
const
unsigned
char
*
uuid
,
bool
associate
)
bool
associate
)
{
{
int
ret
=
-
1
;
int
ret
=
-
1
;
...
@@ -400,9 +400,9 @@ qemuDomainHostdevNetConfigVirtPortProfile(const char *linkdev, int vf,
...
@@ -400,9 +400,9 @@ qemuDomainHostdevNetConfigVirtPortProfile(const char *linkdev, int vf,
static
int
static
int
qemuDomain
HostdevNetConfigReplace
(
virDomainHostdevDefPtr
hostdev
,
vir
HostdevNetConfigReplace
(
virDomainHostdevDefPtr
hostdev
,
const
unsigned
char
*
uuid
,
const
unsigned
char
*
uuid
,
char
*
stateDir
)
char
*
stateDir
)
{
{
char
*
linkdev
=
NULL
;
char
*
linkdev
=
NULL
;
virNetDevVlanPtr
vlan
;
virNetDevVlanPtr
vlan
;
...
@@ -413,7 +413,7 @@ qemuDomainHostdevNetConfigReplace(virDomainHostdevDefPtr hostdev,
...
@@ -413,7 +413,7 @@ qemuDomainHostdevNetConfigReplace(virDomainHostdevDefPtr hostdev,
bool
port_profile_associate
=
true
;
bool
port_profile_associate
=
true
;
int
isvf
;
int
isvf
;
isvf
=
qemuDomain
HostdevIsVirtualFunction
(
hostdev
);
isvf
=
vir
HostdevIsVirtualFunction
(
hostdev
);
if
(
isvf
<=
0
)
{
if
(
isvf
<=
0
)
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"Interface type hostdev is currently supported on"
_
(
"Interface type hostdev is currently supported on"
...
@@ -421,7 +421,7 @@ qemuDomainHostdevNetConfigReplace(virDomainHostdevDefPtr hostdev,
...
@@ -421,7 +421,7 @@ qemuDomainHostdevNetConfigReplace(virDomainHostdevDefPtr hostdev,
return
ret
;
return
ret
;
}
}
if
(
qemuDomain
HostdevNetDevice
(
hostdev
,
&
linkdev
,
&
vf
)
<
0
)
if
(
vir
HostdevNetDevice
(
hostdev
,
&
linkdev
,
&
vf
)
<
0
)
return
ret
;
return
ret
;
vlan
=
virDomainNetGetActualVlan
(
hostdev
->
parent
.
data
.
net
);
vlan
=
virDomainNetGetActualVlan
(
hostdev
->
parent
.
data
.
net
);
...
@@ -435,7 +435,7 @@ qemuDomainHostdevNetConfigReplace(virDomainHostdevDefPtr hostdev,
...
@@ -435,7 +435,7 @@ qemuDomainHostdevNetConfigReplace(virDomainHostdevDefPtr hostdev,
virNetDevVPortTypeToString
(
virtPort
->
virtPortType
));
virNetDevVPortTypeToString
(
virtPort
->
virtPortType
));
goto
cleanup
;
goto
cleanup
;
}
}
ret
=
qemuDomain
HostdevNetConfigVirtPortProfile
(
linkdev
,
vf
,
ret
=
vir
HostdevNetConfigVirtPortProfile
(
linkdev
,
vf
,
virtPort
,
&
hostdev
->
parent
.
data
.
net
->
mac
,
uuid
,
virtPort
,
&
hostdev
->
parent
.
data
.
net
->
mac
,
uuid
,
port_profile_associate
);
port_profile_associate
);
}
else
{
}
else
{
...
@@ -475,9 +475,9 @@ cleanup:
...
@@ -475,9 +475,9 @@ cleanup:
* case, try to find in the old state dir.
* case, try to find in the old state dir.
*/
*/
static
int
static
int
qemuDomain
HostdevNetConfigRestore
(
virDomainHostdevDefPtr
hostdev
,
vir
HostdevNetConfigRestore
(
virDomainHostdevDefPtr
hostdev
,
char
*
stateDir
,
char
*
stateDir
,
char
*
oldStateDir
)
char
*
oldStateDir
)
{
{
char
*
linkdev
=
NULL
;
char
*
linkdev
=
NULL
;
virNetDevVPortProfilePtr
virtPort
;
virNetDevVPortProfilePtr
virtPort
;
...
@@ -495,7 +495,7 @@ qemuDomainHostdevNetConfigRestore(virDomainHostdevDefPtr hostdev,
...
@@ -495,7 +495,7 @@ qemuDomainHostdevNetConfigRestore(virDomainHostdevDefPtr hostdev,
!
hostdev
->
parent
.
data
.
net
)
!
hostdev
->
parent
.
data
.
net
)
return
0
;
return
0
;
isvf
=
qemuDomain
HostdevIsVirtualFunction
(
hostdev
);
isvf
=
vir
HostdevIsVirtualFunction
(
hostdev
);
if
(
isvf
<=
0
)
{
if
(
isvf
<=
0
)
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"Interface type hostdev is currently supported on"
_
(
"Interface type hostdev is currently supported on"
...
@@ -503,15 +503,16 @@ qemuDomainHostdevNetConfigRestore(virDomainHostdevDefPtr hostdev,
...
@@ -503,15 +503,16 @@ qemuDomainHostdevNetConfigRestore(virDomainHostdevDefPtr hostdev,
return
ret
;
return
ret
;
}
}
if
(
qemuDomain
HostdevNetDevice
(
hostdev
,
&
linkdev
,
&
vf
)
<
0
)
if
(
vir
HostdevNetDevice
(
hostdev
,
&
linkdev
,
&
vf
)
<
0
)
return
ret
;
return
ret
;
virtPort
=
virDomainNetGetActualVirtPortProfile
(
virtPort
=
virDomainNetGetActualVirtPortProfile
(
hostdev
->
parent
.
data
.
net
);
hostdev
->
parent
.
data
.
net
);
if
(
virtPort
)
{
if
(
virtPort
)
{
ret
=
qemuDomainHostdevNetConfigVirtPortProfile
(
linkdev
,
vf
,
virtPort
,
ret
=
virHostdevNetConfigVirtPortProfile
(
linkdev
,
vf
,
virtPort
,
&
hostdev
->
parent
.
data
.
net
->
mac
,
NULL
,
&
hostdev
->
parent
.
data
.
net
->
mac
,
port_profile_associate
);
NULL
,
port_profile_associate
);
}
else
{
}
else
{
ret
=
virNetDevRestoreNetConfig
(
linkdev
,
vf
,
stateDir
);
ret
=
virNetDevRestoreNetConfig
(
linkdev
,
vf
,
stateDir
);
if
(
ret
<
0
&&
oldStateDir
!=
NULL
)
if
(
ret
<
0
&&
oldStateDir
!=
NULL
)
...
@@ -748,8 +749,8 @@ virHostdevPreparePCIDevices(virHostdevManagerPtr hostdev_mgr,
...
@@ -748,8 +749,8 @@ virHostdevPreparePCIDevices(virHostdevManagerPtr hostdev_mgr,
continue
;
continue
;
if
(
hostdev
->
parent
.
type
==
VIR_DOMAIN_DEVICE_NET
&&
if
(
hostdev
->
parent
.
type
==
VIR_DOMAIN_DEVICE_NET
&&
hostdev
->
parent
.
data
.
net
)
{
hostdev
->
parent
.
data
.
net
)
{
if
(
qemuDomain
HostdevNetConfigReplace
(
hostdev
,
uuid
,
if
(
vir
HostdevNetConfigReplace
(
hostdev
,
uuid
,
hostdev_mgr
->
stateDir
)
<
0
)
{
hostdev_mgr
->
stateDir
)
<
0
)
{
goto
resetvfnetconfig
;
goto
resetvfnetconfig
;
}
}
}
}
...
@@ -833,8 +834,7 @@ inactivedevs:
...
@@ -833,8 +834,7 @@ inactivedevs:
resetvfnetconfig:
resetvfnetconfig:
for
(
i
=
0
;
for
(
i
=
0
;
last_processed_hostdev_vf
!=
-
1
&&
i
<
last_processed_hostdev_vf
;
i
++
)
last_processed_hostdev_vf
!=
-
1
&&
i
<
last_processed_hostdev_vf
;
i
++
)
qemuDomainHostdevNetConfigRestore
(
hostdevs
[
i
],
hostdev_mgr
->
stateDir
,
virHostdevNetConfigRestore
(
hostdevs
[
i
],
hostdev_mgr
->
stateDir
,
NULL
);
NULL
);
reattachdevs:
reattachdevs:
for
(
i
=
0
;
i
<
virPCIDeviceListCount
(
pcidevs
);
i
++
)
{
for
(
i
=
0
;
i
<
virPCIDeviceListCount
(
pcidevs
);
i
++
)
{
...
@@ -1343,8 +1343,8 @@ qemuDomainReAttachHostdevDevices(virQEMUDriverPtr driver,
...
@@ -1343,8 +1343,8 @@ qemuDomainReAttachHostdevDevices(virQEMUDriverPtr driver,
* reset and reattach device
* reset and reattach device
*/
*/
for
(
i
=
0
;
i
<
nhostdevs
;
i
++
)
for
(
i
=
0
;
i
<
nhostdevs
;
i
++
)
qemuDomain
HostdevNetConfigRestore
(
hostdevs
[
i
],
hostdev_mgr
->
stateDir
,
vir
HostdevNetConfigRestore
(
hostdevs
[
i
],
hostdev_mgr
->
stateDir
,
oldStateDir
);
oldStateDir
);
for
(
i
=
0
;
i
<
virPCIDeviceListCount
(
pcidevs
);
i
++
)
{
for
(
i
=
0
;
i
<
virPCIDeviceListCount
(
pcidevs
);
i
++
)
{
virPCIDevicePtr
dev
=
virPCIDeviceListGet
(
pcidevs
,
i
);
virPCIDevicePtr
dev
=
virPCIDeviceListGet
(
pcidevs
,
i
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录