Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
5ab80fc1
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,发现更多精彩内容 >>
提交
5ab80fc1
编写于
3月 07, 2014
作者:
M
Michal Privoznik
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
src/qemu: Utilize more of VIR_(APPEND|INSERT|DELETE)_ELEMENT
Signed-off-by:
N
Michal Privoznik
<
mprivozn@redhat.com
>
上级
3f8b040d
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
48 addition
and
67 deletion
+48
-67
src/qemu/qemu_command.c
src/qemu/qemu_command.c
+37
-51
src/qemu/qemu_conf.c
src/qemu/qemu_conf.c
+1
-7
src/qemu/qemu_conf.h
src/qemu/qemu_conf.h
+1
-1
src/qemu/qemu_driver.c
src/qemu/qemu_driver.c
+7
-5
src/qemu/qemu_monitor_json.c
src/qemu/qemu_monitor_json.c
+1
-1
src/qemu/qemu_monitor_text.c
src/qemu/qemu_monitor_text.c
+1
-2
未找到文件。
src/qemu/qemu_command.c
浏览文件 @
5ab80fc1
...
@@ -10981,15 +10981,18 @@ qemuParseCommandLineCPU(virDomainDefPtr dom,
...
@@ -10981,15 +10981,18 @@ qemuParseCommandLineCPU(virDomainDefPtr dom,
}
}
if
(
j
==
dom
->
clock
.
ntimers
)
{
if
(
j
==
dom
->
clock
.
ntimers
)
{
if
(
VIR_REALLOC_N
(
dom
->
clock
.
timers
,
j
+
1
)
<
0
||
virDomainTimerDefPtr
timer
;
VIR_ALLOC
(
dom
->
clock
.
timers
[
j
])
<
0
)
if
(
VIR_ALLOC
(
timer
)
<
0
||
goto
cleanup
;
VIR_APPEND_ELEMENT_COPY
(
dom
->
clock
.
timers
,
dom
->
clock
.
timers
[
j
]
->
name
=
VIR_DOMAIN_TIMER_NAME_KVMCLOCK
;
dom
->
clock
.
ntimers
,
timer
)
<
0
)
{
dom
->
clock
.
timers
[
j
]
->
present
=
present
;
VIR_FREE
(
timer
);
dom
->
clock
.
timers
[
j
]
->
tickpolicy
=
-
1
;
goto
cleanup
;
dom
->
clock
.
timers
[
j
]
->
track
=
-
1
;
}
dom
->
clock
.
timers
[
j
]
->
mode
=
-
1
;
timer
->
name
=
VIR_DOMAIN_TIMER_NAME_KVMCLOCK
;
dom
->
clock
.
ntimers
++
;
timer
->
present
=
present
;
timer
->
tickpolicy
=
-
1
;
timer
->
track
=
-
1
;
timer
->
mode
=
-
1
;
}
else
if
(
dom
->
clock
.
timers
[
j
]
->
present
!=
-
1
&&
}
else
if
(
dom
->
clock
.
timers
[
j
]
->
present
!=
-
1
&&
dom
->
clock
.
timers
[
j
]
->
present
!=
present
)
{
dom
->
clock
.
timers
[
j
]
->
present
!=
present
)
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
...
@@ -11225,7 +11228,7 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
...
@@ -11225,7 +11228,7 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
bool
nographics
=
false
;
bool
nographics
=
false
;
bool
fullscreen
=
false
;
bool
fullscreen
=
false
;
char
*
path
;
char
*
path
;
in
t
nnics
=
0
;
size_
t
nnics
=
0
;
const
char
**
nics
=
NULL
;
const
char
**
nics
=
NULL
;
int
video
=
VIR_DOMAIN_VIDEO_TYPE_CIRRUS
;
int
video
=
VIR_DOMAIN_VIDEO_TYPE_CIRRUS
;
int
nvirtiodisk
=
0
;
int
nvirtiodisk
=
0
;
...
@@ -11318,11 +11321,9 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
...
@@ -11318,11 +11321,9 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
if
(
STREQ
(
arg
,
"-net"
))
{
if
(
STREQ
(
arg
,
"-net"
))
{
WANT_VALUE
();
WANT_VALUE
();
if
(
STRPREFIX
(
val
,
"nic"
)
)
{
if
(
STRPREFIX
(
val
,
"nic"
)
&&
if
(
VIR_REALLOC_N
(
nics
,
nnics
+
1
)
<
0
)
VIR_APPEND_ELEMENT
(
nics
,
nnics
,
val
)
<
0
)
goto
error
;
goto
error
;
nics
[
nnics
++
]
=
val
;
}
}
}
}
}
...
@@ -11456,11 +11457,10 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
...
@@ -11456,11 +11457,10 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
vnc
->
data
.
vnc
.
autoport
=
false
;
vnc
->
data
.
vnc
.
autoport
=
false
;
}
}
if
(
VIR_
REALLOC_N
(
def
->
graphics
,
def
->
ngraphics
+
1
)
<
0
)
{
if
(
VIR_
APPEND_ELEMENT
(
def
->
graphics
,
def
->
ngraphics
,
vnc
)
<
0
)
{
virDomainGraphicsDefFree
(
vnc
);
virDomainGraphicsDefFree
(
vnc
);
goto
error
;
goto
error
;
}
}
def
->
graphics
[
def
->
ngraphics
++
]
=
vnc
;
}
else
if
(
STREQ
(
arg
,
"-m"
))
{
}
else
if
(
STREQ
(
arg
,
"-m"
))
{
int
mem
;
int
mem
;
WANT_VALUE
();
WANT_VALUE
();
...
@@ -11592,10 +11592,8 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
...
@@ -11592,10 +11592,8 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
goto
error
;
goto
error
;
}
}
if
(
VIR_
REALLOC_N
(
def
->
disks
,
def
->
ndisks
+
1
)
<
0
)
if
(
VIR_
APPEND_ELEMENT
(
def
->
disks
,
def
->
ndisks
,
disk
)
<
0
)
goto
error
;
goto
error
;
def
->
disks
[
def
->
ndisks
++
]
=
disk
;
disk
=
NULL
;
}
else
if
(
STREQ
(
arg
,
"-no-acpi"
))
{
}
else
if
(
STREQ
(
arg
,
"-no-acpi"
))
{
def
->
features
[
VIR_DOMAIN_FEATURE_ACPI
]
=
VIR_DOMAIN_FEATURE_STATE_DEFAULT
;
def
->
features
[
VIR_DOMAIN_FEATURE_ACPI
]
=
VIR_DOMAIN_FEATURE_STATE_DEFAULT
;
}
else
if
(
STREQ
(
arg
,
"-no-reboot"
))
{
}
else
if
(
STREQ
(
arg
,
"-no-reboot"
))
{
...
@@ -11732,13 +11730,12 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
...
@@ -11732,13 +11730,12 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
virDomainChrDefFree
(
chr
);
virDomainChrDefFree
(
chr
);
goto
error
;
goto
error
;
}
}
if
(
VIR_REALLOC_N
(
def
->
serials
,
def
->
nserials
+
1
)
<
0
)
{
chr
->
deviceType
=
VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL
;
chr
->
target
.
port
=
def
->
nserials
;
if
(
VIR_APPEND_ELEMENT
(
def
->
serials
,
def
->
nserials
,
chr
)
<
0
)
{
virDomainChrDefFree
(
chr
);
virDomainChrDefFree
(
chr
);
goto
error
;
goto
error
;
}
}
chr
->
deviceType
=
VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL
;
chr
->
target
.
port
=
def
->
nserials
;
def
->
serials
[
def
->
nserials
++
]
=
chr
;
}
}
}
else
if
(
STREQ
(
arg
,
"-parallel"
))
{
}
else
if
(
STREQ
(
arg
,
"-parallel"
))
{
WANT_VALUE
();
WANT_VALUE
();
...
@@ -11752,13 +11749,12 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
...
@@ -11752,13 +11749,12 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
virDomainChrDefFree
(
chr
);
virDomainChrDefFree
(
chr
);
goto
error
;
goto
error
;
}
}
if
(
VIR_REALLOC_N
(
def
->
parallels
,
def
->
nparallels
+
1
)
<
0
)
{
chr
->
deviceType
=
VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL
;
chr
->
target
.
port
=
def
->
nparallels
;
if
(
VIR_APPEND_ELEMENT
(
def
->
parallels
,
def
->
nparallels
,
chr
)
<
0
)
{
virDomainChrDefFree
(
chr
);
virDomainChrDefFree
(
chr
);
goto
error
;
goto
error
;
}
}
chr
->
deviceType
=
VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL
;
chr
->
target
.
port
=
def
->
nparallels
;
def
->
parallels
[
def
->
nparallels
++
]
=
chr
;
}
}
}
else
if
(
STREQ
(
arg
,
"-usbdevice"
))
{
}
else
if
(
STREQ
(
arg
,
"-usbdevice"
))
{
WANT_VALUE
();
WANT_VALUE
();
...
@@ -11794,19 +11790,16 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
...
@@ -11794,19 +11790,16 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
disk
->
removable
=
VIR_DOMAIN_FEATURE_STATE_DEFAULT
;
disk
->
removable
=
VIR_DOMAIN_FEATURE_STATE_DEFAULT
;
if
(
VIR_STRDUP
(
disk
->
dst
,
"sda"
)
<
0
)
if
(
VIR_STRDUP
(
disk
->
dst
,
"sda"
)
<
0
)
goto
error
;
goto
error
;
if
(
VIR_
REALLOC_N
(
def
->
disks
,
def
->
ndisks
+
1
)
<
0
)
if
(
VIR_
APPEND_ELEMENT
(
def
->
disks
,
def
->
ndisks
,
disk
)
<
0
)
goto
error
;
goto
error
;
def
->
disks
[
def
->
ndisks
++
]
=
disk
;
disk
=
NULL
;
}
else
{
}
else
{
virDomainHostdevDefPtr
hostdev
;
virDomainHostdevDefPtr
hostdev
;
if
(
!
(
hostdev
=
qemuParseCommandLineUSB
(
val
)))
if
(
!
(
hostdev
=
qemuParseCommandLineUSB
(
val
)))
goto
error
;
goto
error
;
if
(
VIR_
REALLOC_N
(
def
->
hostdevs
,
def
->
nhostdevs
+
1
)
<
0
)
{
if
(
VIR_
APPEND_ELEMENT
(
def
->
hostdevs
,
def
->
nhostdevs
,
hostdev
)
<
0
)
{
virDomainHostdevDefFree
(
hostdev
);
virDomainHostdevDefFree
(
hostdev
);
goto
error
;
goto
error
;
}
}
def
->
hostdevs
[
def
->
nhostdevs
++
]
=
hostdev
;
}
}
}
else
if
(
STREQ
(
arg
,
"-net"
))
{
}
else
if
(
STREQ
(
arg
,
"-net"
))
{
WANT_VALUE
();
WANT_VALUE
();
...
@@ -11814,11 +11807,10 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
...
@@ -11814,11 +11807,10 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
virDomainNetDefPtr
net
;
virDomainNetDefPtr
net
;
if
(
!
(
net
=
qemuParseCommandLineNet
(
xmlopt
,
val
,
nnics
,
nics
)))
if
(
!
(
net
=
qemuParseCommandLineNet
(
xmlopt
,
val
,
nnics
,
nics
)))
goto
error
;
goto
error
;
if
(
VIR_
REALLOC_N
(
def
->
nets
,
def
->
nnets
+
1
)
<
0
)
{
if
(
VIR_
APPEND_ELEMENT
(
def
->
nets
,
def
->
nnets
,
net
)
<
0
)
{
virDomainNetDefFree
(
net
);
virDomainNetDefFree
(
net
);
goto
error
;
goto
error
;
}
}
def
->
nets
[
def
->
nnets
++
]
=
net
;
}
}
}
else
if
(
STREQ
(
arg
,
"-drive"
))
{
}
else
if
(
STREQ
(
arg
,
"-drive"
))
{
WANT_VALUE
();
WANT_VALUE
();
...
@@ -11826,23 +11818,19 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
...
@@ -11826,23 +11818,19 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
nvirtiodisk
,
nvirtiodisk
,
ceph_args
!=
NULL
)))
ceph_args
!=
NULL
)))
goto
error
;
goto
error
;
if
(
VIR_REALLOC_N
(
def
->
disks
,
def
->
ndisks
+
1
)
<
0
)
goto
error
;
if
(
disk
->
bus
==
VIR_DOMAIN_DISK_BUS_VIRTIO
)
if
(
disk
->
bus
==
VIR_DOMAIN_DISK_BUS_VIRTIO
)
nvirtiodisk
++
;
nvirtiodisk
++
;
if
(
VIR_APPEND_ELEMENT
(
def
->
disks
,
def
->
ndisks
,
disk
)
<
0
)
def
->
disks
[
def
->
ndisks
++
]
=
disk
;
goto
error
;
disk
=
NULL
;
}
else
if
(
STREQ
(
arg
,
"-pcidevice"
))
{
}
else
if
(
STREQ
(
arg
,
"-pcidevice"
))
{
virDomainHostdevDefPtr
hostdev
;
virDomainHostdevDefPtr
hostdev
;
WANT_VALUE
();
WANT_VALUE
();
if
(
!
(
hostdev
=
qemuParseCommandLinePCI
(
val
)))
if
(
!
(
hostdev
=
qemuParseCommandLinePCI
(
val
)))
goto
error
;
goto
error
;
if
(
VIR_
REALLOC_N
(
def
->
hostdevs
,
def
->
nhostdevs
+
1
)
<
0
)
{
if
(
VIR_
APPEND_ELEMENT
(
def
->
hostdevs
,
def
->
nhostdevs
,
hostdev
)
<
0
)
{
virDomainHostdevDefFree
(
hostdev
);
virDomainHostdevDefFree
(
hostdev
);
goto
error
;
goto
error
;
}
}
def
->
hostdevs
[
def
->
nhostdevs
++
]
=
hostdev
;
}
else
if
(
STREQ
(
arg
,
"-soundhw"
))
{
}
else
if
(
STREQ
(
arg
,
"-soundhw"
))
{
const
char
*
start
;
const
char
*
start
;
WANT_VALUE
();
WANT_VALUE
();
...
@@ -11867,11 +11855,10 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
...
@@ -11867,11 +11855,10 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
if
(
VIR_ALLOC
(
snd
)
<
0
)
if
(
VIR_ALLOC
(
snd
)
<
0
)
goto
error
;
goto
error
;
snd
->
model
=
type
;
snd
->
model
=
type
;
if
(
VIR_
REALLOC_N
(
def
->
sounds
,
def
->
nsounds
+
1
)
<
0
)
{
if
(
VIR_
APPEND_ELEMENT
(
def
->
sounds
,
def
->
nsounds
,
snd
)
<
0
)
{
VIR_FREE
(
snd
);
VIR_FREE
(
snd
);
goto
error
;
goto
error
;
}
}
def
->
sounds
[
def
->
nsounds
++
]
=
snd
;
}
}
start
=
tmp
?
tmp
+
1
:
NULL
;
start
=
tmp
?
tmp
+
1
:
NULL
;
...
@@ -12009,16 +11996,17 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
...
@@ -12009,16 +11996,17 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
}
else
if
(
STREQ
(
arg
,
"-S"
))
{
}
else
if
(
STREQ
(
arg
,
"-S"
))
{
/* ignore, always added by libvirt */
/* ignore, always added by libvirt */
}
else
{
}
else
{
char
*
tmp
=
NULL
;
/* something we can't yet parse. Add it to the qemu namespace
/* something we can't yet parse. Add it to the qemu namespace
* cmdline/environment advanced options and hope for the best
* cmdline/environment advanced options and hope for the best
*/
*/
VIR_WARN
(
"unknown QEMU argument '%s', adding to the qemu namespace"
,
VIR_WARN
(
"unknown QEMU argument '%s', adding to the qemu namespace"
,
arg
);
arg
);
if
(
VIR_
REALLOC_N
(
cmd
->
args
,
cmd
->
num_args
+
1
)
<
0
)
if
(
VIR_
STRDUP
(
tmp
,
arg
)
<
0
||
goto
error
;
VIR_APPEND_ELEMENT
(
cmd
->
args
,
cmd
->
num_args
,
tmp
)
<
0
)
{
if
(
VIR_STRDUP
(
cmd
->
args
[
cmd
->
num_args
],
arg
)
<
0
)
VIR_FREE
(
tmp
);
goto
error
;
goto
error
;
cmd
->
num_args
++
;
}
}
}
}
}
...
@@ -12112,11 +12100,10 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
...
@@ -12112,11 +12100,10 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
goto
error
;
goto
error
;
}
}
if
(
VIR_
REALLOC_N
(
def
->
graphics
,
def
->
ngraphics
+
1
)
<
0
)
{
if
(
VIR_
APPEND_ELEMENT
(
def
->
graphics
,
def
->
ngraphics
,
sdl
)
<
0
)
{
virDomainGraphicsDefFree
(
sdl
);
virDomainGraphicsDefFree
(
sdl
);
goto
error
;
goto
error
;
}
}
def
->
graphics
[
def
->
ngraphics
++
]
=
sdl
;
}
}
if
(
def
->
ngraphics
)
{
if
(
def
->
ngraphics
)
{
...
@@ -12132,11 +12119,10 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
...
@@ -12132,11 +12119,10 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
virDomainVideoDefaultRAM
(
def
,
vid
->
type
)
:
0
;
virDomainVideoDefaultRAM
(
def
,
vid
->
type
)
:
0
;
vid
->
heads
=
1
;
vid
->
heads
=
1
;
if
(
VIR_
REALLOC_N
(
def
->
videos
,
def
->
nvideos
+
1
)
<
0
)
{
if
(
VIR_
APPEND_ELEMENT
(
def
->
videos
,
def
->
nvideos
,
vid
)
<
0
)
{
virDomainVideoDefFree
(
vid
);
virDomainVideoDefFree
(
vid
);
goto
error
;
goto
error
;
}
}
def
->
videos
[
def
->
nvideos
++
]
=
vid
;
}
}
/*
/*
...
...
src/qemu/qemu_conf.c
浏览文件 @
5ab80fc1
...
@@ -1084,13 +1084,7 @@ qemuRemoveSharedDevice(virQEMUDriverPtr driver,
...
@@ -1084,13 +1084,7 @@ qemuRemoveSharedDevice(virQEMUDriverPtr driver,
if
(
!
(
new_entry
=
qemuSharedDeviceEntryCopy
(
entry
)))
if
(
!
(
new_entry
=
qemuSharedDeviceEntryCopy
(
entry
)))
goto
cleanup
;
goto
cleanup
;
if
(
idx
!=
new_entry
->
ref
-
1
)
VIR_DELETE_ELEMENT
(
new_entry
->
domains
,
idx
,
new_entry
->
ref
);
memmove
(
&
new_entry
->
domains
[
idx
],
&
new_entry
->
domains
[
idx
+
1
],
sizeof
(
*
new_entry
->
domains
)
*
(
new_entry
->
ref
-
idx
-
1
));
VIR_SHRINK_N
(
new_entry
->
domains
,
new_entry
->
ref
,
1
);
if
(
virHashUpdateEntry
(
driver
->
sharedDevices
,
key
,
new_entry
)
<
0
){
if
(
virHashUpdateEntry
(
driver
->
sharedDevices
,
key
,
new_entry
)
<
0
){
qemuSharedDeviceEntryFree
(
new_entry
,
NULL
);
qemuSharedDeviceEntryFree
(
new_entry
,
NULL
);
goto
cleanup
;
goto
cleanup
;
...
...
src/qemu/qemu_conf.h
浏览文件 @
5ab80fc1
...
@@ -248,7 +248,7 @@ struct _virQEMUDriver {
...
@@ -248,7 +248,7 @@ struct _virQEMUDriver {
typedef
struct
_qemuDomainCmdlineDef
qemuDomainCmdlineDef
;
typedef
struct
_qemuDomainCmdlineDef
qemuDomainCmdlineDef
;
typedef
qemuDomainCmdlineDef
*
qemuDomainCmdlineDefPtr
;
typedef
qemuDomainCmdlineDef
*
qemuDomainCmdlineDefPtr
;
struct
_qemuDomainCmdlineDef
{
struct
_qemuDomainCmdlineDef
{
unsigned
in
t
num_args
;
size_
t
num_args
;
char
**
args
;
char
**
args
;
unsigned
int
num_env
;
unsigned
int
num_env
;
...
...
src/qemu/qemu_driver.c
浏览文件 @
5ab80fc1
...
@@ -4044,17 +4044,19 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver,
...
@@ -4044,17 +4044,19 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver,
*/
*/
virDomainVcpuPinDefPtr vcpupin = NULL;
virDomainVcpuPinDefPtr vcpupin = NULL;
if (VIR_REALLOC_N(vm->def->cputune.vcpupin,
vm->def->cputune.nvcpupin + 1) < 0)
goto cleanup;
if (VIR_ALLOC(vcpupin) < 0)
if (VIR_ALLOC(vcpupin) < 0)
goto cleanup;
goto cleanup;
vcpupin->cpumask = virBitmapNew(VIR_DOMAIN_CPUMASK_LEN);
vcpupin->cpumask = virBitmapNew(VIR_DOMAIN_CPUMASK_LEN);
virBitmapCopy(vcpupin->cpumask, vm->def->cpumask);
virBitmapCopy(vcpupin->cpumask, vm->def->cpumask);
vcpupin->vcpuid = i;
vcpupin->vcpuid = i;
vm->def->cputune.vcpupin[vm->def->cputune.nvcpupin++] = vcpupin;
if (VIR_APPEND_ELEMENT_COPY(vm->def->cputune.vcpupin,
vm->def->cputune.nvcpupin, vcpupin) < 0) {
virBitmapFree(vcpupin->cpumask);
VIR_FREE(vcpupin);
ret = -1;
goto cleanup;
}
if (cgroup_vcpu) {
if (cgroup_vcpu) {
if (qemuSetupCgroupVcpuPin(cgroup_vcpu,
if (qemuSetupCgroupVcpuPin(cgroup_vcpu,
...
...
src/qemu/qemu_monitor_json.c
浏览文件 @
5ab80fc1
...
@@ -1212,7 +1212,7 @@ qemuMonitorJSONExtractCPUInfo(virJSONValuePtr reply,
...
@@ -1212,7 +1212,7 @@ qemuMonitorJSONExtractCPUInfo(virJSONValuePtr reply,
goto
cleanup
;
goto
cleanup
;
}
}
if
(
VIR_
RE
ALLOC_N
(
threads
,
ncpus
)
<
0
)
if
(
VIR_ALLOC_N
(
threads
,
ncpus
)
<
0
)
goto
cleanup
;
goto
cleanup
;
for
(
i
=
0
;
i
<
ncpus
;
i
++
)
{
for
(
i
=
0
;
i
<
ncpus
;
i
++
)
{
...
...
src/qemu/qemu_monitor_text.c
浏览文件 @
5ab80fc1
...
@@ -529,11 +529,10 @@ int qemuMonitorTextGetCPUInfo(qemuMonitorPtr mon,
...
@@ -529,11 +529,10 @@ int qemuMonitorTextGetCPUInfo(qemuMonitorPtr mon,
if
(
end
==
NULL
||
!
c_isspace
(
*
end
))
if
(
end
==
NULL
||
!
c_isspace
(
*
end
))
goto
error
;
goto
error
;
if
(
VIR_
REALLOC_N
(
cpupids
,
ncpupids
+
1
)
<
0
)
if
(
VIR_
APPEND_ELEMENT_COPY
(
cpupids
,
ncpupids
,
tid
)
<
0
)
goto
error
;
goto
error
;
VIR_DEBUG
(
"tid=%d"
,
tid
);
VIR_DEBUG
(
"tid=%d"
,
tid
);
cpupids
[
ncpupids
++
]
=
tid
;
/* Skip to next data line */
/* Skip to next data line */
line
=
strchr
(
offset
,
'\r'
);
line
=
strchr
(
offset
,
'\r'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录