Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
0ee6f885
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看板
提交
0ee6f885
编写于
6年前
作者:
A
Andrea Bolognani
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
conf: Parse and format HPT maxpagesize
Signed-off-by:
N
Andrea Bolognani
<
abologna@redhat.com
>
上级
15f9db53
无相关合并请求
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
63 addition
and
16 deletion
+63
-16
docs/formatdomain.html.in
docs/formatdomain.html.in
+9
-2
docs/schemas/domaincommon.rng
docs/schemas/domaincommon.rng
+14
-7
src/conf/domain_conf.c
src/conf/domain_conf.c
+31
-5
src/conf/domain_conf.h
src/conf/domain_conf.h
+1
-0
tests/qemuxml2argvdata/pseries-features.xml
tests/qemuxml2argvdata/pseries-features.xml
+3
-1
tests/qemuxml2argvtest.c
tests/qemuxml2argvtest.c
+1
-0
tests/qemuxml2xmloutdata/pseries-features.xml
tests/qemuxml2xmloutdata/pseries-features.xml
+3
-1
tests/qemuxml2xmltest.c
tests/qemuxml2xmltest.c
+1
-0
未找到文件。
docs/formatdomain.html.in
浏览文件 @
0ee6f885
...
...
@@ -1922,7 +1922,9 @@
<
pvspinlock state='on'/
>
<
gic version='2'/
>
<
ioapic driver='qemu'/
>
<
hpt resizing='required'/
>
<
hpt resizing='required'
>
<
maxpagesize unit='MiB'
>
16
<
/maxpagesize
>
<
/hpt
>
<
vmcoreinfo state='on'/
>
<
smm state='on'
>
<
tseg unit='MiB'
>
48
<
/tseg
>
...
...
@@ -2149,7 +2151,12 @@
support; and
<code>
required
</code>
, which prevents the guest from
starting unless both the guest and the host support HPT resizing. If
the attribute is not defined, the hypervisor default will be used.
<span
class=
"since"
>
Since 3.10.0
</span>
(QEMU/KVM only)
<span
class=
"since"
>
Since 3.10.0
</span>
(QEMU/KVM only).
<p>
The optional
<code>
maxpagesize
</code>
subelement can be used to
limit the usable page size for HPT guests. Common values are 64 KiB,
16 MiB and 16 GiB; when not specified, the hypervisor default will
be used.
<span
class=
"since"
>
Since 4.5.0
</span>
(QEMU/KVM only).
</p>
</dd>
<dt><code>
vmcoreinfo
</code></dt>
<dd>
Enable QEMU vmcoreinfo device to let the guest kernel save debug
...
...
This diff is collapsed.
Click to expand it.
docs/schemas/domaincommon.rng
浏览文件 @
0ee6f885
...
...
@@ -5127,13 +5127,20 @@
<define
name=
"hpt"
>
<element
name=
"hpt"
>
<attribute
name=
"resizing"
>
<choice>
<value>
enabled
</value>
<value>
disabled
</value>
<value>
required
</value>
</choice>
</attribute>
<optional>
<attribute
name=
"resizing"
>
<choice>
<value>
enabled
</value>
<value>
disabled
</value>
<value>
required
</value>
</choice>
</attribute>
</optional>
<optional>
<element
name=
"maxpagesize"
>
<ref
name=
'scaledInteger'
/>
</element>
</optional>
</element>
</define>
...
...
This diff is collapsed.
Click to expand it.
src/conf/domain_conf.c
浏览文件 @
0ee6f885
...
...
@@ -19807,8 +19807,24 @@ virDomainDefParseXML(xmlDocPtr xml,
VIR_FREE(tmp);
}
if (def->hpt_resizing != VIR_DOMAIN_HPT_RESIZING_NONE)
if (virDomainParseScaledValue("./features/hpt/maxpagesize",
NULL,
ctxt,
&def->hpt_maxpagesize,
1024,
ULLONG_MAX,
false) < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
"%s",
_("Unable to parse HPT maxpagesize setting"));
goto error;
}
def->hpt_maxpagesize = VIR_DIV_UP(def->hpt_maxpagesize, 1024);
if (def->hpt_resizing != VIR_DOMAIN_HPT_RESIZING_NONE ||
def->hpt_maxpagesize > 0) {
def->features[val] = VIR_TRISTATE_SWITCH_ON;
}
break;
/* coverity[dead_error_begin] */
...
...
@@ -21987,15 +22003,18 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src,
case VIR_DOMAIN_FEATURE_HPT:
if (src->features[i] != dst->features[i] ||
src->hpt_resizing != dst->hpt_resizing) {
src->hpt_resizing != dst->hpt_resizing ||
src->hpt_maxpagesize != dst->hpt_maxpagesize) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("State of feature '%s' differs: "
"source: '%s,%s=%s
', destination: '%s,%s=%s
'"),
"source: '%s,%s=%s
,%s=%llu', destination: '%s,%s=%s,%s=%llu
'"),
featureName,
virTristateSwitchTypeToString(src->features[i]),
"resizing", virDomainHPTResizingTypeToString(src->hpt_resizing),
"maxpagesize", src->hpt_maxpagesize,
virTristateSwitchTypeToString(dst->features[i]),
"resizing", virDomainHPTResizingTypeToString(dst->hpt_resizing));
"resizing", virDomainHPTResizingTypeToString(dst->hpt_resizing),
"maxpagesize", dst->hpt_maxpagesize);
return false;
}
break;
...
...
@@ -27778,15 +27797,22 @@ virDomainDefFormatInternal(virDomainDefPtr def,
break;
virBufferFreeAndReset(&attributeBuf);
virBufferFreeAndReset(&childrenBuf);
if (def->hpt_resizing != VIR_DOMAIN_HPT_RESIZING_NONE) {
virBufferAsprintf(&attributeBuf,
" resizing='%s'",
virDomainHPTResizingTypeToString(def->hpt_resizing));
}
if (def->hpt_maxpagesize > 0) {
virBufferSetChildIndent(&childrenBuf, buf);
virBufferAsprintf(&childrenBuf,
"<maxpagesize unit='KiB'>%llu</maxpagesize>\n",
def->hpt_maxpagesize);
}
if (virXMLFormatElement(buf, "hpt",
&attributeBuf,
NULL
) < 0) {
&attributeBuf,
&childrenBuf
) < 0) {
goto error;
}
break;
...
...
This diff is collapsed.
Click to expand it.
src/conf/domain_conf.h
浏览文件 @
0ee6f885
...
...
@@ -2439,6 +2439,7 @@ struct _virDomainDef {
unsigned
int
hyperv_spinlocks
;
virGICVersion
gic_version
;
virDomainHPTResizing
hpt_resizing
;
unsigned
long
long
hpt_maxpagesize
;
/* Stored in KiB */
char
*
hyperv_vendor_id
;
int
apic_eoi
;
...
...
This diff is collapsed.
Click to expand it.
tests/qemuxml2argvdata/pseries-features.xml
浏览文件 @
0ee6f885
...
...
@@ -7,7 +7,9 @@
<type
arch=
'ppc64'
machine=
'pseries'
>
hvm
</type>
</os>
<features>
<hpt
resizing=
'required'
/>
<hpt
resizing=
'required'
>
<maxpagesize
unit=
'GiB'
>
1
</maxpagesize>
</hpt>
</features>
<devices>
<emulator>
/usr/bin/qemu-system-ppc64
</emulator>
...
...
This diff is collapsed.
Click to expand it.
tests/qemuxml2argvtest.c
浏览文件 @
0ee6f885
...
...
@@ -1849,6 +1849,7 @@ mymain(void)
DO_TEST
(
"pseries-features"
,
QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE
,
QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE
,
QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT
);
DO_TEST_FAILURE
(
"pseries-features"
,
QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE
);
...
...
This diff is collapsed.
Click to expand it.
tests/qemuxml2xmloutdata/pseries-features.xml
浏览文件 @
0ee6f885
...
...
@@ -9,7 +9,9 @@
<boot
dev=
'hd'
/>
</os>
<features>
<hpt
resizing=
'required'
/>
<hpt
resizing=
'required'
>
<maxpagesize
unit=
'KiB'
>
1048576
</maxpagesize>
</hpt>
</features>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
...
...
This diff is collapsed.
Click to expand it.
tests/qemuxml2xmltest.c
浏览文件 @
0ee6f885
...
...
@@ -619,6 +619,7 @@ mymain(void)
DO_TEST
(
"pseries-features"
,
QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE
,
QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE
,
QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT
);
DO_TEST
(
"pseries-serial-native"
,
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
反馈
建议
客服
返回
顶部