Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
be22d073
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
be22d073
编写于
2月 16, 2015
作者:
P
Peter Krempa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
conf: numa: Add helper to get guest NUMA node count and refactor users
Add an accessor so that a later refactor is simpler.
上级
ba2183a3
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
21 addition
and
6 deletion
+21
-6
src/conf/domain_conf.c
src/conf/domain_conf.c
+1
-1
src/conf/numa_conf.c
src/conf/numa_conf.c
+13
-2
src/conf/numa_conf.h
src/conf/numa_conf.h
+3
-0
src/libvirt_private.syms
src/libvirt_private.syms
+1
-0
src/qemu/qemu_command.c
src/qemu/qemu_command.c
+3
-3
未找到文件。
src/conf/domain_conf.c
浏览文件 @
be22d073
...
@@ -13531,7 +13531,7 @@ virDomainDefParseXML(xmlDocPtr xml,
...
@@ -13531,7 +13531,7 @@ virDomainDefParseXML(xmlDocPtr xml,
if (virDomainNumatuneParseXML(def->numa,
if (virDomainNumatuneParseXML(def->numa,
def->placement_mode ==
def->placement_mode ==
VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC,
VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC,
def->cpu ? def->cpu->ncells : 0
,
virDomainNumaGetNodeCount(def->cpu)
,
ctxt) < 0)
ctxt) < 0)
goto error;
goto error;
...
...
src/conf/numa_conf.c
浏览文件 @
be22d073
...
@@ -760,14 +760,15 @@ virDomainNumaDefCPUFormat(virBufferPtr buf,
...
@@ -760,14 +760,15 @@ virDomainNumaDefCPUFormat(virBufferPtr buf,
{
{
virNumaMemAccess
memAccess
;
virNumaMemAccess
memAccess
;
char
*
cpustr
;
char
*
cpustr
;
size_t
ncells
=
virDomainNumaGetNodeCount
(
def
);
size_t
i
;
size_t
i
;
if
(
def
->
ncells
==
0
)
if
(
ncells
==
0
)
return
0
;
return
0
;
virBufferAddLit
(
buf
,
"<numa>
\n
"
);
virBufferAddLit
(
buf
,
"<numa>
\n
"
);
virBufferAdjustIndent
(
buf
,
2
);
virBufferAdjustIndent
(
buf
,
2
);
for
(
i
=
0
;
i
<
def
->
ncells
;
i
++
)
{
for
(
i
=
0
;
i
<
ncells
;
i
++
)
{
memAccess
=
def
->
cells
[
i
].
memAccess
;
memAccess
=
def
->
cells
[
i
].
memAccess
;
if
(
!
(
cpustr
=
virBitmapFormat
(
def
->
cells
[
i
].
cpumask
)))
if
(
!
(
cpustr
=
virBitmapFormat
(
def
->
cells
[
i
].
cpumask
)))
...
@@ -813,3 +814,13 @@ virDomainNumaNew(void)
...
@@ -813,3 +814,13 @@ virDomainNumaNew(void)
return
ret
;
return
ret
;
}
}
size_t
virDomainNumaGetNodeCount
(
virCPUDefPtr
numa
)
{
if
(
!
numa
)
return
0
;
return
numa
->
ncells
;
}
src/conf/numa_conf.h
浏览文件 @
be22d073
...
@@ -86,6 +86,9 @@ int virDomainNumatuneMaybeGetNodeset(virDomainNumaPtr numatune,
...
@@ -86,6 +86,9 @@ int virDomainNumatuneMaybeGetNodeset(virDomainNumaPtr numatune,
virBitmapPtr
*
retNodeset
,
virBitmapPtr
*
retNodeset
,
int
cellid
);
int
cellid
);
size_t
virDomainNumaGetNodeCount
(
virCPUDefPtr
numa
)
ATTRIBUTE_NONNULL
(
1
);
/*
/*
* Formatters
* Formatters
*/
*/
...
...
src/libvirt_private.syms
浏览文件 @
be22d073
...
@@ -629,6 +629,7 @@ virNodeDeviceObjUnlock;
...
@@ -629,6 +629,7 @@ virNodeDeviceObjUnlock;
# conf/numa_conf.h
# conf/numa_conf.h
virDomainNumaEquals;
virDomainNumaEquals;
virDomainNumaFree;
virDomainNumaFree;
virDomainNumaGetNodeCount;
virDomainNumaNew;
virDomainNumaNew;
virDomainNumatuneFormatNodeset;
virDomainNumatuneFormatNodeset;
virDomainNumatuneFormatXML;
virDomainNumatuneFormatXML;
...
...
src/qemu/qemu_command.c
浏览文件 @
be22d073
...
@@ -7121,7 +7121,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg,
...
@@ -7121,7 +7121,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg,
bool
needBackend
=
false
;
bool
needBackend
=
false
;
int
rc
;
int
rc
;
int
ret
=
-
1
;
int
ret
=
-
1
;
size_t
ncells
=
def
->
cpu
->
ncells
;
size_t
ncells
=
virDomainNumaGetNodeCount
(
def
->
cpu
)
;
const
long
system_page_size
=
virGetSystemPageSizeKB
();
const
long
system_page_size
=
virGetSystemPageSizeKB
();
if
(
virDomainNumatuneHasPerNodeBinding
(
def
->
numa
)
&&
if
(
virDomainNumatuneHasPerNodeBinding
(
def
->
numa
)
&&
...
@@ -8318,7 +8318,7 @@ qemuBuildCommandLine(virConnectPtr conn,
...
@@ -8318,7 +8318,7 @@ qemuBuildCommandLine(virConnectPtr conn,
virCommandAddArg
(
cmd
,
"-m"
);
virCommandAddArg
(
cmd
,
"-m"
);
def
->
mem
.
max_balloon
=
VIR_DIV_UP
(
def
->
mem
.
max_balloon
,
1024
)
*
1024
;
def
->
mem
.
max_balloon
=
VIR_DIV_UP
(
def
->
mem
.
max_balloon
,
1024
)
*
1024
;
virCommandAddArgFormat
(
cmd
,
"%llu"
,
def
->
mem
.
max_balloon
/
1024
);
virCommandAddArgFormat
(
cmd
,
"%llu"
,
def
->
mem
.
max_balloon
/
1024
);
if
(
def
->
mem
.
nhugepages
&&
(
!
def
->
cpu
||
!
def
->
cpu
->
ncells
))
{
if
(
def
->
mem
.
nhugepages
&&
!
virDomainNumaGetNodeCount
(
def
->
cpu
))
{
const
long
system_page_size
=
virGetSystemPageSizeKB
();
const
long
system_page_size
=
virGetSystemPageSizeKB
();
char
*
mem_path
=
NULL
;
char
*
mem_path
=
NULL
;
...
@@ -8398,7 +8398,7 @@ qemuBuildCommandLine(virConnectPtr conn,
...
@@ -8398,7 +8398,7 @@ qemuBuildCommandLine(virConnectPtr conn,
}
}
}
}
if
(
def
->
cpu
&&
def
->
cpu
->
ncells
)
if
(
virDomainNumaGetNodeCount
(
def
->
cpu
)
)
if
(
qemuBuildNumaArgStr
(
cfg
,
def
,
cmd
,
qemuCaps
,
nodeset
)
<
0
)
if
(
qemuBuildNumaArgStr
(
cfg
,
def
,
cmd
,
qemuCaps
,
nodeset
)
<
0
)
goto
error
;
goto
error
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录