Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
b27adaed
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看板
提交
b27adaed
编写于
6月 15, 2016
作者:
J
Jiri Denemark
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu: Propagate virCapsPtr to virQEMUCapsNewForBinaryInternal
Signed-off-by:
N
Jiri Denemark
<
jdenemar@redhat.com
>
上级
85105b0a
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
50 addition
and
27 deletion
+50
-27
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.c
+15
-10
src/qemu/qemu_capabilities.h
src/qemu/qemu_capabilities.h
+4
-2
src/qemu/qemu_capspriv.h
src/qemu/qemu_capspriv.h
+2
-1
src/qemu/qemu_domain.c
src/qemu/qemu_domain.c
+11
-7
src/qemu/qemu_driver.c
src/qemu/qemu_driver.c
+6
-3
src/qemu/qemu_process.c
src/qemu/qemu_process.c
+11
-3
tests/qemucapsprobe.c
tests/qemucapsprobe.c
+1
-1
未找到文件。
src/qemu/qemu_capabilities.c
浏览文件 @
b27adaed
...
...
@@ -843,7 +843,7 @@ virQEMUCapsInitGuest(virCapsPtr caps,
/* Ignore binary if extracting version info fails */
if
(
binary
)
{
if
(
!
(
qemubinCaps
=
virQEMUCapsCacheLookup
(
cache
,
binary
)))
{
if
(
!
(
qemubinCaps
=
virQEMUCapsCacheLookup
(
ca
ps
,
ca
che
,
binary
)))
{
virResetLastError
();
VIR_FREE
(
binary
);
}
...
...
@@ -883,7 +883,7 @@ virQEMUCapsInitGuest(virCapsPtr caps,
if
(
!
kvmbin
)
continue
;
if
(
!
(
kvmbinCaps
=
virQEMUCapsCacheLookup
(
cache
,
kvmbin
)))
{
if
(
!
(
kvmbinCaps
=
virQEMUCapsCacheLookup
(
ca
ps
,
ca
che
,
kvmbin
)))
{
virResetLastError
();
VIR_FREE
(
kvmbin
);
continue
;
...
...
@@ -2047,7 +2047,7 @@ int virQEMUCapsGetDefaultVersion(virCapsPtr caps,
return
-
1
;
}
qemucaps
=
virQEMUCapsCacheLookup
(
capsCache
,
capsdata
->
emulator
);
qemucaps
=
virQEMUCapsCacheLookup
(
caps
,
caps
Cache
,
capsdata
->
emulator
);
VIR_FREE
(
capsdata
);
if
(
!
qemucaps
)
return
-
1
;
...
...
@@ -3871,7 +3871,8 @@ virQEMUCapsLogProbeFailure(const char *binary)
virQEMUCapsPtr
virQEMUCapsNewForBinaryInternal
(
const
char
*
binary
,
virQEMUCapsNewForBinaryInternal
(
virCapsPtr
caps
ATTRIBUTE_UNUSED
,
const
char
*
binary
,
const
char
*
libDir
,
const
char
*
cacheDir
,
uid_t
runUid
,
...
...
@@ -3949,13 +3950,14 @@ virQEMUCapsNewForBinaryInternal(const char *binary,
}
static
virQEMUCapsPtr
virQEMUCapsNewForBinary
(
const
char
*
binary
,
virQEMUCapsNewForBinary
(
virCapsPtr
caps
,
const
char
*
binary
,
const
char
*
libDir
,
const
char
*
cacheDir
,
uid_t
runUid
,
gid_t
runGid
)
{
return
virQEMUCapsNewForBinaryInternal
(
binary
,
libDir
,
cacheDir
,
return
virQEMUCapsNewForBinaryInternal
(
caps
,
binary
,
libDir
,
cacheDir
,
runUid
,
runGid
,
false
);
}
...
...
@@ -4050,7 +4052,9 @@ virQEMUCapsCacheNew(const char *libDir,
const
char
*
qemuTestCapsName
;
virQEMUCapsPtr
virQEMUCapsCacheLookup
(
virQEMUCapsCachePtr
cache
,
const
char
*
binary
)
virQEMUCapsCacheLookup
(
virCapsPtr
caps
,
virQEMUCapsCachePtr
cache
,
const
char
*
binary
)
{
virQEMUCapsPtr
ret
=
NULL
;
...
...
@@ -4070,7 +4074,7 @@ virQEMUCapsCacheLookup(virQEMUCapsCachePtr cache, const char *binary)
if
(
!
ret
)
{
VIR_DEBUG
(
"Creating capabilities for %s"
,
binary
);
ret
=
virQEMUCapsNewForBinary
(
binary
,
cache
->
libDir
,
ret
=
virQEMUCapsNewForBinary
(
caps
,
binary
,
cache
->
libDir
,
cache
->
cacheDir
,
cache
->
runUid
,
cache
->
runGid
);
if
(
ret
)
{
...
...
@@ -4090,11 +4094,12 @@ virQEMUCapsCacheLookup(virQEMUCapsCachePtr cache, const char *binary)
virQEMUCapsPtr
virQEMUCapsCacheLookupCopy
(
virQEMUCapsCachePtr
cache
,
virQEMUCapsCacheLookupCopy
(
virCapsPtr
caps
,
virQEMUCapsCachePtr
cache
,
const
char
*
binary
,
const
char
*
machineType
)
{
virQEMUCapsPtr
qemuCaps
=
virQEMUCapsCacheLookup
(
cache
,
binary
);
virQEMUCapsPtr
qemuCaps
=
virQEMUCapsCacheLookup
(
ca
ps
,
ca
che
,
binary
);
virQEMUCapsPtr
ret
;
if
(
!
qemuCaps
)
...
...
src/qemu/qemu_capabilities.h
浏览文件 @
b27adaed
...
...
@@ -452,9 +452,11 @@ void virQEMUCapsSetGICCapabilities(virQEMUCapsPtr qemuCaps,
virQEMUCapsCachePtr
virQEMUCapsCacheNew
(
const
char
*
libDir
,
const
char
*
cacheDir
,
uid_t
uid
,
gid_t
gid
);
virQEMUCapsPtr
virQEMUCapsCacheLookup
(
virQEMUCapsCachePtr
cache
,
virQEMUCapsPtr
virQEMUCapsCacheLookup
(
virCapsPtr
caps
,
virQEMUCapsCachePtr
cache
,
const
char
*
binary
);
virQEMUCapsPtr
virQEMUCapsCacheLookupCopy
(
virQEMUCapsCachePtr
cache
,
virQEMUCapsPtr
virQEMUCapsCacheLookupCopy
(
virCapsPtr
caps
,
virQEMUCapsCachePtr
cache
,
const
char
*
binary
,
const
char
*
machineType
);
virQEMUCapsPtr
virQEMUCapsCacheLookupByArch
(
virQEMUCapsCachePtr
cache
,
...
...
src/qemu/qemu_capspriv.h
浏览文件 @
b27adaed
...
...
@@ -40,7 +40,8 @@ struct _virQEMUCapsCache {
virQEMUCapsPtr
virQEMUCapsNewCopy
(
virQEMUCapsPtr
qemuCaps
);
virQEMUCapsPtr
virQEMUCapsNewForBinaryInternal
(
const
char
*
binary
,
virQEMUCapsNewForBinaryInternal
(
virCapsPtr
caps
,
const
char
*
binary
,
const
char
*
libDir
,
const
char
*
cacheDir
,
uid_t
runUid
,
...
...
src/qemu/qemu_domain.c
浏览文件 @
b27adaed
...
...
@@ -2359,7 +2359,8 @@ qemuDomainDefPostParse(virDomainDefPtr def,
!
(
def
->
emulator
=
virDomainDefGetDefaultEmulator
(
def
,
caps
)))
goto
cleanup
;
if
(
!
(
qemuCaps
=
virQEMUCapsCacheLookup
(
driver
->
qemuCapsCache
,
if
(
!
(
qemuCaps
=
virQEMUCapsCacheLookup
(
caps
,
driver
->
qemuCapsCache
,
def
->
emulator
)))
goto
cleanup
;
...
...
@@ -2390,7 +2391,7 @@ qemuDomainDefPostParse(virDomainDefPtr def,
static
int
qemuDomainDefValidate
(
const
virDomainDef
*
def
,
virCapsPtr
caps
ATTRIBUTE_UNUSED
,
virCapsPtr
caps
,
void
*
opaque
)
{
virQEMUDriverPtr
driver
=
opaque
;
...
...
@@ -2398,7 +2399,8 @@ qemuDomainDefValidate(const virDomainDef *def,
size_t
topologycpus
;
int
ret
=
-
1
;
if
(
!
(
qemuCaps
=
virQEMUCapsCacheLookup
(
driver
->
qemuCapsCache
,
if
(
!
(
qemuCaps
=
virQEMUCapsCacheLookup
(
caps
,
driver
->
qemuCapsCache
,
def
->
emulator
)))
goto
cleanup
;
...
...
@@ -2552,7 +2554,7 @@ qemuDomainChrDefDropDefaultPath(virDomainChrDefPtr chr,
static
int
qemuDomainDeviceDefPostParse
(
virDomainDeviceDefPtr
dev
,
const
virDomainDef
*
def
,
virCapsPtr
caps
ATTRIBUTE_UNUSED
,
virCapsPtr
caps
,
unsigned
int
parseFlags
,
void
*
opaque
)
{
...
...
@@ -2561,7 +2563,8 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
virQEMUDriverConfigPtr
cfg
=
virQEMUDriverGetConfig
(
driver
);
int
ret
=
-
1
;
qemuCaps
=
virQEMUCapsCacheLookup
(
driver
->
qemuCapsCache
,
def
->
emulator
);
qemuCaps
=
virQEMUCapsCacheLookup
(
caps
,
driver
->
qemuCapsCache
,
def
->
emulator
);
if
(
dev
->
type
==
VIR_DOMAIN_DEVICE_NET
&&
dev
->
data
.
net
->
type
!=
VIR_DOMAIN_NET_TYPE_HOSTDEV
&&
...
...
@@ -2758,7 +2761,7 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
static
int
qemuDomainDefAssignAddresses
(
virDomainDef
*
def
,
virCapsPtr
caps
ATTRIBUTE_UNUSED
,
virCapsPtr
caps
,
unsigned
int
parseFlags
ATTRIBUTE_UNUSED
,
void
*
opaque
)
{
...
...
@@ -2767,7 +2770,8 @@ qemuDomainDefAssignAddresses(virDomainDef *def,
int
ret
=
-
1
;
bool
newDomain
=
parseFlags
&
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE
;
if
(
!
(
qemuCaps
=
virQEMUCapsCacheLookup
(
driver
->
qemuCapsCache
,
if
(
!
(
qemuCaps
=
virQEMUCapsCacheLookup
(
caps
,
driver
->
qemuCapsCache
,
def
->
emulator
)))
goto
cleanup
;
...
...
src/qemu/qemu_driver.c
浏览文件 @
b27adaed
...
...
@@ -8376,7 +8376,8 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
if (priv->qemuCaps)
qemuCaps = virObjectRef(priv->qemuCaps);
else if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, vm->def->emulator)))
else if (!(qemuCaps = virQEMUCapsCacheLookup(caps, driver->qemuCapsCache,
vm->def->emulator)))
goto endjob;
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
...
...
@@ -15745,7 +15746,8 @@ static virDomainPtr qemuDomainQemuAttach(virConnectPtr conn,
virAsprintf(&def->name, "attach-pid-%u", pid_value) < 0)
goto cleanup;
if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, def->emulator)))
if (!(qemuCaps = virQEMUCapsCacheLookup(caps, driver->qemuCapsCache,
def->emulator)))
goto cleanup;
if (qemuAssignDeviceAliases(def, qemuCaps) < 0)
...
...
@@ -18673,7 +18675,8 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn,
if (emulatorbin) {
virArch arch_from_caps;
if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache,
if (!(qemuCaps = virQEMUCapsCacheLookup(caps,
driver->qemuCapsCache,
emulatorbin)))
goto cleanup;
...
...
src/qemu/qemu_process.c
浏览文件 @
b27adaed
...
...
@@ -3248,6 +3248,7 @@ qemuProcessReconnect(void *opaque)
int
ret
;
unsigned
int
stopFlags
=
0
;
bool
jobStarted
=
false
;
virCapsPtr
caps
=
NULL
;
VIR_FREE
(
data
);
...
...
@@ -3258,6 +3259,9 @@ qemuProcessReconnect(void *opaque)
cfg
=
virQEMUDriverGetConfig
(
driver
);
priv
=
obj
->
privateData
;
if
(
!
(
caps
=
virQEMUDriverGetCapabilities
(
driver
,
false
)))
goto
error
;
if
(
qemuDomainObjBeginJob
(
driver
,
obj
,
QEMU_JOB_MODIFY
)
<
0
)
goto
error
;
jobStarted
=
true
;
...
...
@@ -3327,7 +3331,8 @@ qemuProcessReconnect(void *opaque)
* caps in the domain status, so re-query them
*/
if
(
!
priv
->
qemuCaps
&&
!
(
priv
->
qemuCaps
=
virQEMUCapsCacheLookupCopy
(
driver
->
qemuCapsCache
,
!
(
priv
->
qemuCaps
=
virQEMUCapsCacheLookupCopy
(
caps
,
driver
->
qemuCapsCache
,
obj
->
def
->
emulator
,
obj
->
def
->
os
.
machine
)))
goto
error
;
...
...
@@ -3427,6 +3432,7 @@ qemuProcessReconnect(void *opaque)
virDomainObjEndAPI
(
&
obj
);
virObjectUnref
(
conn
);
virObjectUnref
(
cfg
);
virObjectUnref
(
caps
);
virNWFilterUnlockFilterUpdates
();
return
;
...
...
@@ -4664,7 +4670,8 @@ qemuProcessInit(virQEMUDriverPtr driver,
VIR_DEBUG
(
"Determining emulator version"
);
virObjectUnref
(
priv
->
qemuCaps
);
if
(
!
(
priv
->
qemuCaps
=
virQEMUCapsCacheLookupCopy
(
driver
->
qemuCapsCache
,
if
(
!
(
priv
->
qemuCaps
=
virQEMUCapsCacheLookupCopy
(
caps
,
driver
->
qemuCapsCache
,
vm
->
def
->
emulator
,
vm
->
def
->
os
.
machine
)))
goto
cleanup
;
...
...
@@ -6282,7 +6289,8 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
VIR_DEBUG
(
"Determining emulator version"
);
virObjectUnref
(
priv
->
qemuCaps
);
if
(
!
(
priv
->
qemuCaps
=
virQEMUCapsCacheLookupCopy
(
driver
->
qemuCapsCache
,
if
(
!
(
priv
->
qemuCaps
=
virQEMUCapsCacheLookupCopy
(
caps
,
driver
->
qemuCapsCache
,
vm
->
def
->
emulator
,
vm
->
def
->
os
.
machine
)))
goto
error
;
...
...
tests/qemucapsprobe.c
浏览文件 @
b27adaed
...
...
@@ -70,7 +70,7 @@ main(int argc, char **argv)
if
(
virThreadCreate
(
&
thread
,
false
,
eventLoop
,
NULL
)
<
0
)
return
EXIT_FAILURE
;
if
(
!
(
caps
=
virQEMUCapsNewForBinaryInternal
(
argv
[
1
],
"/tmp"
,
NULL
,
if
(
!
(
caps
=
virQEMUCapsNewForBinaryInternal
(
NULL
,
argv
[
1
],
"/tmp"
,
NULL
,
-
1
,
-
1
,
true
)))
return
EXIT_FAILURE
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录