Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
f970d848
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看板
提交
f970d848
编写于
9月 14, 2012
作者:
H
Hu Tao
提交者:
Laine Stump
9月 17, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use virBitmap to store cpupin info
上级
0fc89098
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
80 addition
and
127 deletion
+80
-127
src/conf/domain_conf.c
src/conf/domain_conf.c
+47
-101
src/conf/domain_conf.h
src/conf/domain_conf.h
+4
-2
src/libvirt_private.syms
src/libvirt_private.syms
+1
-0
src/qemu/qemu_cgroup.c
src/qemu/qemu_cgroup.c
+1
-2
src/qemu/qemu_driver.c
src/qemu/qemu_driver.c
+16
-13
src/qemu/qemu_process.c
src/qemu/qemu_process.c
+11
-9
未找到文件。
src/conf/domain_conf.c
浏览文件 @
f970d848
...
...
@@ -52,6 +52,7 @@
#include "netdev_bandwidth_conf.h"
#include "netdev_vlan_conf.h"
#include "device_conf.h"
#include "bitmap.h"
#define VIR_FROM_THIS VIR_FROM_DOMAIN
...
...
@@ -1529,10 +1530,9 @@ virDomainVcpuPinDefCopy(virDomainVcpuPinDefPtr *src, int nvcpupin)
for
(
i
=
0
;
i
<
nvcpupin
;
i
++
)
{
if
(
VIR_ALLOC
(
ret
[
i
])
<
0
)
goto
no_memory
;
if
(
VIR_ALLOC_N
(
ret
[
i
]
->
cpumask
,
VIR_DOMAIN_CPUMASK_LEN
)
<
0
)
goto
no_memory
;
ret
[
i
]
->
vcpuid
=
src
[
i
]
->
vcpuid
;
memcpy
(
ret
[
i
]
->
cpumask
,
src
[
i
]
->
cpumask
,
VIR_DOMAIN_CPUMASK_LEN
);
if
((
ret
[
i
]
->
cpumask
=
virBitmapNewCopy
(
src
[
i
]
->
cpumask
))
==
NULL
)
goto
no_memory
;
}
return
ret
;
...
...
@@ -1541,7 +1541,7 @@ no_memory:
if
(
ret
)
{
for
(
;
i
>=
0
;
--
i
)
{
if
(
ret
[
i
])
{
VIR_FREE
(
ret
[
i
]
->
cpumask
);
virBitmapFree
(
ret
[
i
]
->
cpumask
);
VIR_FREE
(
ret
[
i
]);
}
}
...
...
@@ -1553,8 +1553,17 @@ no_memory:
}
void
virDomainVcpuPinDefFree
(
virDomainVcpuPinDefPtr
*
def
,
int
nvcpupin
)
virDomainVcpuPinDefFree
(
virDomainVcpuPinDefPtr
def
)
{
if
(
def
)
{
virBitmapFree
(
def
->
cpumask
);
VIR_FREE
(
def
);
}
}
void
virDomainVcpuPinDefArrayFree
(
virDomainVcpuPinDefPtr
*
def
,
int
nvcpupin
)
{
int
i
;
...
...
@@ -1562,8 +1571,7 @@ virDomainVcpuPinDefFree(virDomainVcpuPinDefPtr *def,
return
;
for
(
i
=
0
;
i
<
nvcpupin
;
i
++
)
{
VIR_FREE
(
def
[
i
]
->
cpumask
);
VIR_FREE
(
def
[
i
]);
virDomainVcpuPinDefFree
(
def
[
i
]);
}
VIR_FREE
(
def
);
...
...
@@ -1687,7 +1695,9 @@ void virDomainDefFree(virDomainDefPtr def)
virCPUDefFree
(
def
->
cpu
);
virDomainVcpuPinDefFree
(
def
->
cputune
.
vcpupin
,
def
->
cputune
.
nvcpupin
);
virDomainVcpuPinDefArrayFree
(
def
->
cputune
.
vcpupin
,
def
->
cputune
.
nvcpupin
);
virDomainVcpuPinDefFree
(
def
->
cputune
.
emulatorpin
);
VIR_FREE
(
def
->
numatune
.
memory
.
nodemask
);
...
...
@@ -8252,12 +8262,8 @@ virDomainVcpuPinDefParseXML(const xmlNodePtr node,
char
*
set
=
tmp
;
int
cpumasklen
=
VIR_DOMAIN_CPUMASK_LEN
;
if
(
VIR_ALLOC_N
(
def
->
cpumask
,
cpumasklen
)
<
0
)
{
virReportOOMError
();
goto
error
;
}
if
(
virDomainCpuSetParse
(
set
,
0
,
def
->
cpumask
,
cpumasklen
)
<
0
)
if
(
virBitmapParse
(
set
,
0
,
&
def
->
cpumask
,
cpumasklen
)
<
0
)
goto
error
;
VIR_FREE
(
tmp
);
}
else
{
...
...
@@ -8692,18 +8698,11 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
goto
error
;
}
if
(
VIR_ALLOC
(
def
->
cputune
.
emulatorpin
)
<
0
)
{
goto
no_memory
;
}
def
->
cputune
.
emulatorpin
=
virDomainVcpuPinDefParseXML
(
nodes
[
0
],
ctxt
,
def
->
maxvcpus
,
1
);
virDomainVcpuPinDefPtr
emulatorpin
=
NULL
;
emulatorpin
=
virDomainVcpuPinDefParseXML
(
nodes
[
0
],
ctxt
,
def
->
maxvcpus
,
1
);
if
(
!
emulatorpin
)
if
(
!
def
->
cputune
.
emulatorpin
)
goto
error
;
def
->
cputune
.
emulatorpin
=
emulatorpin
;
}
VIR_FREE
(
nodes
);
...
...
@@ -11422,34 +11421,6 @@ virDomainVcpuPinFindByVcpu(virDomainVcpuPinDefPtr *def,
return
NULL
;
}
static
char
*
bitmapFromBytemap
(
unsigned
char
*
bytemap
,
int
maplen
)
{
char
*
bitmap
=
NULL
;
int
i
;
if
(
VIR_ALLOC_N
(
bitmap
,
VIR_DOMAIN_CPUMASK_LEN
)
<
0
)
{
virReportOOMError
();
goto
cleanup
;
}
/* Reset bitmap to all 0s. */
for
(
i
=
0
;
i
<
VIR_DOMAIN_CPUMASK_LEN
;
i
++
)
bitmap
[
i
]
=
0
;
/* Convert bitmap (bytemap) to bitmap, which is byte map? */
for
(
i
=
0
;
i
<
maplen
;
i
++
)
{
int
cur
;
for
(
cur
=
0
;
cur
<
8
;
cur
++
)
{
if
(
bytemap
[
i
]
&
(
1
<<
cur
))
bitmap
[
i
*
8
+
cur
]
=
1
;
}
}
cleanup:
return
bitmap
;
}
int
virDomainVcpuPinAdd
(
virDomainVcpuPinDefPtr
**
vcpupin_list
,
int
*
nvcpupin
,
unsigned
char
*
cpumap
,
...
...
@@ -11457,20 +11428,21 @@ int virDomainVcpuPinAdd(virDomainVcpuPinDefPtr **vcpupin_list,
int
vcpu
)
{
virDomainVcpuPinDefPtr
vcpupin
=
NULL
;
char
*
cpumask
=
NULL
;
if
(
!
vcpupin_list
)
return
-
1
;
if
((
cpumask
=
bitmapFromBytemap
(
cpumap
,
maplen
))
==
NULL
)
return
-
1
;
vcpupin
=
virDomainVcpuPinFindByVcpu
(
*
vcpupin_list
,
*
nvcpupin
,
vcpu
);
if
(
vcpupin
)
{
vcpupin
->
vcpuid
=
vcpu
;
vcpupin
->
cpumask
=
cpumask
;
virBitmapFree
(
vcpupin
->
cpumask
);
vcpupin
->
cpumask
=
virBitmapNewData
(
cpumap
,
maplen
);
if
(
!
vcpupin
->
cpumask
)
{
virReportOOMError
();
return
-
1
;
}
return
0
;
}
...
...
@@ -11479,16 +11451,17 @@ int virDomainVcpuPinAdd(virDomainVcpuPinDefPtr **vcpupin_list,
if
(
VIR_ALLOC
(
vcpupin
)
<
0
)
{
virReportOOMError
();
VIR_FREE
(
cpumask
);
return
-
1
;
}
vcpupin
->
vcpuid
=
vcpu
;
vcpupin
->
cpumask
=
cpumask
;
vcpupin
->
cpumask
=
virBitmapNewData
(
cpumap
,
maplen
);
if
(
!
vcpupin
->
cpumask
)
{
virReportOOMError
();
return
-
1
;
}
if
(
VIR_REALLOC_N
(
*
vcpupin_list
,
*
nvcpupin
+
1
)
<
0
)
{
virReportOOMError
();
VIR_FREE
(
cpumask
);
VIR_FREE
(
vcpupin
);
return
-
1
;
}
...
...
@@ -11543,68 +11516,43 @@ virDomainEmulatorPinAdd(virDomainDefPtr def,
int
maplen
)
{
virDomainVcpuPinDefPtr
emulatorpin
=
NULL
;
char
*
cpumask
=
NULL
;
int
i
;
if
(
VIR_ALLOC_N
(
cpumask
,
VIR_DOMAIN_CPUMASK_LEN
)
<
0
)
{
virReportOOMError
();
goto
cleanup
;
}
/* Convert bitmap (cpumap) to cpumask, which is byte map. */
for
(
i
=
0
;
i
<
maplen
;
i
++
)
{
int
cur
;
for
(
cur
=
0
;
cur
<
8
;
cur
++
)
{
if
(
cpumap
[
i
]
&
(
1
<<
cur
))
cpumask
[
i
*
8
+
cur
]
=
1
;
}
}
if
(
!
def
->
cputune
.
emulatorpin
)
{
/* No emulatorpin exists yet. */
if
(
VIR_ALLOC
(
emulatorpin
)
<
0
)
{
virReportOOMError
();
goto
cleanup
;
return
-
1
;
}
emulatorpin
->
vcpuid
=
-
1
;
emulatorpin
->
cpumask
=
cpumask
;
emulatorpin
->
cpumask
=
virBitmapNewData
(
cpumap
,
maplen
);
if
(
!
emulatorpin
->
cpumask
)
return
-
1
;
def
->
cputune
.
emulatorpin
=
emulatorpin
;
}
else
{
/* Since there is only 1 emulatorpin for each vm,
* juest replace the old one.
*/
VIR_FREE
(
def
->
cputune
.
emulatorpin
->
cpumask
);
def
->
cputune
.
emulatorpin
->
cpumask
=
cpumask
;
virBitmapFree
(
def
->
cputune
.
emulatorpin
->
cpumask
);
def
->
cputune
.
emulatorpin
->
cpumask
=
virBitmapNewData
(
cpumap
,
maplen
);
if
(
!
def
->
cputune
.
emulatorpin
->
cpumask
)
return
-
1
;
}
return
0
;
cleanup:
VIR_FREE
(
cpumask
);
return
-
1
;
}
int
virDomainEmulatorPinDel
(
virDomainDefPtr
def
)
{
virDomainVcpuPinDefPtr
emulatorpin
=
NULL
;
/* No emulatorpin exists yet */
if
(
!
def
->
cputune
.
emulatorpin
)
{
return
0
;
}
emulatorpin
=
def
->
cputune
.
emulatorpin
;
VIR_FREE
(
emulatorpin
->
cpumask
);
VIR_FREE
(
emulatorpin
);
virDomainVcpuPinDefFree
(
def
->
cputune
.
emulatorpin
);
def
->
cputune
.
emulatorpin
=
NULL
;
if
(
def
->
cputune
.
emulatorpin
)
return
-
1
;
return
0
;
}
...
...
@@ -13610,8 +13558,7 @@ virDomainDefFormatInternal(virDomainDefPtr def,
def
->
cputune
.
vcpupin
[
i
]
->
vcpuid
);
char
*
cpumask
=
NULL
;
cpumask
=
virDomainCpuSetFormat
(
def
->
cputune
.
vcpupin
[
i
]
->
cpumask
,
VIR_DOMAIN_CPUMASK_LEN
);
cpumask
=
virBitmapFormat
(
def
->
cputune
.
vcpupin
[
i
]
->
cpumask
);
if
(
cpumask
==
NULL
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
...
...
@@ -13628,8 +13575,7 @@ virDomainDefFormatInternal(virDomainDefPtr def,
virBufferAsprintf
(
buf
,
" <emulatorpin "
);
char
*
cpumask
=
NULL
;
cpumask
=
virDomainCpuSetFormat
(
def
->
cputune
.
emulatorpin
->
cpumask
,
VIR_DOMAIN_CPUMASK_LEN
);
cpumask
=
virBitmapFormat
(
def
->
cputune
.
emulatorpin
->
cpumask
);
if
(
cpumask
==
NULL
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"failed to format cpuset for emulator"
));
...
...
src/conf/domain_conf.h
浏览文件 @
f970d848
...
...
@@ -46,6 +46,7 @@
# include "virnetdevvlan.h"
# include "virobject.h"
# include "device_conf.h"
# include "bitmap.h"
/* forward declarations of all device types, required by
* virDomainDeviceDef
...
...
@@ -1565,10 +1566,11 @@ typedef struct _virDomainVcpuPinDef virDomainVcpuPinDef;
typedef
virDomainVcpuPinDef
*
virDomainVcpuPinDefPtr
;
struct
_virDomainVcpuPinDef
{
int
vcpuid
;
char
*
cpumask
;
virBitmapPtr
cpumask
;
};
void
virDomainVcpuPinDefFree
(
virDomainVcpuPinDefPtr
*
def
,
int
nvcpupin
);
void
virDomainVcpuPinDefFree
(
virDomainVcpuPinDefPtr
def
);
void
virDomainVcpuPinDefArrayFree
(
virDomainVcpuPinDefPtr
*
def
,
int
nvcpupin
);
virDomainVcpuPinDefPtr
*
virDomainVcpuPinDefCopy
(
virDomainVcpuPinDefPtr
*
src
,
int
nvcpupin
);
...
...
src/libvirt_private.syms
浏览文件 @
f970d848
...
...
@@ -527,6 +527,7 @@ virDomainTimerTickpolicyTypeToString;
virDomainTimerTrackTypeFromString;
virDomainTimerTrackTypeToString;
virDomainVcpuPinAdd;
virDomainVcpuPinDefArrayFree;
virDomainVcpuPinDefCopy;
virDomainVcpuPinDefFree;
virDomainVcpuPinDel;
...
...
src/qemu/qemu_cgroup.c
浏览文件 @
f970d848
...
...
@@ -513,8 +513,7 @@ int qemuSetupCgroupEmulatorPin(virCgroupPtr cgroup,
int
rc
=
0
;
char
*
new_cpus
=
NULL
;
new_cpus
=
virDomainCpuSetFormat
(
vcpupin
->
cpumask
,
VIR_DOMAIN_CPUMASK_LEN
);
new_cpus
=
virBitmapFormat
(
vcpupin
->
cpumask
);
if
(
!
new_cpus
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"failed to convert cpu mask"
));
...
...
src/qemu/qemu_driver.c
浏览文件 @
f970d848
...
...
@@ -3790,7 +3790,7 @@ qemudDomainPinVcpuFlags(virDomainPtr dom,
if
(
virDomainVcpuPinAdd
(
&
newVcpuPin
,
&
newVcpuPinNum
,
cpumap
,
maplen
,
vcpu
)
<
0
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"failed to update vcpupin"
));
virDomainVcpuPinDefFree
(
newVcpuPin
,
newVcpuPinNum
);
virDomainVcpuPinDef
Array
Free
(
newVcpuPin
,
newVcpuPinNum
);
goto
cleanup
;
}
...
...
@@ -3823,7 +3823,7 @@ qemudDomainPinVcpuFlags(virDomainPtr dom,
}
}
else
{
if
(
vm
->
def
->
cputune
.
vcpupin
)
virDomainVcpuPinDefFree
(
vm
->
def
->
cputune
.
vcpupin
,
vm
->
def
->
cputune
.
nvcpupin
);
virDomainVcpuPinDef
Array
Free
(
vm
->
def
->
cputune
.
vcpupin
,
vm
->
def
->
cputune
.
nvcpupin
);
vm
->
def
->
cputune
.
vcpupin
=
newVcpuPin
;
vm
->
def
->
cputune
.
nvcpupin
=
newVcpuPinNum
;
...
...
@@ -3831,7 +3831,7 @@ qemudDomainPinVcpuFlags(virDomainPtr dom,
}
if
(
newVcpuPin
)
virDomainVcpuPinDefFree
(
newVcpuPin
,
newVcpuPinNum
);
virDomainVcpuPinDef
Array
Free
(
newVcpuPin
,
newVcpuPinNum
);
if
(
virDomainSaveStatus
(
driver
->
caps
,
driver
->
stateDir
,
vm
)
<
0
)
goto
cleanup
;
...
...
@@ -3906,8 +3906,9 @@ qemudDomainGetVcpuPinInfo(virDomainPtr dom,
int
maxcpu
,
hostcpus
,
vcpu
,
pcpu
;
int
n
;
virDomainVcpuPinDefPtr
*
vcpupin_list
;
char
*
cpumask
=
NULL
;
virBitmapPtr
cpumask
=
NULL
;
unsigned
char
*
cpumap
;
bool
pinned
;
virCheckFlags
(
VIR_DOMAIN_AFFECT_LIVE
|
VIR_DOMAIN_AFFECT_CONFIG
,
-
1
);
...
...
@@ -3966,7 +3967,9 @@ qemudDomainGetVcpuPinInfo(virDomainPtr dom,
cpumask
=
vcpupin_list
[
n
]
->
cpumask
;
cpumap
=
VIR_GET_CPUMAP
(
cpumaps
,
maplen
,
vcpu
);
for
(
pcpu
=
0
;
pcpu
<
maxcpu
;
pcpu
++
)
{
if
(
cpumask
[
pcpu
]
==
0
)
if
(
virBitmapGetBit
(
cpumask
,
pcpu
,
&
pinned
)
<
0
)
goto
cleanup
;
if
(
!
pinned
)
VIR_UNUSE_CPU
(
cpumap
,
pcpu
);
}
}
...
...
@@ -4050,7 +4053,7 @@ qemudDomainPinEmulator(virDomainPtr dom,
if
(
virDomainVcpuPinAdd
(
&
newVcpuPin
,
&
newVcpuPinNum
,
cpumap
,
maplen
,
-
1
)
<
0
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"failed to update vcpupin"
));
virDomainVcpuPinDefFree
(
newVcpuPin
,
newVcpuPinNum
);
virDomainVcpuPinDef
Array
Free
(
newVcpuPin
,
newVcpuPinNum
);
goto
cleanup
;
}
...
...
@@ -4088,16 +4091,13 @@ qemudDomainPinEmulator(virDomainPtr dom,
goto
cleanup
;
}
}
else
{
if
(
vm
->
def
->
cputune
.
emulatorpin
)
{
VIR_FREE
(
vm
->
def
->
cputune
.
emulatorpin
->
cpumask
);
VIR_FREE
(
vm
->
def
->
cputune
.
emulatorpin
);
}
virDomainVcpuPinDefFree
(
vm
->
def
->
cputune
.
emulatorpin
);
vm
->
def
->
cputune
.
emulatorpin
=
newVcpuPin
[
0
];
VIR_FREE
(
newVcpuPin
);
}
if
(
newVcpuPin
)
virDomainVcpuPinDefFree
(
newVcpuPin
,
newVcpuPinNum
);
virDomainVcpuPinDef
Array
Free
(
newVcpuPin
,
newVcpuPinNum
);
}
else
{
virReportError
(
VIR_ERR_OPERATION_INVALID
,
"%s"
,
_
(
"cpu affinity is not supported"
));
...
...
@@ -4156,7 +4156,8 @@ qemudDomainGetEmulatorPinInfo(virDomainPtr dom,
int
ret
=
-
1
;
int
maxcpu
,
hostcpus
,
pcpu
;
virDomainVcpuPinDefPtr
emulatorpin
=
NULL
;
char
*
cpumask
=
NULL
;
virBitmapPtr
cpumask
=
NULL
;
bool
pinned
;
virCheckFlags
(
VIR_DOMAIN_AFFECT_LIVE
|
VIR_DOMAIN_AFFECT_CONFIG
,
-
1
);
...
...
@@ -4205,7 +4206,9 @@ qemudDomainGetEmulatorPinInfo(virDomainPtr dom,
cpumask
=
emulatorpin
->
cpumask
;
for
(
pcpu
=
0
;
pcpu
<
maxcpu
;
pcpu
++
)
{
if
(
cpumask
[
pcpu
]
==
0
)
if
(
virBitmapGetBit
(
cpumask
,
pcpu
,
&
pinned
)
<
0
)
goto
cleanup
;
if
(
!
pinned
)
VIR_UNUSE_CPU
(
cpumaps
,
pcpu
);
}
...
...
src/qemu/qemu_process.c
浏览文件 @
f970d848
...
...
@@ -1959,7 +1959,7 @@ qemuProcessSetVcpuAffinites(virConnectPtr conn,
virDomainDefPtr
def
=
vm
->
def
;
virNodeInfo
nodeinfo
;
pid_t
vcpupid
;
unsigned
char
*
cpumask
;
virBitmapPtr
cpumask
;
int
vcpu
,
cpumaplen
,
hostcpus
,
maxcpu
,
n
;
unsigned
char
*
cpumap
=
NULL
;
int
ret
=
-
1
;
...
...
@@ -1994,13 +1994,12 @@ qemuProcessSetVcpuAffinites(virConnectPtr conn,
vcpu
=
def
->
cputune
.
vcpupin
[
n
]
->
vcpuid
;
memset
(
cpumap
,
0
,
cpumaplen
);
cpumask
=
(
unsigned
char
*
)
def
->
cputune
.
vcpupin
[
n
]
->
cpumask
;
cpumask
=
def
->
cputune
.
vcpupin
[
n
]
->
cpumask
;
vcpupid
=
priv
->
vcpupids
[
vcpu
];
for
(
i
=
0
;
i
<
VIR_DOMAIN_CPUMASK_LEN
;
i
++
)
{
if
(
cpumask
[
i
])
VIR_USE_CPU
(
cpumap
,
i
);
}
i
=
-
1
;
while
((
i
=
virBitmapNextSetBit
(
cpumask
,
i
))
>=
0
)
VIR_USE_CPU
(
cpumap
,
i
);
if
(
virProcessInfoSetAffinity
(
vcpupid
,
cpumap
,
...
...
@@ -2023,11 +2022,12 @@ qemuProcessSetEmulatorAffinites(virConnectPtr conn,
{
virDomainDefPtr
def
=
vm
->
def
;
pid_t
pid
=
vm
->
pid
;
unsigned
char
*
cpumask
=
NULL
;
virBitmapPtr
cpumask
=
NULL
;
unsigned
char
*
cpumap
=
NULL
;
virNodeInfo
nodeinfo
;
int
cpumaplen
,
hostcpus
,
maxcpu
,
i
;
int
ret
=
-
1
;
bool
result
;
if
(
virNodeGetInfo
(
conn
,
&
nodeinfo
)
!=
0
)
return
-
1
;
...
...
@@ -2047,9 +2047,11 @@ qemuProcessSetEmulatorAffinites(virConnectPtr conn,
return
-
1
;
}
cpumask
=
(
unsigned
char
*
)
def
->
cputune
.
emulatorpin
->
cpumask
;
cpumask
=
def
->
cputune
.
emulatorpin
->
cpumask
;
for
(
i
=
0
;
i
<
VIR_DOMAIN_CPUMASK_LEN
;
i
++
)
{
if
(
cpumask
[
i
])
if
(
virBitmapGetBit
(
cpumask
,
i
,
&
result
)
<
0
)
goto
cleanup
;
if
(
result
)
VIR_USE_CPU
(
cpumap
,
i
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录