Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
fd74f74f
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看板
提交
fd74f74f
编写于
5月 16, 2013
作者:
J
Jiri Denemark
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu: Implement support for locking domain's memory pages
上级
55586638
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
79 addition
and
0 deletion
+79
-0
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.c
+2
-0
src/qemu/qemu_capabilities.h
src/qemu/qemu_capabilities.h
+1
-0
src/qemu/qemu_command.c
src/qemu/qemu_command.c
+11
-0
tests/qemuxml2argvdata/qemuxml2argv-mlock-off.args
tests/qemuxml2argvdata/qemuxml2argv-mlock-off.args
+4
-0
tests/qemuxml2argvdata/qemuxml2argv-mlock-off.xml
tests/qemuxml2argvdata/qemuxml2argv-mlock-off.xml
+15
-0
tests/qemuxml2argvdata/qemuxml2argv-mlock-on.args
tests/qemuxml2argvdata/qemuxml2argv-mlock-on.args
+4
-0
tests/qemuxml2argvdata/qemuxml2argv-mlock-on.xml
tests/qemuxml2argvdata/qemuxml2argv-mlock-on.xml
+18
-0
tests/qemuxml2argvdata/qemuxml2argv-mlock-unsupported.args
tests/qemuxml2argvdata/qemuxml2argv-mlock-unsupported.args
+4
-0
tests/qemuxml2argvdata/qemuxml2argv-mlock-unsupported.xml
tests/qemuxml2argvdata/qemuxml2argv-mlock-unsupported.xml
+15
-0
tests/qemuxml2argvtest.c
tests/qemuxml2argvtest.c
+5
-0
未找到文件。
src/qemu/qemu_capabilities.c
浏览文件 @
fd74f74f
...
...
@@ -230,6 +230,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"mem-merge"
,
"vnc-websocket"
,
"drive-discard"
,
"mlock"
,
);
struct
_virQEMUCaps
{
...
...
@@ -2246,6 +2247,7 @@ struct virQEMUCapsCommandLineProps {
static
struct
virQEMUCapsCommandLineProps
virQEMUCapsCommandLine
[]
=
{
{
"machine"
,
"mem-merge"
,
QEMU_CAPS_MEM_MERGE
},
{
"drive"
,
"discard"
,
QEMU_CAPS_DRIVE_DISCARD
},
{
"realtime"
,
"mlock"
,
QEMU_CAPS_MLOCK
},
};
static
int
...
...
src/qemu/qemu_capabilities.h
浏览文件 @
fd74f74f
...
...
@@ -187,6 +187,7 @@ enum virQEMUCapsFlags {
QEMU_CAPS_MEM_MERGE
=
146
,
/* -machine mem-merge */
QEMU_CAPS_VNC_WEBSOCKET
=
147
,
/* -vnc x:y,websocket */
QEMU_CAPS_DRIVE_DISCARD
=
148
,
/* -drive discard=off(ignore)|on(unmap) */
QEMU_CAPS_MLOCK
=
149
,
/* -realtime mlock=on|off */
QEMU_CAPS_LAST
,
/* this must always be the last item */
};
...
...
src/qemu/qemu_command.c
浏览文件 @
fd74f74f
...
...
@@ -6541,6 +6541,17 @@ qemuBuildCommandLine(virConnectPtr conn,
cfg
->
hugepagePath
,
NULL
);
}
if
(
def
->
mem
.
locked
&&
!
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_MLOCK
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"memory locking not supported by QEMU binary"
));
goto
error
;
}
if
(
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_MLOCK
))
{
virCommandAddArg
(
cmd
,
"-realtime"
);
virCommandAddArgFormat
(
cmd
,
"mlock=%s"
,
def
->
mem
.
locked
?
"on"
:
"off"
);
}
virCommandAddArg
(
cmd
,
"-smp"
);
if
(
!
(
smp
=
qemuBuildSmpArgStr
(
def
,
qemuCaps
)))
goto
error
;
...
...
tests/qemuxml2argvdata/qemuxml2argv-mlock-off.args
0 → 100644
浏览文件 @
fd74f74f
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test \
/usr/bin/qemu -S -M pc -m 214 -realtime mlock=off \
-smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
-no-acpi -boot c -usb -net none -serial none -parallel none
tests/qemuxml2argvdata/qemuxml2argv-mlock-off.xml
0 → 100644
浏览文件 @
fd74f74f
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory
unit=
'KiB'
>
219136
</memory>
<currentMemory
unit=
'KiB'
>
219136
</currentMemory>
<vcpu
placement=
'static'
>
1
</vcpu>
<os>
<type
arch=
'i686'
machine=
'pc'
>
hvm
</type>
<boot
dev=
'hd'
/>
</os>
<devices>
<emulator>
/usr/bin/qemu
</emulator>
<memballoon
model=
'none'
/>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-mlock-on.args
0 → 100644
浏览文件 @
fd74f74f
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test \
/usr/bin/qemu -S -M pc -m 214 -realtime mlock=on \
-smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
-no-acpi -boot c -usb -net none -serial none -parallel none
tests/qemuxml2argvdata/qemuxml2argv-mlock-on.xml
0 → 100644
浏览文件 @
fd74f74f
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory
unit=
'KiB'
>
219136
</memory>
<currentMemory
unit=
'KiB'
>
219136
</currentMemory>
<memoryBacking>
<locked/>
</memoryBacking>
<vcpu
placement=
'static'
>
1
</vcpu>
<os>
<type
arch=
'i686'
machine=
'pc'
>
hvm
</type>
<boot
dev=
'hd'
/>
</os>
<devices>
<emulator>
/usr/bin/qemu
</emulator>
<memballoon
model=
'none'
/>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-mlock-unsupported.args
0 → 100644
浏览文件 @
fd74f74f
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test \
/usr/bin/qemu -S -M pc -m 214 \
-smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
-no-acpi -boot c -usb -net none -serial none -parallel none
tests/qemuxml2argvdata/qemuxml2argv-mlock-unsupported.xml
0 → 100644
浏览文件 @
fd74f74f
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory
unit=
'KiB'
>
219136
</memory>
<currentMemory
unit=
'KiB'
>
219136
</currentMemory>
<vcpu
placement=
'static'
>
1
</vcpu>
<os>
<type
arch=
'i686'
machine=
'pc'
>
hvm
</type>
<boot
dev=
'hd'
/>
</os>
<devices>
<emulator>
/usr/bin/qemu
</emulator>
<memballoon
model=
'none'
/>
</devices>
</domain>
tests/qemuxml2argvtest.c
浏览文件 @
fd74f74f
...
...
@@ -1007,6 +1007,11 @@ mymain(void)
QEMU_CAPS_DEVICE_SCSI_GENERIC
,
QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX
);
DO_TEST
(
"mlock-on"
,
QEMU_CAPS_MLOCK
);
DO_TEST_FAILURE
(
"mlock-on"
,
NONE
);
DO_TEST
(
"mlock-off"
,
QEMU_CAPS_MLOCK
);
DO_TEST
(
"mlock-unsupported"
,
NONE
);
virObjectUnref
(
driver
.
config
);
virObjectUnref
(
driver
.
caps
);
virObjectUnref
(
driver
.
xmlopt
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录