Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
40a82f30
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看板
提交
40a82f30
编写于
5月 16, 2008
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make QEMU test suite independant of host OS capabilities
上级
a770c2ab
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
109 addition
and
17 deletion
+109
-17
ChangeLog
ChangeLog
+12
-0
src/qemu_conf.c
src/qemu_conf.c
+0
-13
src/qemu_driver.c
src/qemu_driver.c
+14
-0
tests/Makefile.am
tests/Makefile.am
+2
-2
tests/qemuxml2argvtest.c
tests/qemuxml2argvtest.c
+3
-1
tests/qemuxml2xmltest.c
tests/qemuxml2xmltest.c
+2
-1
tests/testutilsqemu.c
tests/testutilsqemu.c
+71
-0
tests/testutilsqemu.h
tests/testutilsqemu.h
+5
-0
未找到文件。
ChangeLog
浏览文件 @
40a82f30
Fri May 16 12:50:08 EST 2008 Daniel P. Berrange <berrange@redhat.com>
Make QEMU test cases independant of QEMU capabilities on
the host OS.
* src/qemu_conf.c, src/qemu_driver.c: Move stat() check on
qemu binary out of qemudBuildCommandLine() and into caller.
* tests/Makefile.am: Add testutilsqemu.{c,h} to qemu tests
* tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c: use
stable capability set in tests, independant of host OS.
* tests/testutilsqemu.c, tests/testutilsqemu.h: Define a
stable capability set for test suites
Fri May 16 11:29:30 CEST 2008 Jim Meyering <meyering@redhat.com>
* src/xml.c: Include "c-ctype.h".
...
...
src/qemu_conf.c
浏览文件 @
40a82f30
...
...
@@ -2326,7 +2326,6 @@ int qemudBuildCommandLine(virConnectPtr conn,
char
memory
[
50
];
char
vcpus
[
50
];
char
boot
[
QEMUD_MAX_BOOT_DEVS
+
1
];
struct
stat
sb
;
struct
qemud_vm_disk_def
*
disk
=
vm
->
def
->
disks
;
struct
qemud_vm_net_def
*
net
=
vm
->
def
->
nets
;
struct
qemud_vm_input_def
*
input
=
vm
->
def
->
inputs
;
...
...
@@ -2336,18 +2335,6 @@ int qemudBuildCommandLine(virConnectPtr conn,
struct
utsname
ut
;
int
disableKQEMU
=
0
;
/* Make sure the binary we are about to try exec'ing exists.
* Technically we could catch the exec() failure, but that's
* in a sub-process so its hard to feed back a useful error
*/
if
(
stat
(
vm
->
def
->
os
.
binary
,
&
sb
)
<
0
)
{
qemudReportError
(
conn
,
NULL
,
NULL
,
VIR_ERR_INTERNAL_ERROR
,
_
(
"Cannot find QEMU binary %s: %s"
),
vm
->
def
->
os
.
binary
,
strerror
(
errno
));
return
-
1
;
}
if
(
vm
->
qemuVersion
==
0
)
{
if
(
qemudExtractVersionInfo
(
vm
->
def
->
os
.
binary
,
&
(
vm
->
qemuVersion
),
...
...
src/qemu_driver.c
浏览文件 @
40a82f30
...
...
@@ -646,6 +646,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
char
**
argv
=
NULL
,
**
tmp
;
int
i
,
ret
;
char
logfile
[
PATH_MAX
];
struct
stat
sb
;
if
(
qemudIsActiveVM
(
vm
))
{
qemudReportError
(
conn
,
NULL
,
NULL
,
VIR_ERR_INTERNAL_ERROR
,
...
...
@@ -702,6 +703,19 @@ static int qemudStartVMDaemon(virConnectPtr conn,
return
-
1
;
}
/* Make sure the binary we are about to try exec'ing exists.
* Technically we could catch the exec() failure, but that's
* in a sub-process so its hard to feed back a useful error
*/
if
(
stat
(
vm
->
def
->
os
.
binary
,
&
sb
)
<
0
)
{
qemudReportError
(
conn
,
NULL
,
NULL
,
VIR_ERR_INTERNAL_ERROR
,
_
(
"Cannot find QEMU binary %s: %s"
),
vm
->
def
->
os
.
binary
,
strerror
(
errno
));
return
-
1
;
}
if
(
qemudBuildCommandLine
(
conn
,
driver
,
vm
,
&
argv
)
<
0
)
{
close
(
vm
->
logfile
);
vm
->
logfile
=
-
1
;
...
...
tests/Makefile.am
浏览文件 @
40a82f30
...
...
@@ -100,12 +100,12 @@ xmconfigtest_SOURCES = \
xmconfigtest_LDADD
=
$(LDADDS)
qemuxml2argvtest_SOURCES
=
\
qemuxml2argvtest.c
\
qemuxml2argvtest.c
testutilsqemu.c testutilsqemu.h
\
testutils.c testutils.h
qemuxml2argvtest_LDADD
=
$(LDADDS)
qemuxml2xmltest_SOURCES
=
\
qemuxml2xmltest.c
\
qemuxml2xmltest.c
testutilsqemu.c testutilsqemu.h
\
testutils.c testutils.h
qemuxml2xmltest_LDADD
=
$(LDADDS)
...
...
tests/qemuxml2argvtest.c
浏览文件 @
40a82f30
...
...
@@ -14,6 +14,8 @@
#include "testutils.h"
#include "qemu_conf.h"
#include "testutilsqemu.h"
static
char
*
progname
;
static
char
*
abs_srcdir
;
static
struct
qemud_driver
driver
;
...
...
@@ -130,7 +132,7 @@ main(int argc, char **argv)
if
(
!
abs_srcdir
)
abs_srcdir
=
getcwd
(
cwd
,
sizeof
(
cwd
));
driver
.
caps
=
qemud
CapsInit
();
driver
.
caps
=
testQemu
CapsInit
();
#define DO_TEST(name, extraFlags) \
do { \
...
...
tests/qemuxml2xmltest.c
浏览文件 @
40a82f30
...
...
@@ -13,6 +13,7 @@
#include "internal.h"
#include "testutils.h"
#include "qemu_conf.h"
#include "testutilsqemu.h"
static
char
*
progname
;
static
char
*
abs_srcdir
;
...
...
@@ -86,7 +87,7 @@ main(int argc, char **argv)
if
(
!
abs_srcdir
)
abs_srcdir
=
getcwd
(
cwd
,
sizeof
(
cwd
));
driver
.
caps
=
qemud
CapsInit
();
driver
.
caps
=
testQemu
CapsInit
();
#define DO_TEST(name) \
if (virtTestRun("QEMU XML-2-XML " name, \
...
...
tests/testutilsqemu.c
0 → 100644
浏览文件 @
40a82f30
#include <sys/utsname.h>
#include <stdlib.h>
#include "testutilsqemu.h"
virCapsPtr
testQemuCapsInit
(
void
)
{
struct
utsname
utsname
;
virCapsPtr
caps
;
virCapsGuestPtr
guest
;
static
const
char
*
const
x86_machines
[]
=
{
"pc"
,
"isapc"
};
static
const
char
*
const
xen_machines
[]
=
{
"xenner"
};
uname
(
&
utsname
);
if
((
caps
=
virCapabilitiesNew
(
utsname
.
machine
,
0
,
0
))
==
NULL
)
return
NULL
;
if
((
guest
=
virCapabilitiesAddGuest
(
caps
,
"hvm"
,
"i686"
,
32
,
"/usr/bin/qemu"
,
NULL
,
2
,
x86_machines
))
==
NULL
)
goto
cleanup
;
if
(
virCapabilitiesAddGuestDomain
(
guest
,
"qemu"
,
NULL
,
NULL
,
0
,
NULL
)
==
NULL
)
goto
cleanup
;
if
((
guest
=
virCapabilitiesAddGuest
(
caps
,
"hvm"
,
"x86_64"
,
64
,
"/usr/bin/qemu-system-x86_64"
,
NULL
,
2
,
x86_machines
))
==
NULL
)
goto
cleanup
;
if
(
virCapabilitiesAddGuestDomain
(
guest
,
"qemu"
,
NULL
,
NULL
,
0
,
NULL
)
==
NULL
)
goto
cleanup
;
if
(
virCapabilitiesAddGuestDomain
(
guest
,
"kvm"
,
"/usr/bin/kvm"
,
NULL
,
0
,
NULL
)
==
NULL
)
goto
cleanup
;
if
((
guest
=
virCapabilitiesAddGuest
(
caps
,
"xen"
,
"x86_64"
,
64
,
"/usr/bin/xenner"
,
NULL
,
1
,
xen_machines
))
==
NULL
)
goto
cleanup
;
if
(
virCapabilitiesAddGuestDomain
(
guest
,
"kvm"
,
"/usr/bin/kvm"
,
NULL
,
0
,
NULL
)
==
NULL
)
goto
cleanup
;
return
caps
;
cleanup:
virCapabilitiesFree
(
caps
);
return
NULL
;
}
tests/testutilsqemu.h
0 → 100644
浏览文件 @
40a82f30
#include "capabilities.h"
virCapsPtr
testQemuCapsInit
(
void
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录