Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
a964a6da
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,发现更多精彩内容 >>
提交
a964a6da
编写于
1月 20, 2009
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support ac97 soundcard model
上级
554d82a2
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
28 addition
and
50 deletion
+28
-50
ChangeLog
ChangeLog
+9
-0
src/domain_conf.c
src/domain_conf.c
+2
-1
src/domain_conf.h
src/domain_conf.h
+1
-0
src/xend_internal.c
src/xend_internal.c
+16
-48
tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml
tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml
+0
-1
未找到文件。
ChangeLog
浏览文件 @
a964a6da
Tue
Jan
20
22
:
12
:
53
GMT
2009
Daniel
P
.
Berrange
<
berrange
@
redhat
.
com
>
*
src
/
domain_conf
.
c
,
src
/
domain_conf
.
h
:
Support
ac97
soundcard
model
*
src
/
xend_internal
.
c
:
Remove
unused
APis
and
restrict
the
'all'
device
conversion
to
just
sb16
+
es1370
*
tests
/
sexpr2xmldata
/
sexpr2xml
-
fv
-
sound
-
all
.
xml
:
Revert
earlier
mistaken
change
which
added
pcspk
device
Tue
Jan
20
22
:
06
:
53
GMT
2009
Daniel
P
.
Berrange
<
berrange
@
redhat
.
com
>
*
python
/
libvir
.
c
,
python
/
libvir
.
py
:
Use
global
thread
...
...
src/domain_conf.c
浏览文件 @
a964a6da
...
...
@@ -121,7 +121,8 @@ VIR_ENUM_IMPL(virDomainChr, VIR_DOMAIN_CHR_TYPE_LAST,
VIR_ENUM_IMPL
(
virDomainSoundModel
,
VIR_DOMAIN_SOUND_MODEL_LAST
,
"sb16"
,
"es1370"
,
"pcspk"
)
"pcspk"
,
"ac97"
)
VIR_ENUM_IMPL
(
virDomainInput
,
VIR_DOMAIN_INPUT_TYPE_LAST
,
"mouse"
,
...
...
src/domain_conf.h
浏览文件 @
a964a6da
...
...
@@ -236,6 +236,7 @@ enum virDomainSoundModel {
VIR_DOMAIN_SOUND_MODEL_SB16
,
VIR_DOMAIN_SOUND_MODEL_ES1370
,
VIR_DOMAIN_SOUND_MODEL_PCSPK
,
VIR_DOMAIN_SOUND_MODEL_ES97
,
VIR_DOMAIN_SOUND_MODEL_LAST
};
...
...
src/xend_internal.c
浏览文件 @
a964a6da
...
...
@@ -746,52 +746,6 @@ urlencode(const char *string)
}
#endif
/* ! PROXY */
/* Applicable sound models */
static
const
char
*
const
sound_models
[]
=
{
"sb16"
,
"es1370"
};
/**
* is_sound_model_valid:
* @model : model string to check against whitelist
*
* checks passed model string against whitelist of acceptable models
*
* Returns 0 if invalid, 1 otherwise
*/
int
is_sound_model_valid
(
const
char
*
model
)
{
int
i
;
for
(
i
=
0
;
i
<
sizeof
(
sound_models
)
/
sizeof
(
*
sound_models
);
++
i
)
{
if
(
STREQ
(
model
,
sound_models
[
i
]))
{
return
1
;
}
}
return
0
;
}
/**
* is_sound_model_conflict:
* @model : model string to look for duplicates of
* @soundstr : soundhw string for the form m1,m2,m3 ...
*
* Returns 0 if no conflict, 1 otherwise
*/
int
is_sound_model_conflict
(
const
char
*
model
,
const
char
*
soundstr
)
{
char
*
dupe
;
char
*
cur
=
(
char
*
)
soundstr
;
while
((
dupe
=
strstr
(
cur
,
model
)))
{
if
((
(
dupe
==
cur
)
||
// (Start of line |
(
*
(
dupe
-
1
)
==
','
)
)
&&
// Preceded by comma) &
(
(
dupe
[
strlen
(
model
)]
==
','
)
||
// (Ends with comma |
(
dupe
[
strlen
(
model
)]
==
'\0'
)
))
// Ends whole string)
return
1
;
else
cur
=
dupe
+
strlen
(
model
);
}
return
0
;
}
/* PUBLIC FUNCTIONS */
/**
...
...
@@ -1866,11 +1820,25 @@ xenDaemonParseSxprSound(virConnectPtr conn,
if
(
STREQ
(
str
,
"all"
))
{
int
i
;
/*
* Special compatability code for Xen with a bogus
* sound=all in config.
*
* NB delibrately, don't include all possible
* sound models anymore, just the 2 that were
* historically present in Xen's QEMU.
*
* ie just es1370 + sb16.
*
* Hence use of MODEL_ES1370 + 1, instead of MODEL_LAST
*/
if
(
VIR_ALLOC_N
(
def
->
sounds
,
VIR_DOMAIN_SOUND_MODEL_
LAST
)
<
0
)
VIR_DOMAIN_SOUND_MODEL_
ES1370
+
1
)
<
0
)
goto
no_memory
;
for
(
i
=
0
;
i
<
VIR_DOMAIN_SOUND_MODEL_LAST
;
i
++
)
{
for
(
i
=
0
;
i
<
(
VIR_DOMAIN_SOUND_MODEL_ES1370
+
1
)
;
i
++
)
{
virDomainSoundDefPtr
sound
;
if
(
VIR_ALLOC
(
sound
)
<
0
)
goto
no_memory
;
...
...
tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml
浏览文件 @
a964a6da
...
...
@@ -38,6 +38,5 @@
<graphics
type=
'vnc'
port=
'5903'
autoport=
'no'
keymap=
'ja'
/>
<sound
model=
'sb16'
/>
<sound
model=
'es1370'
/>
<sound
model=
'pcspk'
/>
</devices>
</domain>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录