Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
8f1912c5
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看板
提交
8f1912c5
编写于
3月 03, 2009
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Don't try to detach & reset PCI devices while running test suite for XML-> ARGV conversion.
上级
1ca2bd79
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
85 addition
and
46 deletion
+85
-46
ChangeLog
ChangeLog
+9
-0
src/qemu_conf.c
src/qemu_conf.c
+0
-46
src/qemu_driver.c
src/qemu_driver.c
+76
-0
未找到文件。
ChangeLog
浏览文件 @
8f1912c5
Tue Mar 3 08:55:13 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
Don't try to detach & reset PCI devices while running test
suite for XML-> ARGV conversion.
* src/qemu_driver.c: Add qemuPrepareHostDevices() helper to
detach and reset PCI devices.
* src/qemu_conf.c: Don't detach & reset PCI devices while
building the command line argv
Tue Mar 3 09:24:13 CET 2009 Daniel Veillard <veillard@redhat.com>
* qemud/qemud.c: fix qemu+tls handshake negotiation, patch by
...
...
src/qemu_conf.c
浏览文件 @
8f1912c5
...
...
@@ -47,7 +47,6 @@
#include "datatypes.h"
#include "xml.h"
#include "nodeinfo.h"
#include "pci.h"
#define VIR_FROM_THIS VIR_FROM_QEMU
...
...
@@ -1395,52 +1394,7 @@ int qemudBuildCommandLine(virConnectPtr conn,
ADD_ARG_LIT
(
"-pcidevice"
);
ADD_ARG_LIT
(
pcidev
);
VIR_FREE
(
pcidev
);
if
(
hostdev
->
managed
)
{
pciDevice
*
dev
=
pciGetDevice
(
conn
,
hostdev
->
source
.
subsys
.
u
.
pci
.
domain
,
hostdev
->
source
.
subsys
.
u
.
pci
.
bus
,
hostdev
->
source
.
subsys
.
u
.
pci
.
slot
,
hostdev
->
source
.
subsys
.
u
.
pci
.
function
);
if
(
!
dev
)
goto
error
;
if
(
pciDettachDevice
(
conn
,
dev
)
<
0
)
{
pciFreeDevice
(
conn
,
dev
);
goto
error
;
}
pciFreeDevice
(
conn
,
dev
);
}
/* else {
XXX validate that non-managed device isn't in use, eg
by checking that device is either un-bound, or bound
to pci-stub.ko
} */
}
}
/* Now that all the PCI hostdevs have be dettached, we can reset them */
for
(
i
=
0
;
i
<
vm
->
def
->
nhostdevs
;
i
++
)
{
virDomainHostdevDefPtr
hostdev
=
vm
->
def
->
hostdevs
[
i
];
pciDevice
*
dev
;
if
(
hostdev
->
mode
!=
VIR_DOMAIN_HOSTDEV_MODE_SUBSYS
||
hostdev
->
source
.
subsys
.
type
!=
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI
)
continue
;
dev
=
pciGetDevice
(
conn
,
hostdev
->
source
.
subsys
.
u
.
pci
.
domain
,
hostdev
->
source
.
subsys
.
u
.
pci
.
bus
,
hostdev
->
source
.
subsys
.
u
.
pci
.
slot
,
hostdev
->
source
.
subsys
.
u
.
pci
.
function
);
if
(
!
dev
)
goto
error
;
if
(
pciResetDevice
(
conn
,
dev
)
<
0
)
goto
error
;
pciFreeDevice
(
conn
,
dev
);
}
if
(
migrateFrom
)
{
...
...
src/qemu_driver.c
浏览文件 @
8f1912c5
...
...
@@ -1133,6 +1133,79 @@ static int qemudNextFreeVNCPort(struct qemud_driver *driver ATTRIBUTE_UNUSED) {
return
-
1
;
}
static
int
qemuPrepareHostDevices
(
virConnectPtr
conn
,
virDomainDefPtr
def
)
{
int
i
;
/* We have to use 2 loops here. *All* devices must
* be detached before we reset any of them, because
* in some cases you have to reset the whole PCI,
* which impacts all devices on it
*/
for
(
i
=
0
;
i
<
def
->
nhostdevs
;
i
++
)
{
virDomainHostdevDefPtr
hostdev
=
def
->
hostdevs
[
i
];
if
(
hostdev
->
mode
!=
VIR_DOMAIN_HOSTDEV_MODE_SUBSYS
)
continue
;
if
(
hostdev
->
source
.
subsys
.
type
!=
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI
)
continue
;
if
(
!
hostdev
->
managed
)
{
pciDevice
*
dev
=
pciGetDevice
(
conn
,
hostdev
->
source
.
subsys
.
u
.
pci
.
domain
,
hostdev
->
source
.
subsys
.
u
.
pci
.
bus
,
hostdev
->
source
.
subsys
.
u
.
pci
.
slot
,
hostdev
->
source
.
subsys
.
u
.
pci
.
function
);
if
(
!
dev
)
goto
error
;
if
(
pciDettachDevice
(
conn
,
dev
)
<
0
)
{
pciFreeDevice
(
conn
,
dev
);
goto
error
;
}
pciFreeDevice
(
conn
,
dev
);
}
/* else {
XXX validate that non-managed device isn't in use, eg
by checking that device is either un-bound, or bound
to pci-stub.ko
} */
}
/* Now that all the PCI hostdevs have be dettached, we can safely
* reset them */
for
(
i
=
0
;
i
<
def
->
nhostdevs
;
i
++
)
{
virDomainHostdevDefPtr
hostdev
=
def
->
hostdevs
[
i
];
pciDevice
*
dev
;
if
(
hostdev
->
mode
!=
VIR_DOMAIN_HOSTDEV_MODE_SUBSYS
)
continue
;
if
(
hostdev
->
source
.
subsys
.
type
!=
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI
)
continue
;
dev
=
pciGetDevice
(
conn
,
hostdev
->
source
.
subsys
.
u
.
pci
.
domain
,
hostdev
->
source
.
subsys
.
u
.
pci
.
bus
,
hostdev
->
source
.
subsys
.
u
.
pci
.
slot
,
hostdev
->
source
.
subsys
.
u
.
pci
.
function
);
if
(
!
dev
)
goto
error
;
if
(
pciResetDevice
(
conn
,
dev
)
<
0
)
{
pciFreeDevice
(
conn
,
dev
);
goto
error
;
}
pciFreeDevice
(
conn
,
dev
);
}
return
0
;
error:
return
-
1
;
}
static
virDomainPtr
qemudDomainLookupByName
(
virConnectPtr
conn
,
const
char
*
name
);
...
...
@@ -1210,6 +1283,9 @@ static int qemudStartVMDaemon(virConnectPtr conn,
return
-
1
;
}
if
(
qemuPrepareHostDevices
(
conn
,
vm
->
def
)
<
0
)
return
-
1
;
vm
->
def
->
id
=
driver
->
nextvmid
++
;
if
(
qemudBuildCommandLine
(
conn
,
driver
,
vm
,
qemuCmdFlags
,
&
argv
,
&
progenv
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录