Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
1577e2d4
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看板
提交
1577e2d4
编写于
3月 25, 2014
作者:
J
Ján Tomko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Indent top-level labels by one space in src/lxc/
上级
40cc610a
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
158 addition
and
158 deletion
+158
-158
src/lxc/lxc_cgroup.c
src/lxc/lxc_cgroup.c
+8
-8
src/lxc/lxc_conf.c
src/lxc/lxc_conf.c
+3
-3
src/lxc/lxc_container.c
src/lxc/lxc_container.c
+21
-21
src/lxc/lxc_controller.c
src/lxc/lxc_controller.c
+27
-27
src/lxc/lxc_driver.c
src/lxc/lxc_driver.c
+68
-68
src/lxc/lxc_fuse.c
src/lxc/lxc_fuse.c
+5
-5
src/lxc/lxc_monitor.c
src/lxc/lxc_monitor.c
+2
-2
src/lxc/lxc_native.c
src/lxc/lxc_native.c
+10
-10
src/lxc/lxc_process.c
src/lxc/lxc_process.c
+14
-14
未找到文件。
src/lxc/lxc_cgroup.c
浏览文件 @
1577e2d4
...
...
@@ -51,7 +51,7 @@ static int virLXCCgroupSetupCpuTune(virDomainDefPtr def,
goto
cleanup
;
ret
=
0
;
cleanup:
cleanup:
return
ret
;
}
...
...
@@ -97,7 +97,7 @@ static int virLXCCgroupSetupCpusetTune(virDomainDefPtr def,
}
ret
=
0
;
cleanup:
cleanup:
VIR_FREE
(
mask
);
return
ret
;
}
...
...
@@ -168,7 +168,7 @@ static int virLXCCgroupSetupMemTune(virDomainDefPtr def,
goto
cleanup
;
ret
=
0
;
cleanup:
cleanup:
return
ret
;
}
...
...
@@ -263,7 +263,7 @@ static int virLXCCgroupGetMemStat(virCgroupPtr cgroup,
}
ret
=
0
;
cleanup:
cleanup:
VIR_FREE
(
line
);
VIR_FREE
(
statFile
);
VIR_FORCE_FCLOSE
(
statfd
);
...
...
@@ -292,7 +292,7 @@ int virLXCCgroupGetMeminfo(virLXCMeminfoPtr meminfo)
virLXCCgroupGetMemSwapUsage
(
cgroup
,
meminfo
);
ret
=
0
;
cleanup:
cleanup:
virCgroupFree
(
&
cgroup
);
return
ret
;
}
...
...
@@ -452,7 +452,7 @@ static int virLXCCgroupSetupDeviceACL(virDomainDefPtr def,
VIR_DEBUG
(
"Device whitelist complete"
);
ret
=
0
;
cleanup:
cleanup:
return
ret
;
}
...
...
@@ -498,7 +498,7 @@ virCgroupPtr virLXCCgroupCreate(virDomainDefPtr def)
}
}
cleanup:
cleanup:
return
cgroup
;
}
...
...
@@ -526,6 +526,6 @@ int virLXCCgroupSetup(virDomainDefPtr def,
ret
=
0
;
cleanup:
cleanup:
return
ret
;
}
src/lxc/lxc_conf.c
浏览文件 @
1577e2d4
...
...
@@ -157,7 +157,7 @@ virCapsPtr virLXCDriverCapsInit(virLXCDriverPtr driver)
return
caps
;
error:
error:
virObjectUnref
(
caps
);
return
NULL
;
}
...
...
@@ -230,7 +230,7 @@ virLXCDriverConfigNew(void)
goto
error
;
return
cfg
;
error:
error:
virObjectUnref
(
cfg
);
return
NULL
;
}
...
...
@@ -283,7 +283,7 @@ virLXCLoadDriverConfig(virLXCDriverConfigPtr cfg,
virConfFree
(
conf
);
done:
done:
return
0
;
}
...
...
src/lxc/lxc_container.c
浏览文件 @
1577e2d4
...
...
@@ -373,7 +373,7 @@ static int lxcContainerSetupFDs(int *ttyfd,
rc
=
0
;
cleanup:
cleanup:
VIR_DEBUG
(
"rc=%d"
,
rc
);
return
rc
;
}
...
...
@@ -400,7 +400,7 @@ int lxcContainerSendContinue(int control)
}
rc
=
0
;
error_out:
error_out:
return
rc
;
}
...
...
@@ -506,7 +506,7 @@ static int lxcContainerRenameAndEnableInterfaces(bool privNet,
if
(
veths
||
privNet
)
rc
=
virNetDevSetOnline
(
"lo"
,
true
);
error_out:
error_out:
VIR_FREE
(
newname
);
return
rc
;
}
...
...
@@ -580,7 +580,7 @@ static int lxcContainerUnmountSubtree(const char *prefix,
ret
=
0
;
cleanup:
cleanup:
virStringFreeList
(
mounts
);
return
ret
;
...
...
@@ -718,7 +718,7 @@ static int lxcContainerPivotRoot(virDomainFSDefPtr root)
ret
=
0
;
err:
err:
VIR_FREE
(
oldroot
);
VIR_FREE
(
newroot
);
...
...
@@ -805,7 +805,7 @@ static int lxcContainerSetReadOnly(void)
}
ret
=
0
;
cleanup:
cleanup:
for
(
i
=
0
;
i
<
nmounts
;
i
++
)
VIR_FREE
(
mounts
[
i
]);
VIR_FREE
(
mounts
);
...
...
@@ -892,7 +892,7 @@ static int lxcContainerMountBasicFS(bool userns_enabled)
rc
=
0
;
cleanup:
cleanup:
VIR_DEBUG
(
"rc=%d"
,
rc
);
return
rc
;
}
...
...
@@ -961,7 +961,7 @@ static int lxcContainerMountFSDev(virDomainDefPtr def,
ret
=
0
;
cleanup:
cleanup:
VIR_FREE
(
path
);
return
ret
;
}
...
...
@@ -996,7 +996,7 @@ static int lxcContainerMountFSDevPTS(virDomainDefPtr def,
}
ret
=
0
;
cleanup:
cleanup:
VIR_FREE
(
path
);
return
ret
;
}
...
...
@@ -1126,7 +1126,7 @@ static int lxcContainerMountFSBind(virDomainFSDefPtr fs,
ret
=
0
;
cleanup:
cleanup:
VIR_FREE
(
src
);
return
ret
;
}
...
...
@@ -1193,9 +1193,9 @@ lxcContainerMountDetectFilesystem(const char *src, char **type)
if
(
VIR_STRDUP
(
*
type
,
data
)
<
0
)
goto
cleanup
;
done:
done:
ret
=
0
;
cleanup:
cleanup:
VIR_FORCE_CLOSE
(
fd
);
if
(
blkid
)
blkid_free_probe
(
blkid
);
...
...
@@ -1237,7 +1237,7 @@ static int lxcContainerMountFSBlockAuto(virDomainFSDefPtr fs,
VIR_DEBUG
(
"src=%s dst=%s srcprefix=%s"
,
src
,
fs
->
dst
,
srcprefix
);
/* First time around we use /etc/filesystems */
retry:
retry:
if
(
virAsprintf
(
&
fslist
,
"%s%s"
,
srcprefix
,
tryProc
?
"/proc/filesystems"
:
"/etc/filesystems"
)
<
0
)
goto
cleanup
;
...
...
@@ -1338,7 +1338,7 @@ retry:
VIR_DEBUG
(
"Done mounting filesystem ret=%d tryProc=%d"
,
ret
,
tryProc
);
cleanup:
cleanup:
VIR_FREE
(
line
);
VIR_FREE
(
fslist
);
VIR_FORCE_FCLOSE
(
fp
);
...
...
@@ -1386,7 +1386,7 @@ static int lxcContainerMountFSBlockHelper(virDomainFSDefPtr fs,
ret
=
lxcContainerMountFSBlockAuto
(
fs
,
fsflags
,
src
,
srcprefix
,
sec_mount_options
);
}
cleanup:
cleanup:
VIR_FREE
(
format
);
return
ret
;
}
...
...
@@ -1408,7 +1408,7 @@ static int lxcContainerMountFSBlock(virDomainFSDefPtr fs,
VIR_DEBUG
(
"Done mounting filesystem ret=%d"
,
ret
);
cleanup:
cleanup:
VIR_FREE
(
src
);
return
ret
;
}
...
...
@@ -1452,7 +1452,7 @@ static int lxcContainerMountFSTmpfs(virDomainFSDefPtr fs,
ret
=
0
;
cleanup:
cleanup:
VIR_FREE
(
data
);
return
ret
;
}
...
...
@@ -1540,7 +1540,7 @@ int lxcContainerSetupHostdevCapsMakePath(const char *dev)
ret
=
0
;
cleanup:
cleanup:
VIR_FREE
(
dir
);
return
ret
;
}
...
...
@@ -1594,7 +1594,7 @@ static int lxcContainerUnmountForSharedRoot(const char *stateDir,
ret
=
0
;
cleanup:
cleanup:
VIR_FREE
(
tmp
);
return
ret
;
}
...
...
@@ -1682,7 +1682,7 @@ static int lxcContainerSetupPivotRoot(virDomainDefPtr vmDef,
ret
=
0
;
cleanup:
cleanup:
VIR_FREE
(
stateDir
);
virCgroupFree
(
&
cgroup
);
VIR_FREE
(
sec_mount_options
);
...
...
@@ -1894,7 +1894,7 @@ static int lxcContainerChild(void *data)
goto
cleanup
;
ret
=
0
;
cleanup:
cleanup:
VIR_FREE
(
ttyPath
);
VIR_FORCE_CLOSE
(
ttyfd
);
VIR_FORCE_CLOSE
(
argv
->
monitor
);
...
...
src/lxc/lxc_controller.c
浏览文件 @
1577e2d4
...
...
@@ -186,13 +186,13 @@ static virLXCControllerPtr virLXCControllerNew(const char *name)
NULL
))
<
0
)
goto
error
;
cleanup:
cleanup:
VIR_FREE
(
configFile
);
virObjectUnref
(
caps
);
virObjectUnref
(
xmlopt
);
return
ctrl
;
error:
error:
virLXCControllerFree
(
ctrl
);
ctrl
=
NULL
;
goto
cleanup
;
...
...
@@ -584,7 +584,7 @@ static int virLXCControllerSetupLoopDevices(virLXCControllerPtr ctrl)
VIR_DEBUG
(
"Setup all loop devices"
);
ret
=
0
;
cleanup:
cleanup:
return
ret
;
}
...
...
@@ -665,7 +665,7 @@ static int virLXCControllerGetNumadAdvice(virLXCControllerPtr ctrl,
ret
=
0
;
*
mask
=
nodemask
;
cleanup:
cleanup:
VIR_FREE
(
nodeset
);
return
ret
;
}
...
...
@@ -696,7 +696,7 @@ static int virLXCControllerSetupResourceLimits(virLXCControllerPtr ctrl)
goto
cleanup
;
ret
=
0
;
cleanup:
cleanup:
virBitmapFree
(
nodemask
);
return
ret
;
}
...
...
@@ -789,7 +789,7 @@ static int virLXCControllerSetupServer(virLXCControllerPtr ctrl)
VIR_FREE
(
sockpath
);
return
0
;
error:
error:
VIR_FREE
(
sockpath
);
virObjectUnref
(
ctrl
->
server
);
ctrl
->
server
=
NULL
;
...
...
@@ -945,7 +945,7 @@ static void virLXCControllerConsoleUpdateWatch(virLXCControllerConsolePtr consol
}
console
->
contEpoll
=
0
;
}
cleanup:
cleanup:
return
;
}
...
...
@@ -993,7 +993,7 @@ static void virLXCControllerConsoleEPoll(int watch, int fd, int events, void *op
}
}
cleanup:
cleanup:
virMutexUnlock
(
&
lock
);
}
...
...
@@ -1078,7 +1078,7 @@ static void virLXCControllerConsoleIO(int watch, int fd, int events, void *opaqu
virMutexUnlock
(
&
lock
);
return
;
error:
error:
virEventRemoveHandle
(
console
->
contWatch
);
virEventRemoveHandle
(
console
->
hostWatch
);
console
->
contWatch
=
console
->
hostWatch
=
-
1
;
...
...
@@ -1157,9 +1157,9 @@ static int virLXCControllerMain(virLXCControllerPtr ctrl)
if
(
!
err
||
err
->
code
==
VIR_ERR_OK
)
rc
=
wantReboot
?
1
:
0
;
cleanup:
cleanup:
virMutexDestroy
(
&
lock
);
cleanup2:
cleanup2:
for
(
i
=
0
;
i
<
ctrl
->
nconsoles
;
i
++
)
virLXCControllerConsoleClose
(
&
(
ctrl
->
consoles
[
i
]));
...
...
@@ -1192,11 +1192,11 @@ virLXCControllerSetupUsernsMap(virDomainIdMapEntryPtr map,
}
ret
=
0
;
cleanup:
cleanup:
virBufferFreeAndReset
(
&
map_value
);
return
ret
;
no_memory:
no_memory:
virReportOOMError
();
goto
cleanup
;
}
...
...
@@ -1235,7 +1235,7 @@ static int virLXCControllerSetupUserns(virLXCControllerPtr ctrl)
goto
cleanup
;
ret
=
0
;
cleanup:
cleanup:
VIR_FREE
(
uid_map
);
VIR_FREE
(
gid_map
);
return
ret
;
...
...
@@ -1285,7 +1285,7 @@ static int virLXCControllerSetupDev(virLXCControllerPtr ctrl)
goto
cleanup
;
ret
=
0
;
cleanup:
cleanup:
VIR_FREE
(
opts
);
VIR_FREE
(
mount_options
);
VIR_FREE
(
dev
);
...
...
@@ -1336,7 +1336,7 @@ static int virLXCControllerPopulateDevices(virLXCControllerPtr ctrl)
}
ret
=
0
;
cleanup:
cleanup:
VIR_FREE
(
path
);
return
ret
;
}
...
...
@@ -1411,7 +1411,7 @@ virLXCControllerSetupHostdevSubsysUSB(virDomainDefPtr vmDef,
ret
=
0
;
cleanup:
cleanup:
VIR_FREE
(
src
);
VIR_FREE
(
dstfile
);
VIR_FREE
(
dstdir
);
...
...
@@ -1491,7 +1491,7 @@ virLXCControllerSetupHostdevCapsStorage(virDomainDefPtr vmDef,
ret
=
0
;
cleanup:
cleanup:
def
->
source
.
caps
.
u
.
storage
.
block
=
dev
;
VIR_FREE
(
dst
);
VIR_FREE
(
path
);
...
...
@@ -1570,7 +1570,7 @@ virLXCControllerSetupHostdevCapsMisc(virDomainDefPtr vmDef,
ret
=
0
;
cleanup:
cleanup:
def
->
source
.
caps
.
u
.
misc
.
chardev
=
dev
;
VIR_FREE
(
dst
);
VIR_FREE
(
path
);
...
...
@@ -1732,7 +1732,7 @@ static int virLXCControllerSetupDisk(virLXCControllerPtr ctrl,
ret
=
0
;
cleanup:
cleanup:
def
->
src
.
path
=
tmpsrc
;
VIR_FREE
(
dst
);
return
ret
;
...
...
@@ -1878,7 +1878,7 @@ lxcCreateTty(virLXCControllerPtr ctrl, int *ttymaster,
ret
=
0
;
cleanup:
cleanup:
if
(
ret
!=
0
)
{
VIR_FORCE_CLOSE
(
*
ttymaster
);
VIR_FREE
(
*
ttyName
);
...
...
@@ -1927,7 +1927,7 @@ virLXCControllerSetupPrivateNS(void)
}
ret
=
0
;
cleanup:
cleanup:
return
ret
;
}
...
...
@@ -1985,7 +1985,7 @@ virLXCControllerSetupDevPTS(virLXCControllerPtr ctrl)
ret
=
0
;
cleanup:
cleanup:
VIR_FREE
(
opts
);
VIR_FREE
(
devpts
);
VIR_FREE
(
mount_options
);
...
...
@@ -2031,7 +2031,7 @@ virLXCControllerSetupConsoles(virLXCControllerPtr ctrl,
}
ret
=
0
;
cleanup:
cleanup:
VIR_FREE
(
ttyHostPath
);
return
ret
;
}
...
...
@@ -2073,7 +2073,7 @@ virLXCControllerEventSend(virLXCControllerPtr ctrl,
xdr_free
(
proc
,
data
);
return
;
error:
error:
virNetMessageFree
(
msg
);
xdr_free
(
proc
,
data
);
}
...
...
@@ -2246,7 +2246,7 @@ virLXCControllerRun(virLXCControllerPtr ctrl)
virLXCControllerEventSendExit
(
ctrl
,
rc
);
cleanup:
cleanup:
VIR_FORCE_CLOSE
(
control
[
0
]);
VIR_FORCE_CLOSE
(
control
[
1
]);
VIR_FORCE_CLOSE
(
containerhandshake
[
0
]);
...
...
@@ -2474,7 +2474,7 @@ int main(int argc, char *argv[])
rc
=
virLXCControllerRun
(
ctrl
);
cleanup:
cleanup:
if
(
rc
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
if
(
err
&&
err
->
message
)
...
...
src/lxc/lxc_driver.c
浏览文件 @
1577e2d4
...
...
@@ -262,7 +262,7 @@ static virDomainPtr lxcDomainLookupByID(virConnectPtr conn,
if
(
dom
)
dom
->
id
=
vm
->
def
->
id
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
dom
;
...
...
@@ -292,7 +292,7 @@ static virDomainPtr lxcDomainLookupByUUID(virConnectPtr conn,
if
(
dom
)
dom
->
id
=
vm
->
def
->
id
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
dom
;
...
...
@@ -319,7 +319,7 @@ static virDomainPtr lxcDomainLookupByName(virConnectPtr conn,
if
(
dom
)
dom
->
id
=
vm
->
def
->
id
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
dom
;
...
...
@@ -339,7 +339,7 @@ static int lxcDomainIsActive(virDomainPtr dom)
ret
=
virDomainObjIsActive
(
obj
);
cleanup:
cleanup:
if
(
obj
)
virObjectUnlock
(
obj
);
return
ret
;
...
...
@@ -359,7 +359,7 @@ static int lxcDomainIsPersistent(virDomainPtr dom)
ret
=
obj
->
persistent
;
cleanup:
cleanup:
if
(
obj
)
virObjectUnlock
(
obj
);
return
ret
;
...
...
@@ -378,7 +378,7 @@ static int lxcDomainIsUpdated(virDomainPtr dom)
ret
=
obj
->
updated
;
cleanup:
cleanup:
if
(
obj
)
virObjectUnlock
(
obj
);
return
ret
;
...
...
@@ -499,7 +499,7 @@ static virDomainPtr lxcDomainDefineXML(virConnectPtr conn, const char *xml)
if
(
dom
)
dom
->
id
=
vm
->
def
->
id
;
cleanup:
cleanup:
virDomainDefFree
(
def
);
virDomainDefFree
(
oldDef
);
if
(
vm
)
...
...
@@ -552,7 +552,7 @@ static int lxcDomainUndefineFlags(virDomainPtr dom,
ret
=
0
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
if
(
event
)
...
...
@@ -608,7 +608,7 @@ static int lxcDomainGetInfo(virDomainPtr dom,
info
->
nrVirtCpu
=
vm
->
def
->
vcpus
;
ret
=
0
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
ret
;
...
...
@@ -634,7 +634,7 @@ lxcDomainGetState(virDomainPtr dom,
*
state
=
virDomainObjGetState
(
vm
,
reason
);
ret
=
0
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
ret
;
...
...
@@ -654,7 +654,7 @@ static char *lxcDomainGetOSType(virDomainPtr dom)
if
(
VIR_STRDUP
(
ret
,
vm
->
def
->
os
.
type
)
<
0
)
goto
cleanup
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
ret
;
...
...
@@ -675,7 +675,7 @@ lxcDomainGetMaxMemory(virDomainPtr dom)
ret
=
vm
->
def
->
mem
.
max_balloon
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
ret
;
...
...
@@ -701,7 +701,7 @@ static int lxcDomainSetMaxMemory(virDomainPtr dom, unsigned long newmax)
vm
->
def
->
mem
.
max_balloon
=
newmax
;
ret
=
0
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
ret
;
...
...
@@ -741,7 +741,7 @@ static int lxcDomainSetMemory(virDomainPtr dom, unsigned long newmem)
ret
=
0
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
ret
;
...
...
@@ -871,7 +871,7 @@ lxcDomainSetMemoryParameters(virDomainPtr dom,
goto
cleanup
;
ret
=
0
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
virObjectUnref
(
caps
);
...
...
@@ -968,7 +968,7 @@ lxcDomainGetMemoryParameters(virDomainPtr dom,
*
nparams
=
LXC_NB_MEM_PARAM
;
ret
=
0
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
virObjectUnref
(
caps
);
...
...
@@ -993,7 +993,7 @@ static char *lxcDomainGetXMLDesc(virDomainPtr dom,
vm
->
newDef
?
vm
->
newDef
:
vm
->
def
,
flags
);
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
ret
;
...
...
@@ -1023,7 +1023,7 @@ static char *lxcConnectDomainXMLFromNative(virConnectPtr conn,
xml
=
virDomainDefFormat
(
def
,
0
);
cleanup:
cleanup:
virDomainDefFree
(
def
);
return
xml
;
}
...
...
@@ -1084,7 +1084,7 @@ static int lxcDomainCreateWithFiles(virDomainPtr dom,
virDomainAuditStart
(
vm
,
"booted"
,
false
);
}
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
if
(
event
)
...
...
@@ -1197,7 +1197,7 @@ lxcDomainCreateXMLWithFiles(virConnectPtr conn,
if
(
dom
)
dom
->
id
=
vm
->
def
->
id
;
cleanup:
cleanup:
virDomainDefFree
(
def
);
if
(
vm
)
virObjectUnlock
(
vm
);
...
...
@@ -1273,7 +1273,7 @@ static int lxcDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr secla
ret
=
0
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
ret
;
...
...
@@ -1317,7 +1317,7 @@ static int lxcNodeGetSecurityModel(virConnectPtr conn,
goto
cleanup
;
}
cleanup:
cleanup:
virObjectUnref
(
caps
);
return
ret
;
}
...
...
@@ -1448,7 +1448,7 @@ lxcDomainDestroyFlags(virDomainPtr dom,
vm
=
NULL
;
}
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
if
(
event
)
...
...
@@ -1500,7 +1500,7 @@ lxcSecurityInit(virLXCDriverConfigPtr cfg)
return
mgr
;
error:
error:
VIR_ERROR
(
_
(
"Failed to initialize security drivers"
));
virObjectUnref
(
mgr
);
return
NULL
;
...
...
@@ -1607,7 +1607,7 @@ static int lxcStateInitialize(bool privileged,
virNWFilterRegisterCallbackDriver
(
&
lxcCallbackDriver
);
return
0
;
cleanup:
cleanup:
virObjectUnref
(
caps
);
lxcStateCleanup
();
return
-
1
;
...
...
@@ -1776,7 +1776,7 @@ static char *lxcDomainGetSchedulerType(virDomainPtr dom,
ignore_value
(
VIR_STRDUP
(
ret
,
"posix"
));
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
ret
;
...
...
@@ -1821,7 +1821,7 @@ static int lxcSetVcpuBWLive(virCgroupPtr cgroup, unsigned long long period,
return
0
;
error:
error:
if
(
period
)
{
virErrorPtr
saved
=
virSaveLastError
();
virCgroupSetCpuCfsPeriod
(
cgroup
,
old_period
);
...
...
@@ -1951,7 +1951,7 @@ lxcDomainSetSchedulerParametersFlags(virDomainPtr dom,
ret
=
0
;
cleanup:
cleanup:
virDomainDefFree
(
vmdef
);
if
(
vm
)
virObjectUnlock
(
vm
);
...
...
@@ -2032,7 +2032,7 @@ lxcDomainGetSchedulerParametersFlags(virDomainPtr dom,
if
(
rc
!=
0
)
goto
cleanup
;
}
out:
out:
if
(
virTypedParameterAssign
(
&
params
[
0
],
VIR_DOMAIN_SCHEDULER_CPU_SHARES
,
VIR_TYPED_PARAM_ULLONG
,
shares
)
<
0
)
goto
cleanup
;
...
...
@@ -2060,7 +2060,7 @@ out:
ret
=
0
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
virObjectUnref
(
caps
);
...
...
@@ -2162,11 +2162,11 @@ lxcDomainParseBlkioDeviceStr(char *blkioDeviceStr, const char *type,
return
0
;
error:
error:
virReportError
(
VIR_ERR_INVALID_ARG
,
_
(
"unable to parse blkio device '%s' '%s'"
),
type
,
blkioDeviceStr
);
cleanup:
cleanup:
virBlkioDeviceArrayClear
(
result
,
ndevices
);
VIR_FREE
(
result
);
return
-
1
;
...
...
@@ -2300,7 +2300,7 @@ lxcDomainBlockStats(virDomainPtr dom,
&
stats
->
wr_bytes
,
&
stats
->
rd_req
,
&
stats
->
wr_req
);
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
ret
;
...
...
@@ -2426,7 +2426,7 @@ lxcDomainBlockStatsFlags(virDomainPtr dom,
ret
=
0
;
*
nparams
=
tmp
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
ret
;
...
...
@@ -2633,7 +2633,7 @@ lxcDomainSetBlkioParameters(virDomainPtr dom,
ret
=
-
1
;
}
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
virObjectUnref
(
caps
);
...
...
@@ -3049,7 +3049,7 @@ lxcDomainGetBlkioParameters(virDomainPtr dom,
*
nparams
=
LXC_NB_BLKIO_PARAM
;
ret
=
0
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
virObjectUnref
(
caps
);
...
...
@@ -3094,7 +3094,7 @@ lxcDomainInterfaceStats(virDomainPtr dom,
virReportError
(
VIR_ERR_INVALID_ARG
,
_
(
"Invalid path, '%s' is not a known interface"
),
path
);
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
ret
;
...
...
@@ -3125,7 +3125,7 @@ static int lxcDomainGetAutostart(virDomainPtr dom,
*
autostart
=
vm
->
autostart
;
ret
=
0
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
ret
;
...
...
@@ -3194,7 +3194,7 @@ static int lxcDomainSetAutostart(virDomainPtr dom,
vm
->
autostart
=
autostart
;
ret
=
0
;
cleanup:
cleanup:
VIR_FREE
(
configFile
);
VIR_FREE
(
autostartLink
);
if
(
vm
)
...
...
@@ -3275,7 +3275,7 @@ static int lxcFreezeContainer(virDomainObjPtr vm)
VIR_FREE
(
state
);
}
VIR_DEBUG
(
"lxcFreezeContainer timeout"
);
error:
error:
/*
* If timeout or an error on reading the state occurs,
* activate the group again and return an error.
...
...
@@ -3284,7 +3284,7 @@ error:
virCgroupSetFreezerState
(
priv
->
cgroup
,
"THAWED"
);
ret
=
-
1
;
cleanup:
cleanup:
VIR_FREE
(
state
);
return
ret
;
}
...
...
@@ -3326,7 +3326,7 @@ static int lxcDomainSuspend(virDomainPtr dom)
goto
cleanup
;
ret
=
0
;
cleanup:
cleanup:
if
(
event
)
virObjectEventStateQueue
(
driver
->
domainEventState
,
event
);
if
(
vm
)
...
...
@@ -3376,7 +3376,7 @@ static int lxcDomainResume(virDomainPtr dom)
goto
cleanup
;
ret
=
0
;
cleanup:
cleanup:
if
(
event
)
virObjectEventStateQueue
(
driver
->
domainEventState
,
event
);
if
(
vm
)
...
...
@@ -3443,7 +3443,7 @@ lxcDomainOpenConsole(virDomainPtr dom,
goto
cleanup
;
ret
=
0
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
ret
;
...
...
@@ -3516,7 +3516,7 @@ lxcDomainSendProcessSignal(virDomainPtr dom,
ret
=
0
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
ret
;
...
...
@@ -3615,7 +3615,7 @@ lxcDomainShutdownFlags(virDomainPtr dom,
ret
=
0
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
ret
;
...
...
@@ -3692,7 +3692,7 @@ lxcDomainReboot(virDomainPtr dom,
ret
=
0
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
ret
;
...
...
@@ -3750,7 +3750,7 @@ lxcDomainAttachDeviceConfig(virDomainDefPtr vmdef,
break
;
}
cleanup:
cleanup:
return
ret
;
}
...
...
@@ -3793,7 +3793,7 @@ lxcDomainUpdateDeviceConfig(virDomainDefPtr vmdef,
break
;
}
cleanup:
cleanup:
return
ret
;
}
...
...
@@ -3858,7 +3858,7 @@ lxcDomainDetachDeviceConfig(virDomainDefPtr vmdef,
break
;
}
cleanup:
cleanup:
return
ret
;
}
...
...
@@ -4113,7 +4113,7 @@ lxcDomainAttachDeviceDiskLive(virLXCDriverPtr driver,
ret
=
0
;
cleanup:
cleanup:
if
(
src
)
virDomainAuditDisk
(
vm
,
NULL
,
src
,
"attach"
,
ret
==
0
);
VIR_FREE
(
file
);
...
...
@@ -4230,7 +4230,7 @@ lxcDomainAttachDeviceNetLive(virConnectPtr conn,
ret
=
0
;
cleanup:
cleanup:
if
(
!
ret
)
{
vm
->
def
->
nets
[
vm
->
def
->
nnets
++
]
=
net
;
}
else
if
(
veth
)
{
...
...
@@ -4316,7 +4316,7 @@ lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDriverPtr driver,
ret
=
0
;
cleanup:
cleanup:
virDomainAuditHostdev
(
vm
,
def
,
"attach"
,
ret
==
0
);
virUSBDeviceFree
(
usb
);
VIR_FREE
(
src
);
...
...
@@ -4390,7 +4390,7 @@ lxcDomainAttachDeviceHostdevStorageLive(virLXCDriverPtr driver,
ret
=
0
;
cleanup:
cleanup:
virDomainAuditHostdev
(
vm
,
def
,
"attach"
,
ret
==
0
);
return
ret
;
}
...
...
@@ -4462,7 +4462,7 @@ lxcDomainAttachDeviceHostdevMiscLive(virLXCDriverPtr driver,
ret
=
0
;
cleanup:
cleanup:
virDomainAuditHostdev
(
vm
,
def
,
"attach"
,
ret
==
0
);
return
ret
;
}
...
...
@@ -4632,7 +4632,7 @@ lxcDomainDetachDeviceDiskLive(virDomainObjPtr vm,
ret
=
0
;
cleanup:
cleanup:
VIR_FREE
(
dst
);
return
ret
;
}
...
...
@@ -4694,7 +4694,7 @@ lxcDomainDetachDeviceNetLive(virDomainObjPtr vm,
virDomainNetGetActualBridgeName
(
detach
),
detach
->
ifname
));
ret
=
0
;
cleanup:
cleanup:
if
(
!
ret
)
{
networkReleaseActualDevice
(
vm
->
def
,
detach
);
virDomainNetRemove
(
vm
->
def
,
detachidx
);
...
...
@@ -4760,7 +4760,7 @@ lxcDomainDetachDeviceHostdevUSBLive(virLXCDriverPtr driver,
ret
=
0
;
cleanup:
cleanup:
virUSBDeviceFree
(
usb
);
VIR_FREE
(
dst
);
return
ret
;
...
...
@@ -4811,7 +4811,7 @@ lxcDomainDetachDeviceHostdevStorageLive(virDomainObjPtr vm,
ret
=
0
;
cleanup:
cleanup:
return
ret
;
}
...
...
@@ -4860,7 +4860,7 @@ lxcDomainDetachDeviceHostdevMiscLive(virDomainObjPtr vm,
ret
=
0
;
cleanup:
cleanup:
return
ret
;
}
...
...
@@ -5070,7 +5070,7 @@ static int lxcDomainAttachDeviceFlags(virDomainPtr dom,
}
}
cleanup:
cleanup:
virDomainDefFree
(
vmdef
);
if
(
dev
!=
dev_copy
)
virDomainDeviceDefFree
(
dev_copy
);
...
...
@@ -5192,7 +5192,7 @@ static int lxcDomainUpdateDeviceFlags(virDomainPtr dom,
}
}
cleanup:
cleanup:
virDomainDefFree
(
vmdef
);
if
(
dev
!=
dev_copy
)
virDomainDeviceDefFree
(
dev_copy
);
...
...
@@ -5312,7 +5312,7 @@ static int lxcDomainDetachDeviceFlags(virDomainPtr dom,
}
}
cleanup:
cleanup:
virDomainDefFree
(
vmdef
);
if
(
dev
!=
dev_copy
)
virDomainDeviceDefFree
(
dev_copy
);
...
...
@@ -5369,7 +5369,7 @@ static int lxcDomainLxcOpenNamespace(virDomainPtr dom,
goto
cleanup
;
ret
=
nfds
;
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
ret
;
...
...
@@ -5465,7 +5465,7 @@ lxcDomainMemoryStats(virDomainPtr dom,
ret
++
;
}
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
ret
;
...
...
@@ -5606,7 +5606,7 @@ lxcDomainSetMetadata(virDomainPtr dom,
ret
=
virDomainObjSetMetadata
(
vm
,
type
,
metadata
,
key
,
uri
,
caps
,
driver
->
xmlopt
,
cfg
->
configDir
,
flags
);
cleanup:
cleanup:
virObjectUnlock
(
vm
);
virObjectUnref
(
caps
);
virObjectUnref
(
cfg
);
...
...
@@ -5636,7 +5636,7 @@ lxcDomainGetMetadata(virDomainPtr dom,
ret
=
virDomainObjGetMetadata
(
vm
,
type
,
uri
,
caps
,
driver
->
xmlopt
,
flags
);
cleanup:
cleanup:
virObjectUnlock
(
vm
);
virObjectUnref
(
caps
);
return
ret
;
...
...
@@ -5683,7 +5683,7 @@ lxcDomainGetCPUStats(virDomainPtr dom,
else
ret
=
virCgroupGetPercpuStats
(
priv
->
cgroup
,
params
,
nparams
,
start_cpu
,
ncpus
);
cleanup:
cleanup:
if
(
vm
)
virObjectUnlock
(
vm
);
return
ret
;
...
...
src/lxc/lxc_fuse.c
浏览文件 @
1577e2d4
...
...
@@ -78,7 +78,7 @@ static int lxcProcGetattr(const char *path, struct stat *stbuf)
}
else
res
=
-
ENOENT
;
cleanup:
cleanup:
VIR_FREE
(
mempath
);
return
res
;
}
...
...
@@ -219,7 +219,7 @@ static int lxcProcReadMeminfo(char *hostpath, virDomainDefPtr def,
res
=
copied
;
memcpy
(
buf
,
virBufferCurrentContent
(
new_meminfo
),
copied
);
cleanup:
cleanup:
VIR_FREE
(
line
);
virBufferFreeAndReset
(
new_meminfo
);
VIR_FORCE_FCLOSE
(
fd
);
...
...
@@ -322,14 +322,14 @@ int lxcSetupFuse(virLXCFusePtr *f, virDomainDefPtr def)
}
ret
=
0
;
cleanup:
cleanup:
fuse_opt_free_args
(
&
args
);
*
f
=
fuse
;
return
ret
;
cleanup1:
cleanup1:
VIR_FREE
(
fuse
->
mountpoint
);
virMutexDestroy
(
&
fuse
->
lock
);
cleanup2:
cleanup2:
VIR_FREE
(
fuse
);
goto
cleanup
;
}
...
...
src/lxc/lxc_monitor.c
浏览文件 @
1577e2d4
...
...
@@ -183,11 +183,11 @@ virLXCMonitorPtr virLXCMonitorNew(virDomainObjPtr vm,
virNetClientSetCloseCallback
(
mon
->
client
,
virLXCMonitorEOFNotify
,
mon
,
virLXCMonitorCloseFreeCallback
);
cleanup:
cleanup:
VIR_FREE
(
sockpath
);
return
mon
;
error:
error:
virObjectUnref
(
mon
);
mon
=
NULL
;
goto
cleanup
;
...
...
src/lxc/lxc_native.c
浏览文件 @
1577e2d4
...
...
@@ -130,7 +130,7 @@ static char ** lxcStringSplit(const char *string)
virStringFreeList
(
parts
);
return
result
;
error:
error:
VIR_FREE
(
tmp
);
virStringFreeList
(
parts
);
virStringFreeList
(
result
);
...
...
@@ -162,7 +162,7 @@ lxcParseFstabLine(char *fstabLine)
return
fstab
;
error:
error:
lxcFstabFree
(
fstab
);
virStringFreeList
(
parts
);
return
NULL
;
...
...
@@ -187,7 +187,7 @@ lxcAddFSDef(virDomainDefPtr def,
return
0
;
error:
error:
virDomainFSDefFree
(
fsDef
);
return
-
1
;
}
...
...
@@ -236,7 +236,7 @@ lxcConvertSize(const char *size, unsigned long long *value)
return
0
;
error:
error:
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"failed to convert size: '%s'"
),
size
);
...
...
@@ -384,7 +384,7 @@ lxcCreateNetDef(const char *type,
return
net
;
error:
error:
virDomainNetDefFree
(
net
);
return
NULL
;
}
...
...
@@ -462,7 +462,7 @@ lxcAddNetworkDefinition(virDomainDefPtr def,
return
1
;
error:
error:
virDomainNetDefFree
(
net
);
virDomainHostdevDefFree
(
hostdev
);
return
-
1
;
...
...
@@ -594,7 +594,7 @@ lxcCreateConsoles(virDomainDefPtr def, virConfPtr properties)
return
0
;
error:
error:
virDomainChrDefFree
(
console
);
return
-
1
;
}
...
...
@@ -696,7 +696,7 @@ lxcSetCpuTune(virDomainDefPtr def, virConfPtr properties)
return
0
;
error:
error:
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"failed to parse integer: '%s'"
),
value
->
str
);
return
-
1
;
...
...
@@ -934,11 +934,11 @@ lxcParseConfigString(const char *config)
goto
cleanup
;
error:
error:
virDomainDefFree
(
vmdef
);
vmdef
=
NULL
;
cleanup:
cleanup:
virConfFree
(
properties
);
return
vmdef
;
...
...
src/lxc/lxc_process.c
浏览文件 @
1577e2d4
...
...
@@ -129,7 +129,7 @@ virLXCProcessReboot(virLXCDriverPtr driver,
ret
=
0
;
cleanup:
cleanup:
virObjectUnref
(
conn
);
return
ret
;
}
...
...
@@ -287,7 +287,7 @@ char *virLXCProcessSetupInterfaceBridged(virConnectPtr conn,
ret
=
containerVeth
;
cleanup:
cleanup:
return
ret
;
}
...
...
@@ -343,7 +343,7 @@ char *virLXCProcessSetupInterfaceDirect(virConnectPtr conn,
ret
=
res_ifname
;
cleanup:
cleanup:
virObjectUnref
(
cfg
);
return
ret
;
}
...
...
@@ -469,7 +469,7 @@ static int virLXCProcessSetupInterfaces(virConnectPtr conn,
ret
=
0
;
cleanup:
cleanup:
if
(
ret
<
0
)
{
for
(
i
=
0
;
i
<
def
->
nnets
;
i
++
)
{
virDomainNetDefPtr
iface
=
def
->
nets
[
i
];
...
...
@@ -588,7 +588,7 @@ virLXCProcessGetNsInode(pid_t pid,
*
inode
=
sb
.
st_ino
;
ret
=
0
;
cleanup:
cleanup:
VIR_FREE
(
path
);
return
ret
;
}
...
...
@@ -660,7 +660,7 @@ static virLXCMonitorPtr virLXCProcessConnectMonitor(virLXCDriverPtr driver,
goto
cleanup
;
}
cleanup:
cleanup:
virObjectUnref
(
cfg
);
return
monitor
;
}
...
...
@@ -742,7 +742,7 @@ int virLXCProcessStop(virLXCDriverPtr driver,
}
}
cleanup:
cleanup:
virLXCProcessCleanup
(
driver
,
vm
,
reason
);
return
0
;
...
...
@@ -829,7 +829,7 @@ virLXCProcessBuildControllerCmd(virLXCDriverPtr driver,
virCommandPassFD
(
cmd
,
handshakefd
,
0
);
return
cmd
;
cleanup:
cleanup:
virCommandFree
(
cmd
);
virObjectUnref
(
cfg
);
return
NULL
;
...
...
@@ -916,7 +916,7 @@ virLXCProcessReadLogOutputData(virDomainObjPtr vm,
_
(
"Timed out while reading log output: %s"
),
buf
);
cleanup:
cleanup:
return
ret
;
}
...
...
@@ -981,7 +981,7 @@ virLXCProcessEnsureRootFS(virDomainObjPtr vm)
return
0
;
error:
error:
virDomainFSDefFree
(
root
);
return
-
1
;
}
...
...
@@ -1348,7 +1348,7 @@ int virLXCProcessStart(virConnectPtr conn,
rc
=
0
;
cleanup:
cleanup:
if
(
rc
!=
0
&&
!
err
)
err
=
virSaveLastError
();
virCommandFree
(
cmd
);
...
...
@@ -1399,7 +1399,7 @@ cleanup:
return
rc
;
error:
error:
err
=
virSaveLastError
();
virLXCProcessStop
(
driver
,
vm
,
VIR_DOMAIN_SHUTOFF_FAILED
);
goto
cleanup
;
...
...
@@ -1527,11 +1527,11 @@ virLXCProcessReconnectDomain(virDomainObjPtr vm,
}
ret
=
0
;
cleanup:
cleanup:
virObjectUnlock
(
vm
);
return
ret
;
error:
error:
virLXCProcessStop
(
driver
,
vm
,
VIR_DOMAIN_SHUTOFF_FAILED
);
virDomainAuditStop
(
vm
,
"failed"
);
goto
cleanup
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录