Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
2c37f479
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看板
提交
2c37f479
编写于
5月 15, 2008
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support paravirt disk configuration for xenner guests
上级
60495940
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
63 addition
and
15 deletion
+63
-15
ChangeLog
ChangeLog
+11
-0
src/qemu_conf.c
src/qemu_conf.c
+6
-2
src/qemu_conf.h
src/qemu_conf.h
+1
-0
src/util.c
src/util.c
+7
-13
tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args
tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.xml
tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.xml
+35
-0
tests/qemuxml2argvtest.c
tests/qemuxml2argvtest.c
+1
-0
tests/qemuxml2xmltest.c
tests/qemuxml2xmltest.c
+1
-0
未找到文件。
ChangeLog
浏览文件 @
2c37f479
Thu May 15 11:57:08 EST 2008 Daniel P. Berrange <berrange@redhat.com>
Support paravirt disk configuration for xenner guests
* src/qemu_conf.c, src/qemu_conf.h: Add support for 'xen' disk
bus and 'xvd' disk device names for Xenner
* src/util.c: Support parsing 'xvd' disk names
* tests/qemuxml2argv-disk-xenvbd.{args,xml}: Test case data
files for xvd disks.
* tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c: Add
test case for xvd disk / xen bus type
Thu May 15 09:12:08 CEST 2008 Jim Meyering <meyering@redhat.com>
Avoid using STREQLEN with a literal; use STRPREFIX instead
...
...
src/qemu_conf.c
浏览文件 @
2c37f479
...
...
@@ -667,7 +667,8 @@ static int qemudParseDiskXML(virConnectPtr conn,
if
((
!
device
||
STREQ
((
const
char
*
)
device
,
"disk"
))
&&
!
STRPREFIX
((
const
char
*
)
target
,
"hd"
)
&&
!
STRPREFIX
((
const
char
*
)
target
,
"sd"
)
&&
!
STRPREFIX
((
const
char
*
)
target
,
"vd"
))
{
!
STRPREFIX
((
const
char
*
)
target
,
"vd"
)
&&
!
STRPREFIX
((
const
char
*
)
target
,
"xvd"
))
{
qemudReportError
(
conn
,
NULL
,
NULL
,
VIR_ERR_INTERNAL_ERROR
,
_
(
"Invalid harddisk device name: %s"
),
target
);
goto
error
;
...
...
@@ -707,6 +708,8 @@ static int qemudParseDiskXML(virConnectPtr conn,
disk
->
bus
=
QEMUD_DISK_BUS_SCSI
;
else
if
(
STREQ
((
const
char
*
)
bus
,
"virtio"
))
disk
->
bus
=
QEMUD_DISK_BUS_VIRTIO
;
else
if
(
STREQ
((
const
char
*
)
bus
,
"xen"
))
disk
->
bus
=
QEMUD_DISK_BUS_XEN
;
else
{
qemudReportError
(
conn
,
NULL
,
NULL
,
VIR_ERR_INTERNAL_ERROR
,
_
(
"Invalid bus type: %s"
),
bus
);
...
...
@@ -1435,7 +1438,8 @@ static const char *qemudBusIdToName(int busId, int qemuIF) {
const
char
*
busnames
[]
=
{
"ide"
,
(
qemuIF
?
"floppy"
:
"fdc"
),
"scsi"
,
"virtio"
};
"virtio"
,
"xen"
};
verify_true
(
ARRAY_CARDINALITY
(
busnames
)
==
QEMUD_DISK_BUS_LAST
);
return
busnames
[
busId
];
...
...
src/qemu_conf.h
浏览文件 @
2c37f479
...
...
@@ -61,6 +61,7 @@ enum qemud_vm_disk_bus {
QEMUD_DISK_BUS_FDC
,
QEMUD_DISK_BUS_SCSI
,
QEMUD_DISK_BUS_VIRTIO
,
QEMUD_DISK_BUS_XEN
,
QEMUD_DISK_BUS_LAST
};
...
...
src/util.c
浏览文件 @
2c37f479
...
...
@@ -778,25 +778,19 @@ virParseMacAddr(const char* str, unsigned char *addr)
int
virDiskNameToIndex
(
const
char
*
name
)
{
const
char
*
ptr
=
NULL
;
int
idx
=
0
;
static
char
const
*
const
drive_prefix
[]
=
{
"fd"
,
"hd"
,
"vd"
,
"sd"
,
"xvd"
};
unsigned
int
i
;
if
(
strlen
(
name
)
<
3
)
return
-
1
;
switch
(
*
name
)
{
case
'f'
:
case
'h'
:
case
'v'
:
case
's'
:
for
(
i
=
0
;
i
<
ARRAY_CARDINALITY
(
drive_prefix
);
i
++
)
{
if
(
STRPREFIX
(
name
,
drive_prefix
[
i
]))
{
ptr
=
name
+
strlen
(
drive_prefix
[
i
]);
break
;
default:
return
0
;
}
}
if
(
*
(
name
+
1
)
!=
'd'
)
if
(
!
ptr
)
return
-
1
;
ptr
=
name
+
2
;
while
(
*
ptr
)
{
idx
=
idx
*
26
;
...
...
tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args
0 → 100644
浏览文件 @
2c37f479
/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,boot=on -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2 -drive file=/tmp/data.img,if=xen,index=0 -drive file=/tmp/logs.img,if=xen,index=6 -net none -serial none -parallel none -usb
\ No newline at end of file
tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.xml
0 → 100644
浏览文件 @
2c37f479
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
1
</vcpu>
<os>
<type
arch=
'i686'
machine=
'pc'
>
hvm
</type>
<boot
dev=
'hd'
/>
</os>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
restart
</on_reboot>
<on_crash>
destroy
</on_crash>
<devices>
<emulator>
/usr/bin/qemu
</emulator>
<disk
type=
'block'
device=
'disk'
>
<source
dev=
'/dev/HostVG/QEMUGuest1'
/>
<target
dev=
'hda'
bus=
'ide'
/>
</disk>
<disk
type=
'block'
device=
'cdrom'
>
<source
dev=
'/dev/HostVG/QEMUGuest2'
/>
<target
dev=
'hdc'
bus=
'ide'
/>
<readonly/>
</disk>
<disk
type=
'file'
device=
'disk'
>
<source
file=
'/tmp/data.img'
/>
<target
dev=
'xvda'
bus=
'xen'
/>
</disk>
<disk
type=
'file'
device=
'disk'
>
<source
file=
'/tmp/logs.img'
/>
<target
dev=
'xvdg'
bus=
'xen'
/>
</disk>
</devices>
</domain>
tests/qemuxml2argvtest.c
浏览文件 @
2c37f479
...
...
@@ -153,6 +153,7 @@ main(int argc, char **argv)
DO_TEST
(
"disk-floppy"
,
0
);
DO_TEST
(
"disk-many"
,
0
);
DO_TEST
(
"disk-virtio"
,
1
);
DO_TEST
(
"disk-xenvbd"
,
1
);
DO_TEST
(
"graphics-vnc"
,
0
);
DO_TEST
(
"graphics-sdl"
,
0
);
DO_TEST
(
"input-usbmouse"
,
0
);
...
...
tests/qemuxml2xmltest.c
浏览文件 @
2c37f479
...
...
@@ -102,6 +102,7 @@ main(int argc, char **argv)
DO_TEST
(
"disk-cdrom"
);
DO_TEST
(
"disk-floppy"
);
DO_TEST
(
"disk-many"
);
DO_TEST
(
"disk-xenvbd"
);
DO_TEST
(
"graphics-vnc"
);
DO_TEST
(
"graphics-sdl"
);
DO_TEST
(
"input-usbmouse"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录