Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
a4e0f234
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看板
提交
a4e0f234
编写于
3月 10, 2015
作者:
M
Maxim Nestratov
提交者:
Peter Krempa
3月 11, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
parallels: cpumask support
Signed-off-by:
N
Maxim Nestratov
<
mnestratov@parallels.com
>
上级
616003d6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
19 deletion
+17
-19
src/parallels/parallels_driver.c
src/parallels/parallels_driver.c
+1
-3
src/parallels/parallels_sdk.c
src/parallels/parallels_sdk.c
+16
-15
src/parallels/parallels_utils.h
src/parallels/parallels_utils.h
+0
-1
未找到文件。
src/parallels/parallels_driver.c
浏览文件 @
a4e0f234
...
...
@@ -777,7 +777,6 @@ parallelsDomainGetVcpus(virDomainPtr domain,
int
maplen
)
{
parallelsConnPtr
privconn
=
domain
->
conn
->
privateData
;
parallelsDomObjPtr
privdomdata
=
NULL
;
virDomainObjPtr
privdom
=
NULL
;
size_t
i
;
int
v
,
maxcpu
,
hostcpus
;
...
...
@@ -799,7 +798,6 @@ parallelsDomainGetVcpus(virDomainPtr domain,
goto
cleanup
;
}
privdomdata
=
privdom
->
privateData
;
if
((
hostcpus
=
nodeGetCPUCount
())
<
0
)
goto
cleanup
;
...
...
@@ -820,7 +818,7 @@ parallelsDomainGetVcpus(virDomainPtr domain,
int
tmpmapLen
=
0
;
memset
(
cpumaps
,
0
,
maplen
*
maxinfo
);
virBitmapToData
(
privdom
data
->
cpumask
,
&
tmpmap
,
&
tmpmapLen
);
virBitmapToData
(
privdom
->
def
->
cpumask
,
&
tmpmap
,
&
tmpmapLen
);
if
(
tmpmapLen
>
maplen
)
tmpmapLen
=
maplen
;
...
...
src/parallels/parallels_sdk.c
浏览文件 @
a4e0f234
...
...
@@ -412,7 +412,6 @@ prlsdkDomObjFreePrivate(void *p)
return
;
PrlHandle_Free
(
pdom
->
sdkdom
);
virBitmapFree
(
pdom
->
cpumask
);
VIR_FREE
(
pdom
->
uuid
);
VIR_FREE
(
pdom
->
home
);
VIR_FREE
(
p
);
...
...
@@ -1053,8 +1052,7 @@ prlsdkConvertDomainState(VIRTUAL_MACHINE_STATE domainState,
static
int
prlsdkConvertCpuInfo
(
PRL_HANDLE
sdkdom
,
virDomainDefPtr
def
,
parallelsDomObjPtr
pdom
)
virDomainDefPtr
def
)
{
char
*
buf
;
PRL_UINT32
buflen
=
0
;
...
...
@@ -1085,11 +1083,11 @@ prlsdkConvertCpuInfo(PRL_HANDLE sdkdom,
pret
=
PrlVmCfg_GetCpuMask
(
sdkdom
,
buf
,
&
buflen
);
if
(
strlen
(
buf
)
==
0
)
{
if
(
!
(
pdom
->
cpumask
=
virBitmapNew
(
hostcpus
)))
if
(
!
(
def
->
cpumask
=
virBitmapNew
(
hostcpus
)))
goto
cleanup
;
virBitmapSetAll
(
pdom
->
cpumask
);
virBitmapSetAll
(
def
->
cpumask
);
}
else
{
if
(
virBitmapParse
(
buf
,
0
,
&
pdom
->
cpumask
,
hostcpus
)
<
0
)
if
(
virBitmapParse
(
buf
,
0
,
&
def
->
cpumask
,
hostcpus
)
<
0
)
goto
cleanup
;
}
...
...
@@ -1217,7 +1215,7 @@ prlsdkLoadDomain(parallelsConnPtr privconn,
convert to Kbytes */
def
->
mem
.
cur_balloon
=
def
->
mem
.
max_balloon
;
if
(
prlsdkConvertCpuInfo
(
sdkdom
,
def
,
pdom
)
<
0
)
if
(
prlsdkConvertCpuInfo
(
sdkdom
,
def
)
<
0
)
goto
error
;
if
(
prlsdkConvertCpuMode
(
sdkdom
,
def
)
<
0
)
...
...
@@ -1807,13 +1805,6 @@ prlsdkCheckUnsupportedParams(PRL_HANDLE sdkdom, virDomainDefPtr def)
return
-
1
;
}
if
(
def
->
cpumask
!=
NULL
)
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"changing cpu mask is not supported "
"by parallels driver"
));
return
-
1
;
}
if
(
def
->
cputune
.
shares
||
def
->
cputune
.
sharesSpecified
||
def
->
cputune
.
period
||
...
...
@@ -2842,6 +2833,7 @@ prlsdkDoApplyConfig(PRL_HANDLE sdkdom,
size_t
i
;
char
uuidstr
[
VIR_UUID_STRING_BUFLEN
+
2
];
bool
needBoot
=
true
;
char
*
mask
=
NULL
;
if
(
prlsdkCheckUnsupportedParams
(
sdkdom
,
def
)
<
0
)
return
-
1
;
...
...
@@ -2869,6 +2861,13 @@ prlsdkDoApplyConfig(PRL_HANDLE sdkdom,
pret
=
PrlVmCfg_SetCpuCount
(
sdkdom
,
def
->
vcpus
);
prlsdkCheckRetGoto
(
pret
,
error
);
if
(
!
(
mask
=
virBitmapFormat
(
def
->
cpumask
)))
goto
error
;
pret
=
PrlVmCfg_SetCpuMask
(
sdkdom
,
mask
);
prlsdkCheckRetGoto
(
pret
,
error
);
VIR_FREE
(
mask
);
if
(
prlsdkClearDevices
(
sdkdom
)
<
0
)
goto
error
;
...
...
@@ -2912,7 +2911,9 @@ prlsdkDoApplyConfig(PRL_HANDLE sdkdom,
return
0
;
error:
return
-
1
;
VIR_FREE
(
mask
);
return
-
1
;
}
int
...
...
src/parallels/parallels_utils.h
浏览文件 @
a4e0f234
...
...
@@ -69,7 +69,6 @@ struct parallelsDomObj {
int
id
;
char
*
uuid
;
char
*
home
;
virBitmapPtr
cpumask
;
PRL_HANDLE
sdkdom
;
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录