Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
6fda7ea5
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看板
提交
6fda7ea5
编写于
4月 16, 2010
作者:
J
Jiri Denemark
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tests: Add tests for CPU selection in qemu driver
上级
9237e955
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
303 addition
and
0 deletion
+303
-0
tests/qemuxml2argvdata/qemu.sh
tests/qemuxml2argvdata/qemu.sh
+64
-0
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.args
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.xml
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.xml
+28
-0
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.args
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.xml
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.xml
+35
-0
tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.args
tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.xml
tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.xml
+21
-0
tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.args
tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.xml
tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.xml
+25
-0
tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.args
tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.xml
tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.xml
+38
-0
tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.args
tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.xml
tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.xml
+21
-0
tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.args
tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.xml
tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.xml
+22
-0
tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.args
tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.xml
tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.xml
+21
-0
tests/qemuxml2argvtest.c
tests/qemuxml2argvtest.c
+20
-0
未找到文件。
tests/qemuxml2argvdata/qemu.sh
0 → 100755
浏览文件 @
6fda7ea5
#! /bin/sh
candidates
=
"/usr/bin/qemu-kvm
/usr/libexec/qemu-kvm
/usr/bin/qemu-system-x86_64
/usr/bin/qemu"
qemu
=
for
candidate
in
$candidates
;
do
if
test
-x
$candidate
;
then
qemu
=
$candidate
break
fi
done
real_qemu
()
{
if
test
x
$qemu
!=
x
;
then
exec
$qemu
"
$@
"
else
return
1
fi
}
faked_machine
()
{
echo
"pc"
}
faked_cpu
()
{
cat
<<
EOF
x86 Opteron_G3
x86 Opteron_G2
x86 Opteron_G1
x86 Nehalem
x86 Penryn
x86 Conroe
x86 [n270]
x86 [athlon]
x86 [pentium3]
x86 [pentium2]
x86 [pentium]
x86 [486]
x86 [coreduo]
x86 [qemu32]
x86 [kvm64]
x86 [core2duo]
x86 [phenom]
x86 [qemu64]
x86 [host]
EOF
}
case
$*
in
"-M ?"
)
faked_machine
;;
"-cpu ?"
)
faked_cpu
;;
*
)
real_qemu
"
$@
"
;;
esac
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.args
0 → 100644
浏览文件 @
6fda7ea5
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc -cpu qemu64,-svm,-lm,-nx,-syscall,-clflush,-pse36,-mca -m 214 -smp 6 -nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot n -net none -serial none -parallel none -usb
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.xml
0 → 100644
浏览文件 @
6fda7ea5
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
6
</vcpu>
<os>
<type
arch=
'x86_64'
machine=
'pc'
>
hvm
</type>
<boot
dev=
'network'
/>
</os>
<cpu
match=
'exact'
>
<model>
qemu64
</model>
<feature
policy=
'disable'
name=
'svm'
/>
<feature
policy=
'disable'
name=
'lm'
/>
<feature
policy=
'disable'
name=
'nx'
/>
<feature
policy=
'disable'
name=
'syscall'
/>
<feature
policy=
'disable'
name=
'clflush'
/>
<feature
policy=
'disable'
name=
'pse36'
/>
<feature
policy=
'disable'
name=
'mca'
/>
</cpu>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
<on_crash>
destroy
</on_crash>
<devices>
<emulator>
/./qemu.sh
</emulator>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.args
0 → 100644
浏览文件 @
6fda7ea5
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc -cpu core2duo,+lahf_lm,+3dnowext,+xtpr,+ds_cpl,+tm,+ht,+ds,-nx -m 214 -smp 6 -nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot n -net none -serial none -parallel none -usb
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.xml
0 → 100644
浏览文件 @
6fda7ea5
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
6
</vcpu>
<os>
<type
arch=
'x86_64'
machine=
'pc'
>
hvm
</type>
<boot
dev=
'network'
/>
</os>
<cpu
match=
'exact'
>
<model>
core2duo
</model>
<feature
name=
'lahf_lm'
policy=
'require'
/>
<feature
name=
'xtpr'
policy=
'require'
/>
<feature
name=
'cx16'
policy=
'disable'
/>
<feature
name=
'tm2'
policy=
'disable'
/>
<feature
name=
'ds_cpl'
policy=
'require'
/>
<feature
name=
'pbe'
policy=
'disable'
/>
<feature
name=
'tm'
policy=
'optional'
/>
<feature
name=
'ht'
policy=
'require'
/>
<feature
name=
'ss'
policy=
'disable'
/>
<feature
name=
'ds'
policy=
'require'
/>
<feature
name=
'nx'
policy=
'disable'
/>
<feature
name=
'3dnowext'
policy=
'force'
/>
<feature
name=
'sse4a'
policy=
'optional'
/>
<feature
name=
'wdt'
policy=
'forbid'
/>
</cpu>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
<on_crash>
destroy
</on_crash>
<devices>
<emulator>
/./qemu.sh
</emulator>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.args
0 → 100644
浏览文件 @
6fda7ea5
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc -cpu core2duo,+lahf_lm,+xtpr,+cx16,+tm2,+est,+vmx,+ds_cpl,+pbe,+tm,+ht,+ss,+acpi,+ds -m 214 -smp 6 -nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot n -net none -serial none -parallel none -usb
tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.xml
0 → 100644
浏览文件 @
6fda7ea5
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
6
</vcpu>
<os>
<type
arch=
'i686'
machine=
'pc'
>
hvm
</type>
<boot
dev=
'network'
/>
</os>
<cpu
match=
'minimum'
>
<model>
486
</model>
</cpu>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
<on_crash>
destroy
</on_crash>
<devices>
<emulator>
/./qemu.sh
</emulator>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.args
0 → 100644
浏览文件 @
6fda7ea5
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc -cpu core2duo,+lahf_lm,+xtpr,+cx16,+tm2,+est,+vmx,+ds_cpl,+pbe,+tm,+ht,+ss,+acpi,+ds,-lm,-nx,-syscall -m 214 -smp 6 -nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot n -net none -serial none -parallel none -usb
tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.xml
0 → 100644
浏览文件 @
6fda7ea5
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
6
</vcpu>
<os>
<type
arch=
'x86_64'
machine=
'pc'
>
hvm
</type>
<boot
dev=
'network'
/>
</os>
<cpu
match=
'minimum'
>
<model>
qemu64
</model>
<feature
policy=
'disable'
name=
'svm'
/>
<feature
policy=
'disable'
name=
'lm'
/>
<feature
policy=
'disable'
name=
'nx'
/>
<feature
policy=
'disable'
name=
'syscall'
/>
</cpu>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
<on_crash>
destroy
</on_crash>
<devices>
<emulator>
/./qemu.sh
</emulator>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.args
0 → 100644
浏览文件 @
6fda7ea5
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc -cpu core2duo,+lahf_lm,+3dnowext,+xtpr,+est,+vmx,+ds_cpl,+tm,+ht,+acpi,+ds,-nx -m 214 -smp 6 -nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot n -net none -serial none -parallel none -usb
tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.xml
0 → 100644
浏览文件 @
6fda7ea5
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
6
</vcpu>
<os>
<type
arch=
'x86_64'
machine=
'pc'
>
hvm
</type>
<boot
dev=
'network'
/>
</os>
<cpu
match=
'strict'
>
<model>
core2duo
</model>
<feature
name=
'lahf_lm'
policy=
'require'
/>
<feature
name=
'xtpr'
policy=
'require'
/>
<feature
name=
'cx16'
policy=
'disable'
/>
<feature
name=
'tm2'
policy=
'disable'
/>
<feature
name=
'est'
policy=
'optional'
/>
<feature
name=
'vmx'
policy=
'optional'
/>
<feature
name=
'ds_cpl'
policy=
'require'
/>
<feature
name=
'pbe'
policy=
'disable'
/>
<feature
name=
'tm'
policy=
'optional'
/>
<feature
name=
'ht'
policy=
'require'
/>
<feature
name=
'ss'
policy=
'disable'
/>
<feature
name=
'acpi'
policy=
'optional'
/>
<feature
name=
'ds'
policy=
'require'
/>
<feature
name=
'nx'
policy=
'disable'
/>
<feature
name=
'3dnowext'
policy=
'force'
/>
<feature
name=
'sse4a'
policy=
'optional'
/>
<feature
name=
'wdt'
policy=
'forbid'
/>
</cpu>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
<on_crash>
destroy
</on_crash>
<devices>
<emulator>
/./qemu.sh
</emulator>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.args
0 → 100644
浏览文件 @
6fda7ea5
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc -m 214 -smp 6,sockets=3,cores=2,threads=1 -nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot n -net none -serial none -parallel none -usb
tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.xml
0 → 100644
浏览文件 @
6fda7ea5
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
6
</vcpu>
<os>
<type
arch=
'x86_64'
machine=
'pc'
>
hvm
</type>
<boot
dev=
'network'
/>
</os>
<cpu>
<topology
sockets=
"3"
cores=
"2"
threads=
"1"
/>
</cpu>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
<on_crash>
destroy
</on_crash>
<devices>
<emulator>
/./qemu.sh
</emulator>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.args
0 → 100644
浏览文件 @
6fda7ea5
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc -cpu core2duo -m 214 -smp 6,sockets=1,cores=2,threads=3 -nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot n -net none -serial none -parallel none -usb
tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.xml
0 → 100644
浏览文件 @
6fda7ea5
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
6
</vcpu>
<os>
<type
arch=
'x86_64'
machine=
'pc'
>
hvm
</type>
<boot
dev=
'network'
/>
</os>
<cpu
match=
'exact'
>
<model>
core2duo
</model>
<topology
sockets=
"1"
cores=
"2"
threads=
"3"
/>
</cpu>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
<on_crash>
destroy
</on_crash>
<devices>
<emulator>
/./qemu.sh
</emulator>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.args
0 → 100644
浏览文件 @
6fda7ea5
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test ./qemu.sh -S -M pc -m 214 -smp 6 -nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot n -net none -serial none -parallel none -usb
tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.xml
0 → 100644
浏览文件 @
6fda7ea5
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
6
</vcpu>
<os>
<type
arch=
'x86_64'
machine=
'pc'
>
hvm
</type>
<boot
dev=
'network'
/>
</os>
<cpu>
<topology
sockets=
"3"
cores=
"2"
threads=
"1"
/>
</cpu>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
<on_crash>
destroy
</on_crash>
<devices>
<emulator>
/./qemu.sh
</emulator>
</devices>
</domain>
tests/qemuxml2argvtest.c
浏览文件 @
6fda7ea5
...
...
@@ -15,11 +15,13 @@
# include "testutils.h"
# include "qemu/qemu_conf.h"
# include "datatypes.h"
# include "cpu/cpu_map.h"
# include "testutilsqemu.h"
static
char
*
progname
;
static
char
*
abs_srcdir
;
static
const
char
*
abs_top_srcdir
;
static
struct
qemud_driver
driver
;
# define MAX_FILE 4096
...
...
@@ -221,6 +223,7 @@ mymain(int argc, char **argv)
{
int
ret
=
0
;
char
cwd
[
PATH_MAX
];
char
map
[
PATH_MAX
];
progname
=
argv
[
0
];
...
...
@@ -233,6 +236,10 @@ mymain(int argc, char **argv)
if
(
!
abs_srcdir
)
abs_srcdir
=
getcwd
(
cwd
,
sizeof
(
cwd
));
abs_top_srcdir
=
getenv
(
"abs_top_srcdir"
);
if
(
!
abs_top_srcdir
)
abs_top_srcdir
=
".."
;
if
((
driver
.
caps
=
testQemuCapsInit
())
==
NULL
)
return
EXIT_FAILURE
;
if
((
driver
.
stateDir
=
strdup
(
"/nowhere"
))
==
NULL
)
...
...
@@ -247,6 +254,10 @@ mymain(int argc, char **argv)
if
(
!
(
driver
.
spicePassword
=
strdup
(
"123456"
)))
return
EXIT_FAILURE
;
snprintf
(
map
,
PATH_MAX
,
"%s/src/cpu/cpu_map.xml"
,
abs_top_srcdir
);
if
(
cpuMapOverride
(
map
)
<
0
)
return
EXIT_FAILURE
;
# define DO_TEST_FULL(name, extraFlags, migrateFrom, expectError) \
do { \
const struct testInfo info = { \
...
...
@@ -452,6 +463,15 @@ mymain(int argc, char **argv)
DO_TEST
(
"smp"
,
QEMUD_CMD_FLAG_SMP_TOPOLOGY
,
false
);
DO_TEST
(
"cpu-topology1"
,
QEMUD_CMD_FLAG_SMP_TOPOLOGY
,
false
);
DO_TEST
(
"cpu-topology2"
,
QEMUD_CMD_FLAG_SMP_TOPOLOGY
,
false
);
DO_TEST
(
"cpu-topology3"
,
0
,
false
);
DO_TEST
(
"cpu-minimum1"
,
0
,
false
);
DO_TEST
(
"cpu-minimum2"
,
0
,
false
);
DO_TEST
(
"cpu-exact1"
,
0
,
false
);
DO_TEST
(
"cpu-exact2"
,
0
,
false
);
DO_TEST
(
"cpu-strict1"
,
0
,
false
);
free
(
driver
.
stateDir
);
virCapabilitiesFree
(
driver
.
caps
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录