Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
78439117
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看板
提交
78439117
编写于
11月 04, 2008
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add support for -uuid and -domid args to QEMU
上级
cbb1dd0a
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
68 addition
and
4 deletion
+68
-4
ChangeLog
ChangeLog
+11
-0
src/qemu_conf.c
src/qemu_conf.c
+18
-0
src/qemu_conf.h
src/qemu_conf.h
+2
-0
src/qemu_driver.c
src/qemu_driver.c
+5
-3
tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.args
tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.xml
tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.xml
+25
-0
tests/qemuxml2argvtest.c
tests/qemuxml2argvtest.c
+6
-1
未找到文件。
ChangeLog
浏览文件 @
78439117
Tue Nov 4 22:14:31 UTC 2008 Daniel P. Berrange <berrange@redhat.com>
Support passing UUID and ID to qemu/xenner
* src/qemu_conf.c, src/qemu_conf.h, src/qemu_driver.c: Detect
availability of -uuid and -domid args in QEMU, and use them if
available
* tests/qemuxml2argvtest.c,
tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.args,
tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.xml: Add test
case for -uuid and -domid args
Tue Nov 4 21:50:31 UTC 2008 Daniel P. Berrange <berrange@redhat.com>
Remove use of virStringList
...
...
src/qemu_conf.c
浏览文件 @
78439117
...
...
@@ -439,6 +439,10 @@ int qemudExtractVersionInfo(const char *qemu,
flags
|=
QEMUD_CMD_FLAG_NO_REBOOT
;
if
(
strstr
(
help
,
"-name"
))
flags
|=
QEMUD_CMD_FLAG_NAME
;
if
(
strstr
(
help
,
"-uuid"
))
flags
|=
QEMUD_CMD_FLAG_UUID
;
if
(
strstr
(
help
,
"-domid"
))
flags
|=
QEMUD_CMD_FLAG_DOMID
;
if
(
strstr
(
help
,
"-drive"
))
flags
|=
QEMUD_CMD_FLAG_DRIVE
;
if
(
strstr
(
help
,
"boot=on"
))
...
...
@@ -713,6 +717,8 @@ int qemudBuildCommandLine(virConnectPtr conn,
int
qenvc
=
0
,
qenva
=
0
;
const
char
**
qenv
=
NULL
;
const
char
*
emulator
;
char
uuid
[
VIR_UUID_STRING_BUFLEN
];
char
domid
[
50
];
uname
(
&
ut
);
...
...
@@ -723,6 +729,8 @@ int qemudBuildCommandLine(virConnectPtr conn,
!
ut
.
machine
[
4
])
ut
.
machine
[
1
]
=
'6'
;
virUUIDFormat
(
vm
->
def
->
uuid
,
uuid
);
/* Need to explicitly disable KQEMU if
* 1. Arch matches host arch
* 2. Guest is 'qemu'
...
...
@@ -802,6 +810,7 @@ int qemudBuildCommandLine(virConnectPtr conn,
snprintf
(
memory
,
sizeof
(
memory
),
"%lu"
,
vm
->
def
->
memory
/
1024
);
snprintf
(
vcpus
,
sizeof
(
vcpus
),
"%lu"
,
vm
->
def
->
vcpus
);
snprintf
(
domid
,
sizeof
(
domid
),
"%d"
,
vm
->
def
->
id
);
ADD_ENV_LIT
(
"LC_ALL=C"
);
...
...
@@ -834,6 +843,15 @@ int qemudBuildCommandLine(virConnectPtr conn,
ADD_ARG_LIT
(
"-name"
);
ADD_ARG_LIT
(
vm
->
def
->
name
);
}
if
(
qemuCmdFlags
&
QEMUD_CMD_FLAG_UUID
)
{
ADD_ARG_LIT
(
"-uuid"
);
ADD_ARG_LIT
(
uuid
);
}
if
(
qemuCmdFlags
&
QEMUD_CMD_FLAG_DOMID
)
{
ADD_ARG_LIT
(
"-domid"
);
ADD_ARG_LIT
(
domid
);
}
/*
* NB, -nographic *MUST* come before any serial, or monitor
* or parallel port flags due to QEMU craziness, where it
...
...
src/qemu_conf.h
浏览文件 @
78439117
...
...
@@ -44,6 +44,8 @@ enum qemud_cmd_flags {
QEMUD_CMD_FLAG_DRIVE
=
(
1
<<
3
),
QEMUD_CMD_FLAG_DRIVE_BOOT
=
(
1
<<
4
),
QEMUD_CMD_FLAG_NAME
=
(
1
<<
5
),
QEMUD_CMD_FLAG_UUID
=
(
1
<<
6
),
QEMUD_CMD_FLAG_DOMID
=
(
1
<<
7
),
/* Xenner only */
};
/* Main driver state */
...
...
src/qemu_driver.c
浏览文件 @
78439117
...
...
@@ -860,10 +860,12 @@ static int qemudStartVMDaemon(virConnectPtr conn,
return
-
1
;
}
vm
->
def
->
id
=
driver
->
nextvmid
++
;
if
(
qemudBuildCommandLine
(
conn
,
driver
,
vm
,
qemuCmdFlags
,
&
argv
,
&
progenv
,
&
tapfds
,
&
ntapfds
,
migrateFrom
)
<
0
)
{
close
(
vm
->
logfile
);
vm
->
def
->
id
=
-
1
;
vm
->
logfile
=
-
1
;
return
-
1
;
}
...
...
@@ -901,10 +903,10 @@ static int qemudStartVMDaemon(virConnectPtr conn,
ret
=
virExec
(
conn
,
argv
,
progenv
,
&
keepfd
,
&
vm
->
pid
,
vm
->
stdin_fd
,
&
vm
->
stdout_fd
,
&
vm
->
stderr_fd
,
VIR_EXEC_NONBLOCK
);
if
(
ret
==
0
)
{
vm
->
def
->
id
=
driver
->
nextvmid
++
;
if
(
ret
==
0
)
vm
->
state
=
migrateFrom
?
VIR_DOMAIN_PAUSED
:
VIR_DOMAIN_RUNNING
;
}
else
vm
->
def
->
id
=
-
1
;
for
(
i
=
0
;
argv
[
i
]
;
i
++
)
VIR_FREE
(
argv
[
i
]);
...
...
tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.args
0 → 100644
浏览文件 @
78439117
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -name QEMUGuest1 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 -domid 6 -nographic -monitor pty -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb
tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.xml
0 → 100644
浏览文件 @
78439117
<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>
<features>
<acpi/>
</features>
<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>
</devices>
</domain>
tests/qemuxml2argvtest.c
浏览文件 @
78439117
...
...
@@ -43,7 +43,10 @@ static int testCompareXMLToArgvFiles(const char *xml,
memset
(
&
vm
,
0
,
sizeof
vm
);
vm
.
def
=
vmdef
;
vm
.
def
->
id
=
-
1
;
if
(
extraFlags
&
QEMUD_CMD_FLAG_DOMID
)
vm
.
def
->
id
=
6
;
else
vm
.
def
->
id
=
-
1
;
vm
.
pid
=
-
1
;
flags
=
QEMUD_CMD_FLAG_VNC_COLON
|
...
...
@@ -196,6 +199,8 @@ mymain(int argc, char **argv)
DO_TEST
(
"input-xen"
,
0
);
DO_TEST
(
"misc-acpi"
,
0
);
DO_TEST
(
"misc-no-reboot"
,
0
);
DO_TEST
(
"misc-uuid"
,
QEMUD_CMD_FLAG_NAME
|
QEMUD_CMD_FLAG_UUID
|
QEMUD_CMD_FLAG_DOMID
);
DO_TEST
(
"net-user"
,
0
);
DO_TEST
(
"net-virtio"
,
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录