Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
3cb55cb5
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看板
提交
3cb55cb5
编写于
1月 30, 2009
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix crash using bogus arch in QEMU
上级
896761e5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
58 addition
and
3 deletion
+58
-3
ChangeLog
ChangeLog
+10
-0
src/capabilities.c
src/capabilities.c
+24
-0
src/capabilities.h
src/capabilities.h
+6
-0
src/domain_conf.c
src/domain_conf.c
+8
-1
src/qemu_conf.c
src/qemu_conf.c
+10
-2
未找到文件。
ChangeLog
浏览文件 @
3cb55cb5
Fri Jan 30 16:12:22 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
Fix crash when using bogus arch type
* src/capabilities.c, src/capabilities.h: Add method to query
for supported arch+ostype combo
* src/domain_conf.c: Validate requested arch+ostype against
supported capabilities
* src/qemu_conf.c: Sanity check to avoid deferencing NULL
machine type
Fri Jan 30 16:58:22 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
Misc QEMU driver startup fixes
...
...
src/capabilities.c
浏览文件 @
3cb55cb5
...
...
@@ -432,6 +432,30 @@ virCapabilitiesSupportsGuestOSType(virCapsPtr caps,
}
/**
* virCapabilitiesSupportsGuestOSType:
* @caps: capabilities to query
* @ostype: OS type to search for (eg 'hvm', 'xen')
* @arch: Architecture to search for (eg, 'i686', 'x86_64')
*
* Returns non-zero if the capabilities support the
* requested operating system type
*/
extern
int
virCapabilitiesSupportsGuestArch
(
virCapsPtr
caps
,
const
char
*
ostype
,
const
char
*
arch
)
{
int
i
;
for
(
i
=
0
;
i
<
caps
->
nguests
;
i
++
)
{
if
(
STREQ
(
caps
->
guests
[
i
]
->
ostype
,
ostype
)
&&
STREQ
(
caps
->
guests
[
i
]
->
arch
.
name
,
arch
))
return
1
;
}
return
0
;
}
/**
* virCapabilitiesDefaultGuestArch:
* @caps: capabilities to query
...
...
src/capabilities.h
浏览文件 @
3cb55cb5
...
...
@@ -162,6 +162,12 @@ virCapabilitiesAddGuestFeature(virCapsGuestPtr guest,
extern
int
virCapabilitiesSupportsGuestOSType
(
virCapsPtr
caps
,
const
char
*
ostype
);
extern
int
virCapabilitiesSupportsGuestArch
(
virCapsPtr
caps
,
const
char
*
ostype
,
const
char
*
arch
);
extern
const
char
*
virCapabilitiesDefaultGuestArch
(
virCapsPtr
caps
,
const
char
*
ostype
);
...
...
src/domain_conf.c
浏览文件 @
3cb55cb5
...
...
@@ -2038,7 +2038,14 @@ static virDomainDefPtr virDomainDefParseXML(virConnectPtr conn,
}
def
->
os
.
arch
=
virXPathString
(
conn
,
"string(./os/type[1]/@arch)"
,
ctxt
);
if
(
!
def
->
os
.
arch
)
{
if
(
def
->
os
.
arch
)
{
if
(
!
virCapabilitiesSupportsGuestArch
(
caps
,
def
->
os
.
type
,
def
->
os
.
arch
))
{
virDomainReportError
(
conn
,
VIR_ERR_INTERNAL_ERROR
,
_
(
"os type '%s' & arch '%s' combination is not supported"
),
def
->
os
.
type
,
def
->
os
.
arch
);
goto
error
;
}
}
else
{
const
char
*
defaultArch
=
virCapabilitiesDefaultGuestArch
(
caps
,
def
->
os
.
type
);
if
(
defaultArch
==
NULL
)
{
virDomainReportError
(
conn
,
VIR_ERR_INTERNAL_ERROR
,
...
...
src/qemu_conf.c
浏览文件 @
3cb55cb5
...
...
@@ -837,8 +837,16 @@ int qemudBuildCommandLine(virConnectPtr conn,
ADD_ARG_LIT
(
emulator
);
ADD_ARG_LIT
(
"-S"
);
ADD_ARG_LIT
(
"-M"
);
ADD_ARG_LIT
(
vm
->
def
->
os
.
machine
);
/* This should *never* be NULL, since we always provide
* a machine in the capabilities data for QEMU. So this
* check is just here as a safety in case the unexpected
* happens */
if
(
vm
->
def
->
os
.
machine
)
{
ADD_ARG_LIT
(
"-M"
);
ADD_ARG_LIT
(
vm
->
def
->
os
.
machine
);
}
if
(
disableKQEMU
)
ADD_ARG_LIT
(
"-no-kqemu"
);
ADD_ARG_LIT
(
"-m"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录